/* quiz-styles.css - High-Performance & Responsive Fluid Typography Version */
:root {
    --quiz-sky-50: #f0f9ff;
    --quiz-sky-100: #e0f2fe;
    --quiz-sky-500: #3b82f6;
    --quiz-sky-600: #2563eb;
    --quiz-sky-800: #1e3a8a;
}

*, *::before, *::after {
    box-sizing: border-box;
}

.quiz-app body {
    font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: var(--quiz-sky-800);
    background: #ffffff;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.quiz-app .light-glow-card:hover {
    box-shadow: 0 0 15px rgba(56, 189, 248, 0.35);
}

.quiz-app .light-glow-option:hover {
    box-shadow: 0 0 8px rgba(56, 189, 248, 0.25);
    transform: translateY(-1px);
}

.quiz-app .correct-answer {
    background-color: var(--quiz-sky-50) !important;
    border-color: var(--quiz-sky-500) !important;
    color: var(--quiz-sky-800) !important;
    animation: quiz-flashSkyBlue 0.4s ease-in-out;
}

.quiz-app .wrong-answer {
    background-color: #fee2e2 !important;
    border-color: #ef4444 !important;
    color: var(--quiz-sky-800) !important;
    animation: quiz-flashRed 0.4s ease-in-out;
}

@keyframes quiz-flashSkyBlue {
    0% { box-shadow: 0 0 0px var(--quiz-sky-500); }
    50% { box-shadow: 0 0 12px var(--quiz-sky-500); }
    100% { box-shadow: 0 0 0px var(--quiz-sky-500); }
}

@keyframes quiz-flashRed {
    0% { box-shadow: 0 0 0px #ef4444; }
    50% { box-shadow: 0 0 12px #ef4444; }
    100% { box-shadow: 0 0 0px #ef4444; }
}

.quiz-app #progressBar {
    transition: width 0.35s ease-out;
    will-change: width;
}

.quiz-app .modal-overlay {
    background-color: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    transition: opacity 0.25s ease-out;
}

.quiz-app .modal-enter {
    animation: quiz-fadeInScale 0.3s ease-out forwards;
}

@keyframes quiz-fadeInScale {
    from { opacity: 0; transform: scale(0.96); }
    to { opacity: 1; transform: scale(1); }
}

.mobile-nav-closed { display: none; }
.mobile-nav-open { display: block; }

.quiz-app .progress-circle {
    transform: rotate(-90deg);
}

.quiz-app .progress-bar-container {
    height: 12px;
    border-radius: 9999px;
    overflow: hidden;
    background-color: var(--quiz-sky-50);
}

.quiz-app .progress-bar-fill {
    height: 100%;
    transition: width 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.quiz-app #confetti-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 100;
}

/* Quiz container styling - Responsive fluid container */
.quiz-app #quiz-container {
    width: 100%;
    max-width: 820px;
    margin: clamp(0.5rem, 2vw, 1.5rem) auto;
    padding: clamp(0.625rem, 2.5vw, 1.5rem);
    background: white;
    border-radius: clamp(0.875rem, 2vw, 1.5rem);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
    box-sizing: border-box;
}

/* Quiz main title */
.quiz-app #quiz-container h1 {
    font-size: clamp(1.25rem, 3.5vw, 1.875rem);
    line-height: 1.3;
}

/* Quiz card styling */
.quiz-app .quiz-card {
    background: white;
    border-radius: clamp(0.75rem, 1.5vw, 1rem);
    padding: clamp(0.75rem, 2vw, 1.25rem);
    margin-bottom: clamp(0.75rem, 2vw, 1.25rem);
    border-top: 4px solid var(--quiz-sky-500);
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.06);
    transition: box-shadow 0.2s ease, transform 0.2s ease;
    overflow-wrap: break-word;
    word-break: break-word;
    max-width: 100%;
    box-sizing: border-box;
}

/* Question text - Fluid Responsive Typography */
.quiz-app .question {
    font-size: clamp(1rem, 2.2vw, 1.35rem);
    font-weight: 600;
    line-height: 1.48;
    color: var(--quiz-sky-800);
    margin-bottom: clamp(0.75rem, 1.8vw, 1rem);
    overflow-wrap: break-word;
    word-break: break-word;
    hyphens: auto;
}

/* Option styling - Fluid Responsive Typography & Padding */
.quiz-app .option {
    font-size: clamp(0.875rem, 1.6vw, 1.0625rem);
    line-height: 1.42;
    padding: clamp(0.5rem, 1.2vw, 0.875rem) clamp(0.625rem, 1.5vw, 1rem);
    margin: 0.4rem 0;
    border-radius: 0.75rem;
    border: 2px solid transparent;
    background: white;
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
    overflow-wrap: break-word;
    word-break: break-word;
    max-width: 100%;
    box-sizing: border-box;
}

/* Code block wrapping inside questions */
.quiz-app pre, .quiz-app code {
    white-space: pre-wrap !important;
    word-break: break-all !important;
    overflow-x: auto;
    max-width: 100%;
    font-size: clamp(0.8rem, 1.4vw, 0.95rem);
}

/* Scoreboard styling - Compact 5-column grid on ALL screens */
.quiz-app #scoreboard-stats {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: clamp(0.1rem, 0.8vw, 0.5rem);
    margin-bottom: 0.5rem;
}

.quiz-app #scoreboard-stats > div {
    padding: clamp(0.2rem, 0.8vw, 0.5rem);
}

.quiz-app #scoreboard-stats span.text-2xl {
    font-size: clamp(1rem, 2.5vw, 1.5rem) !important;
    line-height: 1.2;
}

.quiz-app #scoreboard-stats span {
    font-size: clamp(0.6rem, 1.2vw, 0.85rem);
}

/* Active filter styling */
.quiz-app .active-filter {
    background: var(--quiz-sky-50);
    border-radius: 0.625rem;
}

/* Explanation box styling */
.quiz-app .explanation {
    margin-top: 0.875rem;
    padding: clamp(0.625rem, 1.5vw, 1rem);
    background: var(--quiz-sky-50);
    border-left: 4px solid var(--quiz-sky-500);
    border-radius: 0.75rem;
    font-size: clamp(0.85rem, 1.5vw, 0.975rem);
    line-height: 1.45;
    overflow-wrap: break-word;
    word-break: break-word;
}

/* Hide floating student name badge to prevent collision with header */
.quiz-app #student-name {
    display: none !important;
}

/* Results modal responsive optimization */
.quiz-app #results-modal .modal-card {
    max-height: 90vh;
    overflow-y: auto;
    margin: auto;
    padding: clamp(1rem, 3vw, 2rem);
}
