/* ===============================================
   🎨 Красивый дизайн тестов - Modern Test Design
   =============================================== */

/* ===============================================
   Карточки выбора тестов
   =============================================== */
.test-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
    margin: 40px 0;
    perspective: 1000px;
    background: radial-gradient(circle at 10% 10%, rgba(127, 90, 240, 0.08), transparent 35%),
                radial-gradient(circle at 90% 20%, rgba(0, 210, 255, 0.08), transparent 35%);
    border-radius: 24px;
    padding: 10px;
}

.test-card {
    position: relative;
    background: linear-gradient(145deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    background-size: 200% 200%;
    color: white;
    padding: 30px;
    border-radius: 24px;
    cursor: pointer;
    transition: all 0.5s cubic-bezier(0.23, 1, 0.32, 1);
    box-shadow: 0 10px 40px rgba(102, 126, 234, 0.3);
    overflow: hidden;
    transform-style: preserve-3d;
    min-height: 200px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    isolation: isolate;
}

/* Защита для мобильных: карточки тестов не должны становиться невидимыми при скролле */
#tests-grid .test-card {
    opacity: 1 !important;
    transform: none !important;
}

.test-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, 
        rgba(255,255,255,0.2) 0%, 
        rgba(255,255,255,0) 50%,
        rgba(255,255,255,0.1) 100%);
    border-radius: 24px;
    pointer-events: none;
}

.test-card::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.3) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.5s;
    pointer-events: none;
    mix-blend-mode: screen;
}

.test-card:hover {
    transform: translateY(-15px) rotateX(5deg) scale(1.02);
    box-shadow: 
        0 25px 60px rgba(102, 126, 234, 0.5),
        0 0 0 1px rgba(255,255,255,0.2);
    background-position: 100% 100%;
}

.test-card:hover::after {
    opacity: 1;
}

.test-card:active {
    transform: translateY(-5px) scale(0.98);
}

/* Иконка карточки теста */
.test-card-icon {
    font-size: 3.5em;
    margin-bottom: 15px;
    text-shadow: 0 4px 15px rgba(0,0,0,0.2);
    position: relative;
    z-index: 1;
    animation: iconFloat 3s ease-in-out infinite;
}

@keyframes iconFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

.test-card h3 {
    font-size: 1.5em;
    font-weight: 700;
    margin-bottom: 12px;
    text-shadow: 0 2px 10px rgba(0,0,0,0.2);
    position: relative;
    z-index: 1;
}

.test-card p {
    opacity: 0.95;
    font-size: 1em;
    line-height: 1.5;
    text-shadow: 0 1px 5px rgba(0,0,0,0.1);
    position: relative;
    z-index: 1;
    margin-bottom: 15px;
}

/* Бейдж с количеством вопросов */
.test-card-badge {
    display: inline-block;
    background: rgba(255,255,255,0.25);
    backdrop-filter: blur(10px);
    padding: 8px 18px;
    border-radius: 50px;
    font-size: 0.85em;
    font-weight: 600;
    letter-spacing: 0.5px;
    position: relative;
    z-index: 1;
    border: 1px solid rgba(255,255,255,0.3);
    align-self: flex-start;
    margin-top: auto;
}

/* Разные цветовые схемы для карточек */
.test-card:nth-child(1) {
    background: linear-gradient(145deg, #667eea 0%, #764ba2 100%);
}

.test-card:nth-child(2) {
    background: linear-gradient(145deg, #f093fb 0%, #f5576c 100%);
}

.test-card:nth-child(3) {
    background: linear-gradient(145deg, #4facfe 0%, #00f2fe 100%);
}

.test-card:nth-child(4) {
    background: linear-gradient(145deg, #43e97b 0%, #38f9d7 100%);
}

/* ===============================================
   Контейнер вопросов теста
   =============================================== */
.test-container.active {
    animation: slideUpFade 0.7s cubic-bezier(0.25, 1, 0.5, 1);
}

.test-container {
    overflow-anchor: none;
    padding-bottom: 120px;
}

#tests .test-container,
#test-questions-container {
    scrollbar-gutter: stable both-edges;
    overscroll-behavior: contain;
}

.status-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 14px;
}

.status-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(102, 126, 234, 0.2);
    box-shadow: 0 8px 24px rgba(0,0,0,0.06);
    backdrop-filter: blur(6px);
    font-weight: 700;
    color: #2e3350;
}

.status-chip.strong {
    background: linear-gradient(135deg, #7f5af0 0%, #5f8bff 100%);
    color: #fff;
    border: 1px solid rgba(255,255,255,0.35);
    box-shadow: 0 12px 28px rgba(95,139,255,0.35);
}

.status-chip.muted {
    background: linear-gradient(135deg, #f7f9fc 0%, #eef2f9 100%);
    color: #3f4661;
}

@keyframes slideUpFade {
    from {
        opacity: 0;
        transform: translateY(40px) scale(0.985);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Лёгкий параллакс фона вопроса */
.question-card {
    position: relative;
    overflow: hidden;
}

.question-card::after {
    content: '';
    position: absolute;
    inset: -20% -10% auto auto;
    height: 60%;
    width: 50%;
    background: radial-gradient(circle at 30% 30%, rgba(127, 90, 240, 0.15), transparent 55%);
    filter: blur(6px);
    transform: translateY(var(--parallax-offset, 0px));
    transition: transform 0.4s ease;
    pointer-events: none;
}

.question-card:hover::after {
    --parallax-offset: -6px;
}

/* ===============================================
   Прогресс-бар теста
   =============================================== */
.progress-bar {
    height: 16px;
    background: linear-gradient(145deg, #e8ecef, #f5f7fa);
    border-radius: 100px;
    overflow: hidden;
    box-shadow: 
        inset 0 2px 6px rgba(0,0,0,0.1),
        0 2px 4px rgba(255,255,255,0.8);
    position: relative;
    border: 1px solid rgba(102, 126, 234, 0.15);
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, 
        #667eea 0%, 
        #764ba2 40%, 
        #f093fb 80%,
        #4facfe 100%);
    background-size: 300% 100%;
    border-radius: 100px;
    transition: width 0.8s cubic-bezier(0.23, 1, 0.32, 1);
    animation: progressShine 3s ease-in-out infinite;
    position: relative;
    overflow: hidden;
}

.progress-fill::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, 
        transparent, 
        rgba(255,255,255,0.6),
        transparent);
    animation: shimmerProgress 2s infinite;
}

@keyframes shimmerProgress {
    0% { left: -100%; }
    100% { left: 200%; }
}

@keyframes progressShine {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.progress-text {
    text-align: center;
    font-weight: 700;
    font-size: 1.1em;
    margin: 15px 0;
    background: linear-gradient(90deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ===============================================
   Панель навигации по вопросам
   =============================================== */
.question-nav-panel {
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    border-radius: 20px;
    padding: 25px;
    margin-bottom: 25px;
    box-shadow: 
        0 10px 40px rgba(102, 126, 234, 0.1),
        0 0 0 1px rgba(102, 126, 234, 0.05);
    border: 1px solid rgba(102, 126, 234, 0.1);
}

.question-nav-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.question-nav-header h3 {
    font-size: 1.2em;
    font-weight: 700;
    background: linear-gradient(135deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.question-nav-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(45px, 1fr));
    gap: 10px;
    max-width: 100%;
}

.question-nav-btn {
    width: 45px;
    height: 45px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #e8ecef;
    background: linear-gradient(145deg, #ffffff, #f5f7fa);
    color: #667eea;
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.23, 1, 0.32, 1);
    box-shadow: 0 3px 10px rgba(0,0,0,0.05);
    position: relative;
    overflow: hidden;
}

.question-nav-btn:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.3);
}

.question-nav-btn.answered {
    background: linear-gradient(145deg, #4CAF50, #45a049);
    border-color: #4CAF50;
    color: white;
    box-shadow: 0 4px 15px rgba(76, 175, 80, 0.4);
}

.question-nav-btn.current {
    background: linear-gradient(145deg, #667eea, #764ba2);
    border-color: #667eea;
    color: white;
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.5);
    animation: currentPulse 2s infinite;
}

@keyframes currentPulse {
    0%, 100% { 
        box-shadow: 0 4px 20px rgba(102, 126, 234, 0.5);
        transform: scale(1);
    }
    50% { 
        box-shadow: 0 8px 30px rgba(102, 126, 234, 0.7);
        transform: scale(1.05);
    }
}

.question-nav-btn.skipped {
    background: linear-gradient(145deg, #ff9800, #f57c00);
    border-color: #ff9800;
    color: white;
    box-shadow: 0 4px 15px rgba(255, 152, 0, 0.4);
}

.question-nav-btn.marked {
    background: linear-gradient(145deg, #9c27b0, #7b1fa2);
    border-color: #9c27b0;
    color: white;
    box-shadow: 0 4px 15px rgba(156, 39, 176, 0.4);
}

.question-nav-btn.marked::after {
    content: '🚩';
    position: absolute;
    top: -5px;
    right: -5px;
    font-size: 12px;
}

.question-nav-btn.empty {
    background: linear-gradient(145deg, #ff6b6b, #ee5a52);
    border-color: #ff6b6b;
    color: white;
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.4);
}

/* Статистика вопросов */
.question-stats {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 2px dashed rgba(102, 126, 234, 0.2);
}

.question-stat {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
    color: #555;
}

.question-stat-color {
    width: 18px;
    height: 18px;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

/* Кнопки действий внутри теста */
.question-actions .btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 22px;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.25);
    font-weight: 700;
    letter-spacing: 0.2px;
    cursor: pointer;
    transition: transform 0.22s ease, box-shadow 0.3s ease, background 0.3s ease;
    backdrop-filter: blur(4px);
    position: relative;
    overflow: hidden;
}

.question-actions .btn::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 20% 20%, rgba(255,255,255,0.2), transparent 50%);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.question-actions .btn-primary {
    background: linear-gradient(120deg, #7f5af0 0%, #5f8bff 50%, #00d2ff 100%);
    color: #ffffff;
    box-shadow: 0 14px 30px rgba(95, 139, 255, 0.35);
    border-color: rgba(255, 255, 255, 0.35);
}

.question-actions .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 18px 38px rgba(95, 139, 255, 0.45);
    background: linear-gradient(120deg, #8a63ff 0%, #6aa5ff 50%, #26e0ff 100%);
    filter: saturate(1.05);
}

.question-actions .btn-primary:active {
    transform: translateY(0px) scale(0.99);
}

.question-actions .btn-secondary {
    background: linear-gradient(135deg, #f4f7fb 0%, #eef1f7 100%);
    color: #2b2f38;
    border: 1px solid rgba(102, 126, 234, 0.25);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.06);
}

.question-actions .btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 30px rgba(0, 0, 0, 0.08);
    filter: saturate(1.05);
}

.question-actions .btn-secondary:active {
    transform: translateY(0px) scale(0.99);
}

.question-actions .btn-skip {
    background: linear-gradient(120deg, #ffb347 0%, #ffcc33 100%);
    color: #4a3215;
    border: 1px solid rgba(255, 179, 71, 0.5);
    box-shadow: 0 12px 28px rgba(255, 179, 71, 0.35);
}

.question-actions .btn-skip:hover {
    transform: translateY(-2px);
    box-shadow: 0 16px 34px rgba(255, 179, 71, 0.45);
    background: linear-gradient(120deg, #ffc163 0%, #ffe585 100%);
    filter: saturate(1.05);
}

.question-actions .btn-skip:active {
    transform: translateY(0px) scale(0.99);
}

.question-actions .btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* ===============================================
   Красивые кнопки тестов
   =============================================== */
.test-button {
    position: relative;
    padding: 15px 30px;
    border: none;
    border-radius: 16px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
    overflow: hidden;
    background: linear-gradient(145deg, #667eea, #764ba2);
    color: white;
    box-shadow: 
        0 8px 25px rgba(102, 126, 234, 0.4),
        0 0 0 1px rgba(255,255,255,0.1) inset;
    letter-spacing: 0.5px;
}

.test-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, 
        transparent, 
        rgba(255,255,255,0.3),
        transparent);
    transition: left 0.5s;
}

.test-button:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 
        0 15px 35px rgba(102, 126, 234, 0.5),
        0 0 0 1px rgba(255,255,255,0.2) inset;
}

.test-button:hover::before {
    left: 100%;
}

.test-button:active {
    transform: translateY(-2px) scale(0.98);
}

.test-button i {
    margin-right: 8px;
    font-size: 18px;
}

/* Варианты кнопок */
.test-button.secondary {
    background: linear-gradient(145deg, #f5f7fa, #e8ecef);
    color: #667eea;
    box-shadow: 
        0 8px 25px rgba(0,0,0,0.1),
        0 0 0 1px rgba(102, 126, 234, 0.2) inset;
}

.test-button.secondary:hover {
    background: linear-gradient(145deg, #667eea, #764ba2);
    color: white;
    box-shadow: 0 15px 35px rgba(102, 126, 234, 0.4);
}

.test-button.success {
    background: linear-gradient(145deg, #4CAF50, #45a049);
    box-shadow: 0 8px 25px rgba(76, 175, 80, 0.4);
}

.test-button.success:hover {
    box-shadow: 0 15px 35px rgba(76, 175, 80, 0.5);
}

.test-button.warning {
    background: linear-gradient(145deg, #ff9800, #f57c00);
    box-shadow: 0 8px 25px rgba(255, 152, 0, 0.4);
}

.test-button.warning:hover {
    box-shadow: 0 15px 35px rgba(255, 152, 0, 0.5);
}

.test-button.danger {
    background: linear-gradient(145deg, #ff6b6b, #ee5a52);
    box-shadow: 0 8px 25px rgba(255, 107, 107, 0.4);
}

.test-button.danger:hover {
    box-shadow: 0 15px 35px rgba(255, 107, 107, 0.5);
}

.test-button.pulse {
    animation: buttonPulse 2s infinite;
}

@keyframes buttonPulse {
    0%, 100% { 
        box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
    }
    50% { 
        box-shadow: 
            0 8px 25px rgba(102, 126, 234, 0.4),
            0 0 0 8px rgba(102, 126, 234, 0.2);
    }
}

/* ===============================================
   Варианты ответов - Красивые карточки
   =============================================== */
.options-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin: 30px 0;
}

.option {
    position: relative;
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 20px 25px;
    border-radius: 18px;
    background: linear-gradient(145deg, #ffffff, #f8fafc);
    border: 2px solid #e8ecef;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    overflow: hidden;
}

.option::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 5px;
    height: 100%;
    background: linear-gradient(180deg, #667eea, #764ba2);
    transform: scaleY(0);
    transition: transform 0.3s cubic-bezier(0.23, 1, 0.32, 1);
}

.option:hover {
    transform: translateX(8px) scale(1.01);
    border-color: #7f5af0;
    box-shadow: 0 12px 34px rgba(127, 90, 240, 0.18);
}

.option:hover::before {
    transform: scaleY(1);
}

.option input[type="radio"] {
    width: 24px;
    height: 24px;
    accent-color: #667eea;
    cursor: pointer;
    position: relative;
    z-index: 1;
}

.option span {
    font-size: 17px;
    font-weight: 500;
    color: #333;
    flex: 1;
    line-height: 1.5;
    position: relative;
    z-index: 1;
}

.option.selected {
    background: linear-gradient(145deg, rgba(127, 90, 240, 0.12), rgba(95, 139, 255, 0.1));
    border-color: #7f5af0;
    box-shadow: 
        0 14px 38px rgba(127, 90, 240, 0.24),
        inset 0 0 0 1px rgba(127, 90, 240, 0.35);
}

.option.selected::before {
    transform: scaleY(1);
}

.option.selected span {
    color: #667eea;
    font-weight: 600;
}

/* Состояния после проверки */
.option.correct {
    background: linear-gradient(145deg, rgba(76, 175, 80, 0.1), rgba(69, 160, 73, 0.05));
    border-color: #4CAF50;
    box-shadow: 0 8px 30px rgba(76, 175, 80, 0.2);
}

.option.correct::before {
    background: linear-gradient(180deg, #4CAF50, #45a049);
    transform: scaleY(1);
}

.option.correct::after {
    content: '✓';
    position: absolute;
    right: 20px;
    font-size: 24px;
    color: #4CAF50;
    font-weight: bold;
}

.option.incorrect {
    background: linear-gradient(145deg, rgba(255, 107, 107, 0.1), rgba(238, 90, 82, 0.05));
    border-color: #ff6b6b;
    box-shadow: 0 8px 30px rgba(255, 107, 107, 0.2);
}

.option.incorrect::before {
    background: linear-gradient(180deg, #ff6b6b, #ee5a52);
    transform: scaleY(1);
}

.option.incorrect::after {
    content: '✗';
    position: absolute;
    right: 20px;
    font-size: 24px;
    color: #ff6b6b;
    font-weight: bold;
}

/* ===============================================
   Контейнер результатов - Красивый анализ
   =============================================== */
.result-container {
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    border-radius: 30px;
    padding: 50px 40px;
    margin: 40px 0;
    box-shadow: 
        0 30px 80px rgba(102, 126, 234, 0.15),
        0 0 0 1px rgba(102, 126, 234, 0.05);
    animation: resultAppear 0.8s cubic-bezier(0.23, 1, 0.32, 1);
    position: relative;
    overflow: hidden;
}

.result-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 6px;
    background: linear-gradient(90deg, #667eea, #764ba2, #f093fb, #4facfe);
    background-size: 300% 100%;
    animation: gradientMove 4s ease infinite;
}

@keyframes gradientMove {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@keyframes resultAppear {
    from {
        opacity: 0;
        transform: translateY(50px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.result-container.show {
    display: block;
}

/* Заголовок результатов */
.result-header {
    text-align: center;
    margin-bottom: 50px;
}

.result-header h2 {
    font-size: 2.5em;
    font-weight: 800;
    background: linear-gradient(135deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 25px;
    text-shadow: 0 10px 30px rgba(102, 126, 234, 0.2);
}

/* Анимированный счетчик результата */
.result-score {
    font-size: 6em;
    font-weight: 900;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1;
    margin: 30px 0;
    position: relative;
    animation: scoreReveal 1.5s cubic-bezier(0.23, 1, 0.32, 1);
}

@keyframes scoreReveal {
    0% { 
        opacity: 0;
        transform: scale(0.5);
        filter: blur(10px);
    }
    50% {
        transform: scale(1.1);
    }
    100% { 
        opacity: 1;
        transform: scale(1);
        filter: blur(0);
    }
}

.result-title {
    font-size: 1.5em;
    font-weight: 600;
    color: #555;
    margin-top: 15px;
}

.result-message {
    font-size: 1.1em;
    color: #666;
    line-height: 1.7;
    text-align: center;
    max-width: 700px;
    margin: 0 auto;
    padding: 25px 30px;
    background: linear-gradient(145deg, rgba(102, 126, 234, 0.05), rgba(118, 75, 162, 0.03));
    border-radius: 20px;
    border: 1px solid rgba(102, 126, 234, 0.1);
}

/* ===============================================
   Статистика результатов
   =============================================== */
.result-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 25px;
    margin: 50px 0;
}

.stat-item {
    background: linear-gradient(145deg, #ffffff, #f8fafc);
    padding: 30px 25px;
    border-radius: 24px;
    text-align: center;
    box-shadow: 
        0 10px 40px rgba(0,0,0,0.08),
        0 0 0 1px rgba(102, 126, 234, 0.05);
    transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
    position: relative;
    overflow: hidden;
}

.stat-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #667eea, #764ba2);
    transform: scaleX(0);
    transition: transform 0.4s;
}

.stat-item:hover {
    transform: translateY(-10px);
    box-shadow: 
        0 20px 50px rgba(102, 126, 234, 0.15),
        0 0 0 1px rgba(102, 126, 234, 0.1);
}

.stat-item:hover::before {
    transform: scaleX(1);
}

.stat-item .stat-icon {
    font-size: 3em;
    margin-bottom: 15px;
    display: block;
}

.stat-item .stat-value {
    font-size: 2.5em;
    font-weight: 800;
    background: linear-gradient(135deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 10px;
}

.stat-item .stat-label {
    font-size: 0.9em;
    font-weight: 600;
    color: #777;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* ===============================================
   Секция анализа
   =============================================== */
.analysis-section {
    background: linear-gradient(145deg, #ffffff, #f8fafc);
    border-radius: 24px;
    padding: 40px;
    margin: 40px 0;
    box-shadow: 0 15px 50px rgba(0,0,0,0.08);
}

.analysis-section h3 {
    font-size: 1.6em;
    font-weight: 700;
    color: #333;
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 3px solid;
    border-image: linear-gradient(90deg, #667eea, #764ba2) 1;
    display: flex;
    align-items: center;
    gap: 15px;
}

.analysis-section h3 i {
    font-size: 1.2em;
    background: linear-gradient(135deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Оценка уровня */
.grade-estimate {
    background: linear-gradient(145deg, #667eea, #764ba2);
    color: white;
    padding: 25px 35px;
    border-radius: 20px;
    text-align: center;
    font-size: 1.3em;
    font-weight: 700;
    margin: 30px 0;
    box-shadow: 0 15px 40px rgba(102, 126, 234, 0.4);
    position: relative;
    overflow: hidden;
}

.grade-estimate::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.2) 0%, transparent 60%);
    animation: gradeShine 3s ease-in-out infinite;
}

@keyframes gradeShine {
    0%, 100% { transform: rotate(0deg); }
    50% { transform: rotate(180deg); }
}

/* Сильные и слабые стороны */
.strengths, .weaknesses, .recommendations {
    margin: 30px 0;
    padding: 25px;
    border-radius: 18px;
    position: relative;
    overflow: hidden;
}

.strengths {
    background: linear-gradient(145deg, rgba(76, 175, 80, 0.08), rgba(69, 160, 73, 0.03));
    border-left: 5px solid #4CAF50;
}

.strengths h4 {
    color: #4CAF50;
    font-size: 1.3em;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.strengths h4::before {
    content: '💪';
    font-size: 1.5em;
}

.weaknesses {
    background: linear-gradient(145deg, rgba(255, 152, 0, 0.08), rgba(245, 124, 0, 0.03));
    border-left: 5px solid #ff9800;
}

.weaknesses h4 {
    color: #ff9800;
    font-size: 1.3em;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.weaknesses h4::before {
    content: '📝';
    font-size: 1.5em;
}

.recommendations {
    background: linear-gradient(145deg, rgba(33, 150, 243, 0.08), rgba(25, 118, 210, 0.03));
    border-left: 5px solid #2196F3;
}

.recommendations h4 {
    color: #2196F3;
    font-size: 1.3em;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.recommendations h4::before {
    content: '💡';
    font-size: 1.5em;
}

/* Списки категорий */
.category-list {
    background: rgba(255,255,255,0.7);
    padding: 20px 25px;
    border-radius: 15px;
    margin: 15px 0;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}

.category-list ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.category-list li {
    padding: 12px 0;
    border-bottom: 1px dashed rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 500;
    color: #444;
}

.category-list li:last-child {
    border-bottom: none;
}

.category-list li::before {
    content: '▹';
    color: #667eea;
    font-weight: bold;
}

/* ===============================================
   Детальный обзор ответов
   =============================================== */
.detailed-answers {
    margin-top: 50px;
}

.detailed-answers h3 {
    font-size: 1.6em;
    font-weight: 700;
    color: #333;
    margin-bottom: 30px;
    display: flex;
    align-items: center;
    gap: 15px;
}

.detailed-answers h3::before {
    content: '📋';
    font-size: 1.3em;
}

.answer-review {
    background: linear-gradient(145deg, #ffffff, #f8fafc);
    border-radius: 20px;
    padding: 30px;
    margin: 20px 0;
    box-shadow: 0 8px 30px rgba(0,0,0,0.06);
    transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
    position: relative;
    overflow: hidden;
}

.answer-review::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 6px;
    height: 100%;
}

.answer-review:hover {
    transform: translateX(8px);
    box-shadow: 0 15px 45px rgba(0,0,0,0.1);
}

.answer-review.correct::before {
    background: linear-gradient(180deg, #4CAF50, #45a049);
}

.answer-review.correct {
    border-left: none;
    background: linear-gradient(145deg, rgba(76, 175, 80, 0.05), #ffffff);
}

.answer-review.incorrect::before {
    background: linear-gradient(180deg, #ff6b6b, #ee5a52);
}

.answer-review.incorrect {
    border-left: none;
    background: linear-gradient(145deg, rgba(255, 107, 107, 0.05), #ffffff);
}

.answer-review.orientation::before {
    background: linear-gradient(180deg, #5f8bff, #7f5af0);
}

.answer-review.orientation {
    border-left: none;
    background: linear-gradient(145deg, rgba(127, 90, 240, 0.06), #ffffff);
}

.answer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.question-num {
    font-weight: 700;
    font-size: 1.2em;
    color: #333;
}

.difficulty-badge {
    background: linear-gradient(145deg, #f5f7fa, #e8ecef);
    padding: 8px 18px;
    border-radius: 50px;
    font-size: 0.85em;
    font-weight: 600;
    color: #667eea;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.result-badge {
    padding: 8px 20px;
    border-radius: 50px;
    font-size: 0.85em;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.result-badge.correct {
    background: linear-gradient(145deg, #4CAF50, #45a049);
    color: white;
    box-shadow: 0 4px 15px rgba(76, 175, 80, 0.3);
}

.result-badge.incorrect {
    background: linear-gradient(145deg, #ff6b6b, #ee5a52);
    color: white;
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.3);
}

.result-badge.orientation {
    background: linear-gradient(145deg, #5f8bff, #7f5af0);
    color: white;
    box-shadow: 0 4px 15px rgba(95, 139, 255, 0.3);
}

.answer-question {
    font-size: 1.15em;
    font-weight: 600;
    color: #333;
    line-height: 1.6;
    margin-bottom: 20px;
}

.answer-details {
    display: grid;
    gap: 15px;
    margin: 20px 0;
}

.your-answer, .correct-answer {
    padding: 15px 20px;
    border-radius: 12px;
    font-weight: 500;
}

.your-answer {
    background: linear-gradient(145deg, rgba(102, 126, 234, 0.08), rgba(118, 75, 162, 0.05));
    border: 1px solid rgba(102, 126, 234, 0.2);
}

.your-answer strong {
    color: #667eea;
}

.correct-answer {
    background: linear-gradient(145deg, rgba(76, 175, 80, 0.08), rgba(69, 160, 73, 0.05));
    border: 1px solid rgba(76, 175, 80, 0.2);
}

.correct-answer strong {
    color: #4CAF50;
}

.answer-explanation {
    background: linear-gradient(145deg, #f8fafc, #f1f3f5);
    padding: 20px 25px;
    border-radius: 15px;
    margin-top: 20px;
    border-left: 4px solid #667eea;
    font-size: 0.95em;
    line-height: 1.7;
    color: #555;
}

.answer-explanation strong {
    color: #667eea;
}

/* ===============================================
   Кнопки действий результатов
   =============================================== */
.result-actions {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 50px;
    padding-top: 40px;
    border-top: 2px dashed rgba(102, 126, 234, 0.2);
}

/* ===============================================
   Адаптивный дизайн
   =============================================== */
@media (max-width: 768px) {
    .test-cards {
        grid-template-columns: 1fr;
    }
    
    .result-container {
        padding: 30px 20px;
        border-radius: 20px;
    }
    
    .result-score {
        font-size: 4em;
    }
    
    .result-header h2 {
        font-size: 1.8em;
    }
    
    .result-stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    
    .stat-item {
        padding: 20px 15px;
    }
    
    .stat-item .stat-value {
        font-size: 2em;
    }
    
    .analysis-section {
        padding: 25px 20px;
    }
    
    .question-nav-grid {
        grid-template-columns: repeat(5, 1fr);
    }
    
    .question-nav-btn {
        width: 40px;
        height: 40px;
        font-size: 12px;
    }
    
    .test-controls {
        flex-direction: column;
        gap: 15px;
    }
    
    .test-button {
        width: 100%;
        justify-content: center;
    }
    
    .option {
        padding: 15px 18px;
    }
}

@media (max-width: 480px) {
    .result-score {
        font-size: 3em;
    }
    
    .result-stats {
        grid-template-columns: 1fr;
    }
    
    .question-nav-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .question-stats {
        flex-direction: column;
        gap: 10px;
    }
}

/* ===============================================
   Тёмная тема
   =============================================== */
[data-theme="dark"] .test-card {
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

[data-theme="dark"] .question-nav-panel {
    background: linear-gradient(180deg, #1e1e2e 0%, #16161d 100%);
    border-color: rgba(102, 126, 234, 0.2);
}

[data-theme="dark"] .question-nav-btn {
    background: linear-gradient(145deg, #2a2a3a, #1e1e2e);
    border-color: #3a3a4a;
    color: #a8b5ff;
}

[data-theme="dark"] .option {
    background: linear-gradient(145deg, #2a2a3a, #1e1e2e);
    border-color: #3a3a4a;
}

[data-theme="dark"] .option span {
    color: #e0e0e0;
}

[data-theme="dark"] .result-container {
    background: linear-gradient(180deg, #1e1e2e 0%, #16161d 100%);
}

[data-theme="dark"] .stat-item,
[data-theme="dark"] .analysis-section,
[data-theme="dark"] .answer-review {
    background: linear-gradient(145deg, #2a2a3a, #1e1e2e);
}

[data-theme="dark"] .result-message {
    background: linear-gradient(145deg, rgba(102, 126, 234, 0.1), rgba(118, 75, 162, 0.05));
}

/* ===============================================
   Плавные переходы для всех элементов
   =============================================== */
.test-card,
.test-button,
.option,
.question-nav-btn,
.stat-item,
.answer-review {
    will-change: transform, box-shadow;
}

/* ===============================================
   Accessibility - Focus States
   =============================================== */
.test-button:focus,
.option:focus,
.question-nav-btn:focus {
    outline: none;
    box-shadow: 
        0 0 0 3px rgba(102, 126, 234, 0.5),
        0 8px 25px rgba(102, 126, 234, 0.4);
}

/* ===============================================
   Печать
   =============================================== */
@media print {
    .test-controls,
    .question-nav-panel,
    .result-actions {
        display: none;
    }
    
    .result-container {
        box-shadow: none;
        border: 1px solid #ddd;
    }
}

/* ===============================================
   Дополнительные анимации и эффекты
   =============================================== */

/* Анимация появления карточек */
.test-card {
    animation: cardAppear 0.6s ease-out backwards;
}

.test-card:nth-child(1) { animation-delay: 0.1s; }
.test-card:nth-child(2) { animation-delay: 0.2s; }
.test-card:nth-child(3) { animation-delay: 0.3s; }
.test-card:nth-child(4) { animation-delay: 0.4s; }

@keyframes cardAppear {
    from {
        opacity: 0;
        transform: translateY(40px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Анимация пульсации для текущего вопроса */
@keyframes questionPulse {
    0%, 100% { box-shadow: 0 4px 20px rgba(102, 126, 234, 0.3); }
    50% { box-shadow: 0 8px 30px rgba(102, 126, 234, 0.5); }
}

/* Конфетти эффект для отличного результата */
.result-container.excellent::after {
    content: '🎉';
    position: absolute;
    font-size: 5em;
    top: 20px;
    right: 20px;
    animation: bounce 1s ease infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-20px); }
}

/* Сияющий эффект для кнопок */
.test-button.glow {
    animation: buttonGlow 2s ease-in-out infinite;
}

@keyframes buttonGlow {
    0%, 100% {
        box-shadow: 0 0 5px rgba(102, 126, 234, 0.4);
    }
    50% {
        box-shadow: 0 0 20px rgba(102, 126, 234, 0.6), 
                    0 0 40px rgba(118, 75, 162, 0.4);
    }
}

/* Плавающие частицы фона */
.test-card::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(circle at 20% 80%, rgba(255,255,255,0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(255,255,255,0.1) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

/* Индикатор прогресса с процентом */
.progress-bar::after {
    content: '';
    position: absolute;
    top: 50%;
    right: 10px;
    transform: translateY(-50%);
    font-size: 12px;
    font-weight: 700;
    color: white;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

/* Волновая анимация для карточек */
.test-card:hover::before {
    animation: wave 0.5s ease-out;
}

@keyframes wave {
    0% {
        transform: scale(0);
        opacity: 0.5;
    }
    100% {
        transform: scale(2);
        opacity: 0;
    }
}

/* Стеклянный эффект для модалок */
.glass-effect {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

/* Лоадер для загрузки вопросов */
.question-loader {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px;
}

.question-loader::after {
    content: '';
    width: 40px;
    height: 40px;
    border: 4px solid #e8ecef;
    border-top-color: #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Тултипы */
.tooltip {
    position: relative;
}

.tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    padding: 8px 16px;
    background: #333;
    color: white;
    font-size: 14px;
    border-radius: 8px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s;
}

.tooltip:hover::after {
    opacity: 1;
    bottom: calc(100% + 10px);
}

/* Счётчик анимация */
.stat-value {
    animation: countUp 1s ease-out;
}

@keyframes countUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Skeleton loader для статистики */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: 8px;
}

@keyframes skeleton-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Эффект успешного ответа */
.option.correct-answer {
    animation: correctPulse 0.5s ease;
}

@keyframes correctPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.02); }
}

/* Эффект неправильного ответа */
.option.wrong-answer {
    animation: wrongShake 0.5s ease;
}

@keyframes wrongShake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* Украшения для секции анализа */
.analysis-section::before {
    content: '';
    position: absolute;
    top: -2px;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 4px;
    background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 2px;
}

/* Разделители для секций */
.section-divider {
    height: 2px;
    background: linear-gradient(90deg, transparent, #667eea, transparent);
    margin: 40px 0;
}

/* Кастомные чекбоксы и радио */
.option input[type="radio"] {
    appearance: none;
    -webkit-appearance: none;
    width: 24px;
    height: 24px;
    border: 2px solid #d1d5db;
    border-radius: 50%;
    background: white;
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
}

.option input[type="radio"]:checked {
    border-color: #667eea;
    background: #667eea;
}

.option input[type="radio"]:checked::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 8px;
    height: 8px;
    background: white;
    border-radius: 50%;
}

.option input[type="radio"]:hover {
    border-color: #667eea;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
}

/* Улучшенные тени */
.shadow-soft {
    box-shadow: 
        0 2px 4px rgba(0,0,0,0.04),
        0 4px 8px rgba(0,0,0,0.04),
        0 8px 16px rgba(0,0,0,0.04);
}

.shadow-heavy {
    box-shadow: 
        0 4px 8px rgba(0,0,0,0.08),
        0 8px 16px rgba(0,0,0,0.08),
        0 16px 32px rgba(0,0,0,0.08);
}
