* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Dark Theme - JavaScript Colors */
    --primary-color: #f7df1e;
    --secondary-color: #a78bfa;
    --success-color: #22c55e;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --light-bg: #f7fafc;
    --dark-text: #2d3748;
    --border-color: #e2e8f0;
    --bg: #0a0a0f;
    --bg2: #0f0f1a;
    --bg3: #13131f;
    --text: #e2e8f0;
    --text-2: #94a3b8;
    --text-3: #64748b;
    --border: rgba(255,255,255,0.08);
}

:root.light-theme {
    /* Light Theme */
    --primary-color: #f39c12;
    --secondary-color: #8e44ad;
    --success-color: #27ae60;
    --warning-color: #e67e22;
    --danger-color: #e74c3c;
    --light-bg: #ffffff;
    --dark-text: #1a1a1a;
    --border-color: #d5dce0;
    --bg: #ffffff;
    --bg2: #f8fafc;
    --bg3: #f0f4f8;
    --text: #1a1a1a;
    --text-2: #4a5568;
    --text-3: #718096;
    --border: rgba(0,0,0,0.08);
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--bg);
    min-height: 100vh;
    padding: 20px;
    color: var(--text);
    transition: background 0.4s, color 0.4s;
}

body::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: 0;
    background:
        radial-gradient(ellipse 55% 45% at 15% 15%, rgba(247, 223, 30, 0.06) 0%, transparent 70%),
        radial-gradient(ellipse 45% 55% at 85% 85%, rgba(167, 139, 250, 0.06) 0%, transparent 70%);
    pointer-events: none;
    animation: bg-pulse 8s ease-in-out infinite alternate;
}

:root.light-theme body::before {
    background:
        radial-gradient(ellipse 55% 45% at 15% 15%, rgba(243, 156, 18, 0.08) 0%, transparent 70%),
        radial-gradient(ellipse 45% 55% at 85% 85%, rgba(142, 68, 173, 0.08) 0%, transparent 70%);
}

@keyframes bg-pulse {
    from { opacity: 0.8; }
    to { opacity: 1.2; }
}

.container {
    max-width: 900px;
    margin: 0 auto;
    background: var(--bg2);
    border-radius: 15px;
    border: 1px solid var(--border);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    transition: background 0.4s, border-color 0.4s;
    position: relative;
    z-index: 1;
}

/* Header Styles */
.header {
    background: linear-gradient(135deg, rgba(247, 223, 30, 0.08), rgba(167, 139, 250, 0.08));
    color: var(--text);
    padding: 30px;
    border-bottom: 1px solid var(--border);
    position: relative;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
}

.header-content {
    flex: 1;
}

.header h1 {
    font-size: 28px;
    margin-bottom: 15px;
    color: var(--primary-color);
}

.test-info {
    display: flex;
    justify-content: center;
    gap: 30px;
    flex-wrap: wrap;
    font-size: 14px;
}

.mock-theme-toggle {
    background: none;
    border: 1px solid var(--border);
    border-radius: 8px;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--primary-color);
    transition: all 0.3s;
    flex-shrink: 0;
    position: relative;
}

.mock-theme-toggle:hover {
    color: var(--text);
    background: rgba(255, 255, 255, 0.06);
    border-color: var(--primary-color);
    transform: rotate(20deg);
}

.mock-theme-icon-light {
    position: absolute;
    opacity: 0;
    transform: rotate(180deg) scale(0.8);
    transition: all 0.3s;
}

:root.light-theme .mock-theme-icon-dark {
    opacity: 0;
    transform: rotate(180deg) scale(0.8);
}

:root.light-theme .mock-theme-icon-light {
    opacity: 1;
    transform: rotate(0deg) scale(1);
}

.info-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Progress Bar */
.progress-container {
    height: 6px;
    background: var(--border-color);
    position: relative;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--success-color));
    width: 0%;
    transition: width 0.3s ease;
    box-shadow: 0 0 10px rgba(72, 187, 120, 0.5);
}

/* Quiz Container */
.quiz-container {
    padding: 40px;
    background: var(--bg2);
    position: relative;
    z-index: 1;
}

.question-section {
    margin-bottom: 30px;
}

.question-text {
    font-size: 20px;
    color: var(--text);
    margin-bottom: 25px;
    font-weight: 600;
    line-height: 1.6;
}

/* Options Container */
.options-container {
    display: grid;
    gap: 12px;
    margin-bottom: 30px;
}

.option {
    padding: 15px 20px;
    border: 2px solid var(--border);
    border-radius: 8px;
    background: var(--bg3);
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 16px;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 12px;
    position: relative;
    overflow: hidden;
}

.option:hover:not(.disabled) {
    border-color: var(--primary-color);
    background: rgba(247, 223, 30, 0.08);
    box-shadow: 0 4px 12px rgba(247, 223, 30, 0.15);
    transform: translateX(5px);
}

.option input[type="radio"] {
    cursor: pointer;
    width: 20px;
    height: 20px;
}

.option-label {
    flex: 1;
}

.option.correct {
    border-color: var(--success-color);
    background: rgba(34, 197, 94, 0.15);
    animation: correctPulse 0.6s ease;
}

.option.correct::after {
    content: "✓";
    position: absolute;
    right: 20px;
    font-size: 24px;
    color: var(--success-color);
    font-weight: bold;
    animation: checkmark 0.5s ease;
}

.option.incorrect {
    border-color: var(--danger-color);
    background: rgba(239, 68, 68, 0.15);
}

.option.incorrect::after {
    content: "✗";
    position: absolute;
    right: 20px;
    font-size: 24px;
    color: var(--danger-color);
    font-weight: bold;
}

.option.disabled {
    cursor: not-allowed;
    opacity: 0.6;
}

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

@keyframes checkmark {
    0% {
        transform: scale(0) rotate(-45deg);
        opacity: 0;
    }
    50% {
        transform: scale(1.2) rotate(10deg);
    }
    100% {
        transform: scale(1) rotate(0deg);
        opacity: 1;
    }
}

/* Feedback Message */
.feedback-message {
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-weight: 600;
    animation: slideIn 0.4s ease;
    display: flex;
    align-items: center;
    gap: 10px;
}

.feedback-message.correct {
    background: rgba(34, 197, 94, 0.15);
    color: var(--success-color);
    border-left: 4px solid var(--success-color);
}

.feedback-message.incorrect {
    background: rgba(239, 68, 68, 0.15);
    color: var(--danger-color);
    border-left: 4px solid var(--danger-color);
}

.feedback-message.hidden {
    display: none;
}

@keyframes slideIn {
    from {
        transform: translateX(-20px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Button Styles */
.button-container {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 30px;
}

.btn {
    padding: 12px 30px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-primary {
    background: linear-gradient(135deg, rgba(247, 223, 30, 0.2), rgba(167, 139, 250, 0.2));
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
    box-shadow: 0 4px 15px rgba(247, 223, 30, 0.1);
}

.btn-primary:hover {
    transform: translateY(-2px);
    background: linear-gradient(135deg, rgba(247, 223, 30, 0.3), rgba(167, 139, 250, 0.3));
    box-shadow: 0 6px 20px rgba(247, 223, 30, 0.2);
}

.btn-secondary {
    background: var(--bg3);
    color: var(--text);
    border: 2px solid var(--border);
}

.btn-secondary:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background: rgba(247, 223, 30, 0.08);
}

.btn-success {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.2), rgba(34, 197, 94, 0.1));
    color: var(--success-color);
    border: 1px solid var(--success-color);
    box-shadow: 0 4px 15px rgba(34, 197, 94, 0.1);
}

.btn-success:hover {
    transform: translateY(-2px);
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.3), rgba(34, 197, 94, 0.2));
    box-shadow: 0 6px 20px rgba(34, 197, 94, 0.2);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.hidden {
    display: none !important;
}

/* Modal Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.3s ease;
}

.modal.hidden {
    display: none !important;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.modal-content {
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: 15px;
    padding: 40px;
    max-width: 600px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.4s ease;
}

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

.modal-content h2 {
    font-size: 28px;
    margin-bottom: 30px;
    color: var(--primary-color);
    text-align: center;
}

.result-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: var(--bg3);
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    border: 1px solid var(--border);
}

.stat-card h3 {
    font-size: 14px;
    color: var(--text-3);
    text-transform: uppercase;
    margin-bottom: 10px;
    letter-spacing: 1px;
}

.score-value,
.percentage-value,
.performance-value {
    font-size: 32px;
    font-weight: bold;
    color: var(--primary-color);
}

.result-message {
    background: linear-gradient(135deg, rgba(247, 223, 30, 0.08), rgba(167, 139, 250, 0.08));
    border: 1px solid var(--border);
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 30px;
    text-align: center;
    font-size: 16px;
    line-height: 1.6;
    color: var(--text);
}

/* Review Modal */
.review-content {
    max-width: 800px;
}

.review-container {
    max-height: 500px;
    overflow-y: auto;
    margin-bottom: 30px;
}

.review-item {
    background: var(--bg3);
    padding: 20px;
    margin-bottom: 15px;
    border-radius: 10px;
    border-left: 4px solid var(--border);
}

.review-item.correct {
    border-left-color: var(--success-color);
    background: rgba(34, 197, 94, 0.1);
}

.review-item.incorrect {
    border-left-color: var(--danger-color);
    background: rgba(239, 68, 68, 0.1);
}

.review-question {
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--text);
}

.review-answer {
    font-size: 14px;
    margin-bottom: 5px;
    padding: 8px;
    border-radius: 5px;
    background: var(--bg2);
    color: var(--text-2);
}

.review-answer.your-answer {
    background: var(--bg2);
    color: var(--text);
}

.review-answer.correct-answer {
    background: rgba(34, 197, 94, 0.15);
    color: var(--success-color);
}

.close-btn {
    position: absolute;
    top: 15px;
    right: 20px;
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: #999;
    transition: color 0.2s;
}

.close-btn:hover {
    color: var(--dark-text);
}

/* Celebration Animation */
.celebration {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 2000;
}

.celebration.hidden {
    display: none !important;
}

.confetti {
    position: absolute;
    width: 10px;
    height: 10px;
    background: var(--primary-color);
    animation: confettiFall 3s ease-out forwards;
}

.confetti:nth-child(1) {
    left: 20%;
    background: var(--primary-color);
    animation-delay: 0s;
}

.confetti:nth-child(2) {
    left: 40%;
    background: var(--success-color);
    animation-delay: 0.1s;
}

.confetti:nth-child(3) {
    left: 60%;
    background: var(--secondary-color);
    animation-delay: 0.2s;
}

.confetti:nth-child(4) {
    left: 80%;
    background: var(--warning-color);
    animation-delay: 0.3s;
}

.confetti:nth-child(5) {
    left: 50%;
    background: #9f7aea;
    animation-delay: 0.4s;
}

@keyframes confettiFall {
    to {
        transform: translateY(100vh) rotate(360deg);
        opacity: 0;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .header h1 {
        font-size: 22px;
    }

    .test-info {
        gap: 15px;
        font-size: 12px;
    }

    .quiz-container {
        padding: 20px;
    }

    .question-text {
        font-size: 18px;
        margin-bottom: 20px;
    }

    .button-container {
        gap: 10px;
    }

    .btn {
        padding: 10px 20px;
        font-size: 14px;
    }

    .modal-content {
        padding: 30px 20px;
    }

    .result-stats {
        gap: 15px;
    }

    .stat-card {
        padding: 15px;
    }

    .score-value,
    .percentage-value,
    .performance-value {
        font-size: 24px;
    }
}

@media (max-width: 480px) {
    .header {
        padding: 20px;
        flex-direction: column;
        align-items: center;
    }

    .header-content {
        width: 100%;
        text-align: center;
    }

    .header h1 {
        font-size: 18px;
    }

    .test-info {
        flex-direction: column;
        gap: 10px;
    }

    .mock-theme-toggle {
        width: 40px;
        height: 40px;
        align-self: center;
    }

    .quiz-container {
        padding: 15px;
    }

    .question-text {
        font-size: 16px;
    }

    .option {
        padding: 12px 15px;
        font-size: 14px;
    }

    .button-container {
        flex-direction: column;
    }

    .btn {
        width: 100%;
    }

    .modal-content {
        padding: 20px;
        border-radius: 10px;
    }

    .modal-content h2 {
        font-size: 20px;
    }

    .result-stats {
        grid-template-columns: 1fr;
    }
}
