.test-result {
    --primary: #4361ee;
    --primary-dark: #3a56d4;
    --success: #06d6a0;
    --success-dark: #05c793;
    --danger: #ef476f;
    --danger-dark: #ec3361;
    --warning: #ffd166;
    --dark: #2b2d42;
    --light: #f8f9fa;
    --gray: #6c757d;
    --border-radius: 12px;
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    --transition: all 0.3s ease;
}

.test-result .result-header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 2rem 1.5rem;
    border-radius: 16px;
    margin-bottom: 2rem;
    position: relative;
    overflow: hidden;
    text-align: center;
    box-shadow: var(--shadow);
}

.test-result .result-header.fail {
    background: linear-gradient(135deg, #f72585 0%, #7209b7 100%);
}


.test-result .result-header.success::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 20% 30%, rgba(255, 255, 255, 0.4) 0%, transparent 25%),
    radial-gradient(circle at 80% 20%, rgba(255, 215, 0, 0.3) 0%, transparent 30%),
    radial-gradient(circle at 40% 70%, rgba(255, 255, 255, 0.3) 0%, transparent 35%),
    radial-gradient(circle at 60% 80%, rgba(255, 215, 0, 0.4) 0%, transparent 40%);
    animation: successFireworks 2s ease-in-out infinite;
    z-index: 1;
}

@keyframes successFireworks {
    0%, 100% {
        opacity: 0.5;
        transform: scale(1);
    }
    25% {
        opacity: 0.8;
        transform: scale(1.05);
    }
    50% {
        opacity: 0.6;
        transform: scale(1.02);
    }
    75% {
        opacity: 0.9;
        transform: scale(1.08);
    }
}

.test-result .result-header.fail::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    right: -50%;
    bottom: -50%;
    background: radial-gradient(circle at center, rgba(255, 100, 100, 0.3) 0%, transparent 50%),
    radial-gradient(circle at 30% 30%, rgba(255, 50, 50, 0.2) 0%, transparent 40%),
    radial-gradient(circle at 70% 70%, rgba(255, 150, 150, 0.25) 0%, transparent 45%);
    animation: failPulse 3s ease-in-out infinite;
    z-index: 1;
}

@keyframes failPulse {
    0%, 100% {
        opacity: 0.3;
        transform: scale(1) rotate(0deg);
    }
    33% {
        opacity: 0.6;
        transform: scale(1.1) rotate(120deg);
    }
    66% {
        opacity: 0.4;
        transform: scale(1.05) rotate(240deg);
    }
}


.test-result .result-header.success::after {
    position: absolute;
    top: 10%;
    left: 0;
    right: 0;
    font-size: 1.5rem;
    color: rgba(255, 255, 255, 0.8);
    animation: floatingStars 4s ease-in-out infinite;
    z-index: 1;
}

@keyframes floatingStars {
    0%, 100% {
        transform: translateY(0px) rotate(0deg);
        opacity: 0.7;
    }
    50% {
        transform: translateY(-20px) rotate(180deg);
        opacity: 1;
    }
}

.test-result .result-header.fail::after {
    position: absolute;
    bottom: 10%;
    left: 0;
    right: 0;
    font-size: 1.2rem;
    color: rgba(255, 255, 255, 0.6);
    animation: sinkingDots 3s ease-in-out infinite;
    z-index: 1;
}

@keyframes sinkingDots {
    0%, 100% {
        transform: translateY(0px);
        opacity: 0.5;
    }
    50% {
        transform: translateY(15px);
        opacity: 0.8;
    }
}

.test-result .result-header-content {
    position: relative;
    z-index: 2;
}

.test-result .result-icon {
    font-size: 3rem;
    margin-bottom: 0.75rem;
    display: block;
    animation: iconFloat 2s ease-in-out infinite;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
}

@keyframes iconFloat {
    0%, 100% {
        transform: translateY(0px) scale(1) rotate(0deg);
    }
    33% {
        transform: translateY(-8px) scale(1.1) rotate(5deg);
    }
    66% {
        transform: translateY(-4px) scale(1.05) rotate(-3deg);
    }
}

.test-result .result-title {
    font-size: 1.8rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    text-shadow: 2px 2px 6px rgba(0, 0, 0, 0.4);
    animation: textGlow 2s ease-in-out infinite alternate;
}

@keyframes textGlow {
    0% {
        text-shadow: 2px 2px 6px rgba(0, 0, 0, 0.4);
    }
    100% {
        text-shadow: 2px 2px 12px rgba(255, 255, 255, 0.3);
    }
}

.test-result .result-subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
    margin-bottom: 1rem;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.3);
}

.test-result .motivation-message {
    font-size: 1.2rem;
    font-weight: 700;
    margin: 1.5rem;
    padding: 1.2rem 2rem;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 15px;
    backdrop-filter: blur(12px);
    border: 2px solid rgba(255, 255, 255, 0.3);
    display: inline-block;
    animation: messagePulse 3s ease-in-out infinite;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

@keyframes messagePulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 12px 35px rgba(0, 0, 0, 0.3);
    }
}

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

.test-result .stat-number {
    font-size: 1.5rem;
    font-weight: 800;
    text-shadow: 1px 1px 4px rgba(0, 0, 0, 0.3);
}

.test-result .stat-label {
    font-size: 0.9rem;
    opacity: 0.9;
    margin-top: 0.3rem;
    font-weight: 500;
}

.test-result .summary-card {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    padding: 2rem;
    margin-bottom: 2rem;
    border: none;
    transition: var(--transition);
}

.test-result .summary-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
}

.test-result .module-progress {
    background: linear-gradient(135deg, #f8f9ff 0%, #f0f2ff 100%);
    border-radius: var(--border-radius);
    padding: 1.25rem;
    border-left: 4px solid var(--primary);
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.08);
}

.test-result .progress {
    background: #e9ecef;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
    height: 10px;
}

.test-result .progress-bar {
    border-radius: 10px;
    transition: width 1.2s cubic-bezier(0.4, 0, 0.2, 1);
    background: linear-gradient(90deg, var(--primary), var(--primary-dark));
}

.test-result .progress-ring {
    position: relative;
    width: 140px;
    height: 140px;
    margin: 0 auto 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.test-result .progress-ring-circle {
    transform: rotate(-90deg);
    transform-origin: 50% 50%;
}

.test-result .progress-ring-bg {
    stroke: #e9ecef;
    fill: transparent;
    stroke-width: 8;
}

.test-result .progress-ring-fill {
    stroke: var(--primary);
    fill: transparent;
    stroke-width: 8;
    stroke-dasharray: 376.99;
    stroke-dashoffset: 376.99;
    transition: stroke-dashoffset 1.5s ease-in-out;
}

.test-result .progress-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    pointer-events: none;
}

.test-result .progress-percent {
    font-size: 1.5rem;
    font-weight: 800;
    line-height: 1;
    color: var(--dark);
}

.test-result .progress-label {
    font-size: 0.8rem;
    color: var(--gray);
    margin-top: 0.25rem;
}


.test-result .stat-card {
    text-align: center;
    padding: 1.5rem 1rem;
    border-radius: var(--border-radius);
    background: white;
    box-shadow: 0 3px 15px rgba(0, 0, 0, 0.05);
    height: 100%;
    transition: var(--transition);
}

.test-result .stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

.test-result .stat-value {
    font-size: 1.8rem;
    font-weight: 800;
    line-height: 1;
    margin-bottom: 0.5rem;
}

.test-result .stat-label {
    color: var(--gray);
    font-size: 0.95rem;
    font-weight: 500;
}

.test-result .unlock-card {
    border-left: 4px solid;
    padding-left: 1.5rem;
}

.test-result .unlock-success {
    border-left-color: var(--success);
    background: linear-gradient(to right, rgba(6, 214, 160, 0.05), white);
}

.test-result .unlock-fail {
    border-left-color: var(--danger);
    background: linear-gradient(to right, rgba(239, 71, 111, 0.05), white);
}

.test-result .question-block {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: 0 3px 15px rgba(0, 0, 0, 0.06);
    padding: 1.5rem;
    margin-bottom: 1.25rem;
    border-left: 4px solid transparent;
    transition: var(--transition);
}

.test-result .question-block:hover {
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

.test-result .question-block.correct {
    border-color: var(--success);
}

.test-result .question-block.incorrect {
    border-color: var(--danger);
}

.test-result .question-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.test-result .question-text {
    font-weight: 600;
    color: var(--dark);
    margin-bottom: 0;
    flex: 1;
    padding-right: 1rem;
}

.test-result .question-badge {
    padding: 0.4rem 0.8rem;
    border-radius: 50px;
    font-weight: 600;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    white-space: nowrap;
}

.test-result .badge-correct {
    background-color: rgba(6, 214, 160, 0.15);
    color: var(--success-dark);
}

.test-result .badge-incorrect {
    background-color: rgba(239, 71, 111, 0.15);
    color: var(--danger-dark);
}


.test-result .answer-section {
    background: var(--light);
    border-radius: 8px;
    padding: 1.25rem;
    margin-top: 1rem;
}

.test-result .answer-label {
    font-weight: 600;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.95rem;
}

.test-result .explanation-section {
    background: rgba(67, 97, 238, 0.05);
    border-radius: 8px;
    padding: 1.25rem;
    margin-top: 1rem;
    border-left: 3px solid var(--primary);
}

.test-result .explanation-title {
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.95rem;
}

.test-result .btn-modern {
    padding: 0.8rem 2rem;
    border-radius: 50px;
    font-weight: 600;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    border: none;
}

.test-result .btn-primary-modern {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 15px rgba(67, 97, 238, 0.3);
}

.test-result .btn-primary-modern:hover {
    background: var(--primary-dark);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(67, 97, 238, 0.4);
}

.test-result .btn-outline-modern {
    background: transparent;
    border: 2px solid var(--primary);
    color: var(--primary);
}

.test-result .btn-outline-modern:hover {
    background: var(--primary);
    color: white;
    transform: translateY(-2px);
}

.test-result .section-title {
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 1.5rem;
    position: relative;
    padding-bottom: 0.75rem;
}

.test-result .section-title::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    width: 50px;
    height: 3px;
    background: var(--primary);
    border-radius: 2px;
}


@media (max-width: 768px) {
    .test-result .result-header {
        padding: 30px 0;
    }

    .test-result .result-header h1 {
        font-size: 1.8rem;
    }

    .test-result .question-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .test-result .question-badge {
        margin-top: 0.5rem;
    }

    .test-result .stat-value {
        font-size: 2rem;
    }

    .test-result .progress-ring {
        width: 120px;
        height: 120px;
    }

    .test-result .progress-percent {
        font-size: 1.7rem;
    }

    .test-result .result-stats {
        gap: 1.5rem;
    }

    .test-result .stat-item {
        padding: 0.6rem 1rem;
    }
}


.points-reward {
    background: linear-gradient(135deg, #fff9e6 0%, #fff3cc 100%);
    border-radius: 15px;
    padding: 2rem;
    border: 2px solid #ffd700;
    box-shadow: 0 6px 20px rgba(255, 215, 0, 0.2);
}

.points-earned {
    animation: pointsPulse 2s ease-in-out;
}

.points-number {
    font-size: 3rem;
    font-weight: 800;
    color: #ff6b00;
    text-shadow: 0 2px 8px rgba(255, 107, 0, 0.4);
    display: block;
    line-height: 1;
}

.points-label {
    font-size: 1.1rem;
    color: #996600;
    font-weight: 600;
    margin-top: 0.5rem;
}

.points-details {
    background: rgba(255, 255, 255, 0.7);
    padding: 0.5rem 1rem;
    border-radius: 10px;
    border: 1px solid rgba(255, 215, 0, 0.3);
}

.attempt-warning {
    background: rgba(255, 193, 7, 0.1);
    padding: 0.5rem 1rem;
    border-radius: 10px;
    border: 1px solid rgba(255, 193, 7, 0.3);
}

@keyframes pointsPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

@media (max-width: 768px) {
    .points-number {
        font-size: 2.5rem;
    }

    .points-reward {
        padding: 1.5rem;
    }
}