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

:root {
    --primary: #667eea;
    --secondary: #764ba2;
    --accent: #f093fb;
    --bg-light: rgba(255, 255, 255, 0.95);
    --text-dark: #333;
    --text-light: #666;
    --success: #4caf50;
    --error: #f44336;
    --warning: #ff9800;
}

body.dark-theme {
    --bg-light: rgba(30, 30, 40, 0.95);
    --text-dark: #e0e0e0;
    --text-light: #b0b0b0;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
    min-height: 100vh;
    padding: 80px 20px 20px;
    position: relative;
    overflow-x: hidden;
    transition: background 0.3s;
}

body.dark-theme {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
}

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

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 20% 50%, rgba(255, 255, 255, 0.1) 0%, transparent 50%),
                radial-gradient(circle at 80% 80%, rgba(255, 255, 255, 0.1) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
    animation: floatBackground 20s ease-in-out infinite;
}

body.dark-theme::before {
    background: radial-gradient(circle at 20% 50%, rgba(102, 126, 234, 0.1) 0%, transparent 50%),
                radial-gradient(circle at 80% 80%, rgba(118, 75, 162, 0.1) 0%, transparent 50%);
}

@keyframes floatBackground {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(-30px, -30px) scale(1.1); }
}

/* Navigation */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: var(--bg-light);
    backdrop-filter: blur(20px);
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    padding: 15px 20px;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.5em;
    font-weight: 700;
    color: var(--primary);
}

.logo-icon { font-size: 1.3em; }

.nav-menu {
    display: flex;
    list-style: none;
    gap: 25px;
    align-items: center;
}

.nav-link {
    text-decoration: none;
    color: var(--text-dark);
    font-weight: 500;
    transition: color 0.3s;
    padding: 8px 15px;
    border-radius: 8px;
}

.nav-link:hover, .nav-link.active {
    color: var(--primary);
    background: rgba(102, 126, 234, 0.1);
}

.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
}

.nav-toggle span {
    width: 25px;
    height: 3px;
    background: var(--primary);
    border-radius: 3px;
    transition: all 0.3s;
}

.theme-toggle {
    background: var(--primary);
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2em;
    transition: transform 0.3s;
}

.theme-toggle:hover {
    transform: scale(1.1);
}

.container {
    background: var(--bg-light);
    backdrop-filter: blur(20px);
    border-radius: 30px;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.2);
    max-width: 1000px;
    width: 100%;
    padding: 50px;
    position: relative;
    overflow: hidden;
    z-index: 1;
    margin: 0 auto;
    transition: background 0.3s;
}

.container::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(102, 126, 234, 0.1) 0%, transparent 70%);
    pointer-events: none;
    animation: rotate 20s linear infinite;
}

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

header {
    text-align: center;
    margin-bottom: 40px;
    position: relative;
    z-index: 2;
}

header h1 {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-size: 3em;
    margin-bottom: 15px;
    font-weight: 800;
    letter-spacing: -1px;
    animation: titleGlow 3s ease-in-out infinite;
}

@keyframes titleGlow {
    0%, 100% { filter: drop-shadow(0 0 10px rgba(102, 126, 234, 0.3)); }
    50% { filter: drop-shadow(0 0 20px rgba(118, 75, 162, 0.5)); }
}

.subtitle {
    color: var(--text-light);
    font-size: 1.2em;
    font-weight: 500;
    letter-spacing: 0.5px;
}

.screen {
    display: none;
}

.screen.active {
    display: block;
    animation: fadeInScale 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

.home-content {
    padding: 20px 0;
    position: relative;
    z-index: 2;
}

.intro-section {
    text-align: center;
    margin-bottom: 50px;
}

.intro-section h2 {
    background: linear-gradient(135deg, var(--text-dark) 0%, var(--primary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-size: 2.5em;
    margin-bottom: 20px;
    font-weight: 700;
}

.intro-text {
    color: var(--text-light);
    font-size: 1.3em;
    line-height: 1.8;
    font-weight: 400;
}

.info-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
    margin-bottom: 50px;
}

.info-card {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.9) 0%, rgba(255, 255, 255, 0.7) 100%);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    border-left: 5px solid;
    border-image: linear-gradient(135deg, #667eea 0%, #764ba2 100%) 1;
    position: relative;
    overflow: hidden;
}

body.dark-theme .info-card {
    background: linear-gradient(135deg, rgba(40, 40, 50, 0.9) 0%, rgba(30, 30, 40, 0.7) 100%);
}

.info-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(102, 126, 234, 0.1), transparent);
    transition: left 0.5s;
}

.info-card:hover::before {
    left: 100%;
}

.info-card:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 20px 40px rgba(102, 126, 234, 0.3);
}

.card-icon {
    font-size: 3em;
    text-align: center;
    margin-bottom: 20px;
    filter: drop-shadow(0 5px 10px rgba(102, 126, 234, 0.3));
    animation: iconFloat 3s ease-in-out infinite;
}

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

.info-card h3 {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-size: 1.4em;
    margin-bottom: 18px;
    text-align: center;
    font-weight: 700;
}

.info-card p {
    color: var(--text-light);
    line-height: 1.8;
    font-size: 1.05em;
}

.info-card ul {
    list-style: none;
    padding: 0;
    color: var(--text-light);
}

.info-card ul li {
    padding: 10px 0;
    padding-left: 30px;
    position: relative;
    line-height: 1.6;
    transition: transform 0.3s;
}

.info-card ul li:hover {
    transform: translateX(5px);
}

.info-card ul li::before {
    content: "✓";
    position: absolute;
    left: 0;
    color: #4caf50;
    font-weight: bold;
    font-size: 1.3em;
    filter: drop-shadow(0 2px 4px rgba(76, 175, 80, 0.3));
}

/* Mode cards */
.quiz-modes {
    margin-bottom: 40px;
}

.quiz-modes h3 {
    text-align: center;
    color: var(--text-dark);
    font-size: 1.8em;
    margin-bottom: 25px;
}

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

.mode-card {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.9) 0%, rgba(255, 255, 255, 0.7) 100%);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 25px;
    text-align: center;
    cursor: pointer;
    transition: all 0.4s;
    border: 3px solid transparent;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

body.dark-theme .mode-card {
    background: linear-gradient(135deg, rgba(40, 40, 50, 0.9) 0%, rgba(30, 30, 40, 0.7) 100%);
}

.mode-card:hover, .mode-card.active {
    transform: translateY(-5px);
    border-color: var(--primary);
    box-shadow: 0 15px 35px rgba(102, 126, 234, 0.4);
}

.mode-icon {
    font-size: 3em;
    margin-bottom: 15px;
}

.mode-card h4 {
    color: var(--text-dark);
    margin-bottom: 10px;
    font-size: 1.3em;
}

.mode-card p {
    color: var(--text-light);
    font-size: 0.95em;
}

.quiz-cta {
    text-align: center;
    padding: 50px 30px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    background-size: 200% 200%;
    animation: gradientShift 8s ease infinite;
    border-radius: 25px;
    color: white;
    margin-top: 40px;
    box-shadow: 0 20px 60px rgba(102, 126, 234, 0.4);
    position: relative;
    overflow: hidden;
}

.quiz-cta::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    animation: rotate 15s linear infinite;
}

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

.quiz-cta p {
    font-size: 1.2em;
    margin-bottom: 30px;
    opacity: 0.95;
    position: relative;
    z-index: 1;
}

.btn-large {
    padding: 20px 60px;
    font-size: 1.3em;
    position: relative;
    z-index: 1;
}

.btn-secondary {
    background: linear-gradient(135deg, #6c757d 0%, #5a6268 100%);
    color: white;
}

.btn-secondary:hover {
    background: linear-gradient(135deg, #5a6268 0%, #495057 100%);
    transform: translateY(-3px);
    box-shadow: 0 15px 30px rgba(108, 117, 125, 0.4);
}

.results-actions {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
}

.welcome-content {
    text-align: center;
    padding: 40px 20px;
}

.welcome-content h2 {
    background: linear-gradient(135deg, var(--text-dark) 0%, var(--primary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 20px;
    font-size: 2.2em;
    font-weight: 700;
}

.welcome-content p {
    color: var(--text-light);
    margin-bottom: 35px;
    font-size: 1.2em;
    line-height: 1.6;
}

.duration-selector, .category-selector {
    margin-top: 40px;
}

.duration-selector h3, .category-selector h3 {
    color: var(--text-dark);
    margin-bottom: 25px;
    font-size: 1.5em;
    font-weight: 600;
}

.category-selector .btn {
    margin: 30px auto 0;
    display: flex;
    justify-content: center;
}

.duration-buttons {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    max-width: 600px;
    margin: 0 auto;
}

.category-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    justify-content: center;
    max-width: 600px;
    margin: 0 auto;
}

.category-btn {
    padding: 12px 25px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.9) 0%, rgba(255, 255, 255, 0.7) 100%);
    border: 2px solid rgba(102, 126, 234, 0.3);
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 600;
    color: var(--text-dark);
}

body.dark-theme .category-btn {
    background: linear-gradient(135deg, rgba(40, 40, 50, 0.9) 0%, rgba(30, 30, 40, 0.7) 100%);
}

.category-btn:hover, .category-btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: transparent;
    transform: translateY(-2px);
}

.duration-btn {
    padding: 25px 35px;
    font-size: 1.3em;
    border: 3px solid transparent;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    font-weight: 600;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.9) 0%, rgba(255, 255, 255, 0.7) 100%);
    backdrop-filter: blur(10px);
    color: #667eea;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

body.dark-theme .duration-btn {
    background: linear-gradient(135deg, rgba(40, 40, 50, 0.9) 0%, rgba(30, 30, 40, 0.7) 100%);
}

.duration-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(102, 126, 234, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.duration-btn:hover::before {
    width: 400px;
    height: 400px;
}

.duration-btn:hover {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 15px 35px rgba(102, 126, 234, 0.4);
    border-color: transparent;
}

.btn-icon {
    font-size: 1.5em;
    z-index: 1;
    position: relative;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

.duration-btn span:not(.btn-icon) {
    z-index: 1;
    position: relative;
}

.btn {
    padding: 16px 45px;
    font-size: 1.1em;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 15px 35px rgba(102, 126, 234, 0.5);
}

.btn-stop {
    background: linear-gradient(135deg, #f44336 0%, #d32f2f 100%);
    color: white;
    padding: 12px 30px;
    font-size: 0.95em;
}

.btn-stop:hover {
    background: linear-gradient(135deg, #d32f2f 0%, #c62828 100%);
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 15px 35px rgba(244, 67, 54, 0.5);
}

.quiz-header {
    margin-bottom: 35px;
}

.timer-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 20px;
    color: white;
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.4);
    position: relative;
    overflow: hidden;
    flex-wrap: wrap;
    gap: 15px;
}

.timer-container::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    animation: rotate 10s linear infinite;
}

.timer-display {
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: 1.6em;
    font-weight: bold;
    position: relative;
    z-index: 1;
}

.timer-svg {
    width: 28px;
    height: 28px;
    animation: rotate 2s linear infinite;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

#timer {
    font-family: 'Courier New', monospace;
    font-size: 1.4em;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.progress-bar-container {
    flex: 1;
    min-width: 200px;
    position: relative;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    height: 30px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: white;
    border-radius: 10px;
    transition: width 0.3s;
    width: 0%;
}

.progress-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 0.9em;
    font-weight: bold;
    color: var(--primary);
    z-index: 1;
}

.timer-container.warning {
    background: linear-gradient(135deg, #ff9800 0%, #f57c00 100%);
    animation: pulse 1s infinite;
}

.timer-container.danger {
    background: linear-gradient(135deg, #f44336 0%, #d32f2f 100%);
    animation: pulse 0.5s infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 10px 30px rgba(102, 126, 234, 0.4);
    }
    50% {
        transform: scale(1.02);
        box-shadow: 0 15px 40px rgba(244, 67, 54, 0.6);
    }
}

.score-info {
    display: flex;
    justify-content: space-between;
    color: var(--text-light);
    font-size: 1.05em;
    margin-top: 20px;
    gap: 20px;
    flex-wrap: wrap;
}

.score-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 15px 20px;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    border-radius: 15px;
    flex: 1;
    justify-content: center;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s;
    min-width: 150px;
}

body.dark-theme .score-item {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.2) 0%, rgba(118, 75, 162, 0.2) 100%);
}

.score-item:hover {
    transform: translateY(-3px);
}

.score-item svg {
    color: #667eea;
    filter: drop-shadow(0 2px 4px rgba(102, 126, 234, 0.3));
}

.score-info strong {
    color: #667eea;
    font-size: 1.3em;
    font-weight: 700;
}

.question-container {
    margin-bottom: 35px;
    position: relative;
}

.question-icon {
    font-size: 3.5em;
    text-align: center;
    margin-bottom: 20px;
    animation: bounce 2s ease-in-out infinite;
    filter: drop-shadow(0 5px 15px rgba(102, 126, 234, 0.3));
}

@keyframes bounce {
    0%, 100% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-15px) scale(1.1); }
}

#question-text {
    color: var(--text-dark);
    font-size: 1.6em;
    margin-bottom: 30px;
    line-height: 1.5;
    padding: 25px;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.05) 0%, rgba(118, 75, 162, 0.05) 100%);
    border-radius: 20px;
    border-left: 6px solid;
    border-image: linear-gradient(135deg, #667eea 0%, #764ba2 100%) 1;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
    font-weight: 600;
}

body.dark-theme #question-text {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.15) 0%, rgba(118, 75, 162, 0.15) 100%);
}

.answers {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.answer-btn {
    padding: 22px 30px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.9) 0%, rgba(245, 245, 245, 0.9) 100%);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(102, 126, 234, 0.2);
    border-radius: 15px;
    cursor: pointer;
    text-align: left;
    font-size: 1.15em;
    color: var(--text-dark);
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    overflow: hidden;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.05);
}

body.dark-theme .answer-btn {
    background: linear-gradient(135deg, rgba(40, 40, 50, 0.9) 0%, rgba(30, 30, 40, 0.9) 100%);
}

.answer-btn::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, rgba(102, 126, 234, 0.1) 0%, transparent 100%);
    transition: width 0.4s;
}

.answer-btn:hover::before {
    width: 100%;
}

.answer-btn:hover {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    border-color: #667eea;
    transform: translateX(8px) scale(1.02);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
}

.answer-btn.selected {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: #667eea;
    transform: translateX(12px) scale(1.03);
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.4);
}

.answer-btn.correct {
    background: linear-gradient(135deg, #4caf50 0%, #45a049 100%);
    color: white;
    border-color: #4caf50;
    animation: correctPulse 0.6s;
    box-shadow: 0 10px 30px rgba(76, 175, 80, 0.4);
}

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

.answer-btn.incorrect {
    background: linear-gradient(135deg, #f44336 0%, #d32f2f 100%);
    color: white;
    border-color: #f44336;
    animation: shake 0.6s;
    box-shadow: 0 10px 30px rgba(244, 67, 54, 0.4);
}

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

.answer-btn:disabled {
    cursor: not-allowed;
    opacity: 0.8;
}

.feedback {
    padding: 25px;
    border-radius: 15px;
    margin-top: 25px;
    display: none;
    animation: slideDown 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    font-size: 1.15em;
    line-height: 1.7;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

.feedback.show {
    display: block;
}

.feedback.correct {
    background: linear-gradient(135deg, rgba(232, 245, 233, 0.95) 0%, rgba(200, 230, 201, 0.95) 100%);
    backdrop-filter: blur(10px);
    color: #2e7d32;
    border: 2px solid #4caf50;
    box-shadow: 0 8px 25px rgba(76, 175, 80, 0.3);
}

.feedback.incorrect {
    background: linear-gradient(135deg, rgba(255, 235, 238, 0.95) 0%, rgba(255, 205, 210, 0.95) 100%);
    backdrop-filter: blur(10px);
    color: #c62828;
    border: 2px solid #f44336;
    box-shadow: 0 8px 25px rgba(244, 67, 54, 0.3);
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-15px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.results-content {
    text-align: center;
    padding: 30px;
}

.results-content h2 {
    background: linear-gradient(135deg, var(--text-dark) 0%, var(--primary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 40px;
    font-size: 2.5em;
    font-weight: 700;
}

.final-score {
    margin-bottom: 40px;
}

.score-circle {
    width: 180px;
    height: 180px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    background-size: 200% 200%;
    animation: gradientShift 5s ease infinite;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    margin: 0 auto 25px;
    color: white;
    box-shadow: 0 20px 60px rgba(102, 126, 234, 0.5);
    animation: scaleIn 0.6s cubic-bezier(0.34, 1.56, 0.64, 1), gradientShift 5s ease infinite;
    position: relative;
}

.score-circle::before {
    content: '';
    position: absolute;
    inset: -10px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    opacity: 0.3;
    z-index: -1;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes scaleIn {
    from { transform: scale(0); }
    to { transform: scale(1); }
}

#final-score-value {
    font-size: 3.5em;
    font-weight: 900;
    line-height: 1;
    text-shadow: 0 3px 10px rgba(0, 0, 0, 0.3);
}

.score-label {
    font-size: 1.4em;
    opacity: 0.95;
    font-weight: 600;
}

#score-message {
    font-size: 1.4em;
    color: var(--text-light);
    margin-bottom: 25px;
    font-weight: 500;
}

.results-details {
    background: linear-gradient(135deg, rgba(245, 245, 245, 0.9) 0%, rgba(255, 255, 255, 0.9) 100%);
    backdrop-filter: blur(10px);
    padding: 30px;
    border-radius: 20px;
    margin-bottom: 40px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

body.dark-theme .results-details {
    background: linear-gradient(135deg, rgba(40, 40, 50, 0.9) 0%, rgba(30, 30, 40, 0.9) 100%);
}

.detail-item {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin: 18px 0;
    padding: 15px;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 12px;
    transition: all 0.3s;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.05);
}

body.dark-theme .detail-item {
    background: rgba(50, 50, 60, 0.8);
}

.detail-item:hover {
    transform: translateX(8px) scale(1.02);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.2);
}

.detail-icon {
    font-size: 1.8em;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

.results-details p {
    margin: 0;
    font-size: 1.15em;
    color: var(--text-dark);
    font-weight: 500;
}

/* Ressources */
.resources-content h2 {
    background: linear-gradient(135deg, var(--text-dark) 0%, var(--primary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 40px;
    font-size: 2.5em;
    font-weight: 700;
    text-align: center;
}

.resources-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
}

.resource-card {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.9) 0%, rgba(255, 255, 255, 0.7) 100%);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    transition: all 0.4s;
    border-left: 5px solid;
    border-image: linear-gradient(135deg, #667eea 0%, #764ba2 100%) 1;
}

body.dark-theme .resource-card {
    background: linear-gradient(135deg, rgba(40, 40, 50, 0.9) 0%, rgba(30, 30, 40, 0.7) 100%);
}

.resource-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(102, 126, 234, 0.3);
}

.resource-icon {
    font-size: 3em;
    text-align: center;
    margin-bottom: 20px;
}

.resource-card h3 {
    color: var(--text-dark);
    margin-bottom: 20px;
    font-size: 1.4em;
    text-align: center;
}

.resource-card ul {
    list-style: none;
    padding: 0;
}

.resource-card ul li {
    padding: 10px 0;
    padding-left: 25px;
    position: relative;
    color: var(--text-light);
    line-height: 1.6;
}

.resource-card ul li::before {
    content: "•";
    position: absolute;
    left: 0;
    color: var(--primary);
    font-size: 1.5em;
    font-weight: bold;
}

/* Statistiques */
.statistics-content h2 {
    background: linear-gradient(135deg, var(--text-dark) 0%, var(--primary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 40px;
    font-size: 2.5em;
    font-weight: 700;
    text-align: center;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 25px;
    margin-bottom: 40px;
}

.stat-card {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.9) 0%, rgba(255, 255, 255, 0.7) 100%);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 30px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    transition: all 0.4s;
}

body.dark-theme .stat-card {
    background: linear-gradient(135deg, rgba(40, 40, 50, 0.9) 0%, rgba(30, 30, 40, 0.7) 100%);
}

.stat-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(102, 126, 234, 0.3);
}

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

.stat-value {
    font-size: 2.5em;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 10px;
}

.stat-label {
    color: var(--text-light);
    font-size: 1.1em;
}

.stats-chart {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.9) 0%, rgba(255, 255, 255, 0.7) 100%);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

body.dark-theme .stats-chart {
    background: linear-gradient(135deg, rgba(40, 40, 50, 0.9) 0%, rgba(30, 30, 40, 0.7) 100%);
}

.stats-chart h3 {
    color: var(--text-dark);
    margin-bottom: 20px;
    text-align: center;
}

.stats-chart canvas {
    width: 100%;
    height: 200px;
}

/* Glossaire */
.glossary-content h2 {
    background: linear-gradient(135deg, var(--text-dark) 0%, var(--primary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 40px;
    font-size: 2.5em;
    font-weight: 700;
    text-align: center;
}

.glossary-search {
    margin-bottom: 30px;
}

.glossary-search input {
    width: 100%;
    padding: 15px 20px;
    font-size: 1.1em;
    border: 2px solid rgba(102, 126, 234, 0.3);
    border-radius: 15px;
    background: var(--bg-light);
    color: var(--text-dark);
    transition: all 0.3s;
}

.glossary-search input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.glossary-list {
    display: grid;
    gap: 20px;
}

.glossary-item {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.9) 0%, rgba(255, 255, 255, 0.7) 100%);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s;
    border-left: 4px solid var(--primary);
}

body.dark-theme .glossary-item {
    background: linear-gradient(135deg, rgba(40, 40, 50, 0.9) 0%, rgba(30, 30, 40, 0.7) 100%);
}

.glossary-item:hover {
    transform: translateX(5px);
    box-shadow: 0 10px 25px rgba(102, 126, 234, 0.2);
}

.glossary-item h3 {
    color: var(--primary);
    margin-bottom: 10px;
    font-size: 1.3em;
}

.glossary-item p {
    color: var(--text-light);
    line-height: 1.6;
}

/* À propos */
.about-content h2 {
    background: linear-gradient(135deg, var(--text-dark) 0%, var(--primary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 40px;
    font-size: 2.5em;
    font-weight: 700;
    text-align: center;
}

.about-section {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.9) 0%, rgba(255, 255, 255, 0.7) 100%);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

body.dark-theme .about-section {
    background: linear-gradient(135deg, rgba(40, 40, 50, 0.9) 0%, rgba(30, 30, 40, 0.7) 100%);
}

.about-section h3 {
    color: var(--primary);
    margin-bottom: 20px;
    font-size: 1.5em;
}

.about-section p {
    color: var(--text-light);
    line-height: 1.8;
    margin-bottom: 15px;
}

.about-section ul {
    list-style: none;
    padding: 0;
}

.about-section ul li {
    padding: 10px 0;
    padding-left: 30px;
    position: relative;
    color: var(--text-light);
    line-height: 1.6;
}

.about-section ul li::before {
    content: "✓";
    position: absolute;
    left: 0;
    color: var(--primary);
    font-weight: bold;
    font-size: 1.3em;
}

/* Responsive */
@media (max-width: 768px) {
    .nav-menu {
        position: fixed;
        left: -100%;
        top: 70px;
        flex-direction: column;
        background: var(--bg-light);
        width: 100%;
        text-align: center;
        transition: 0.3s;
        box-shadow: 0 10px 27px rgba(0, 0, 0, 0.05);
        padding: 20px 0;
    }

    .nav-menu.active {
        left: 0;
    }

    .nav-toggle {
        display: flex;
    }

    body {
        padding: 70px 10px 10px;
    }

    .container {
        padding: 30px 20px;
        border-radius: 20px;
    }

    header h1 {
        font-size: 2.2em;
    }

    #question-text {
        font-size: 1.3em;
        padding: 20px;
    }

    .answer-btn {
        padding: 18px 25px;
        font-size: 1.05em;
    }

    .duration-buttons {
        grid-template-columns: 1fr;
    }

    .category-buttons {
        flex-direction: column;
    }

    .timer-container {
        flex-direction: column;
        gap: 20px;
    }

    .timer-display {
        font-size: 1.3em;
    }

    .score-info {
        flex-direction: column;
    }

    .intro-section h2 {
        font-size: 1.8em;
    }

    .intro-text {
        font-size: 1.1em;
    }

    .info-cards {
        grid-template-columns: 1fr;
    }

    .info-card {
        padding: 25px;
    }

    .quiz-cta {
        padding: 35px 20px;
    }

    .quiz-cta h3 {
        font-size: 1.6em;
    }

    .btn-large {
        padding: 18px 40px;
        font-size: 1.1em;
    }

    .results-actions {
        flex-direction: column;
    }

    .results-actions .btn {
        width: 100%;
    }

    .score-circle {
        width: 150px;
        height: 150px;
    }

    #final-score-value {
        font-size: 2.8em;
    }

    .mode-cards {
        grid-template-columns: 1fr;
    }

    .resources-grid {
        grid-template-columns: 1fr;
    }

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

/* Badges */
.badges-container {
    margin-top: 30px;
    padding: 20px;
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.1) 0%, rgba(255, 193, 7, 0.1) 100%);
    border-radius: 15px;
    border: 2px solid rgba(255, 215, 0, 0.3);
}

.badges-container h3 {
    color: var(--text-dark);
    margin-bottom: 20px;
    font-size: 1.5em;
    text-align: center;
}

.badge-earned {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    margin-bottom: 15px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.9) 0%, rgba(255, 255, 255, 0.7) 100%);
    border-radius: 12px;
    box-shadow: 0 5px 15px rgba(255, 215, 0, 0.2);
    animation: badgeAppear 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    border-left: 4px solid #ffd700;
}

body.dark-theme .badge-earned {
    background: linear-gradient(135deg, rgba(40, 40, 50, 0.9) 0%, rgba(30, 30, 40, 0.7) 100%);
}

.badge-icon {
    font-size: 2.5em;
    filter: drop-shadow(0 3px 6px rgba(255, 215, 0, 0.4));
    animation: badgeBounce 2s ease-in-out infinite;
}

@keyframes badgeAppear {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.8);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes badgeBounce {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    25% { transform: translateY(-5px) rotate(-5deg); }
    75% { transform: translateY(-5px) rotate(5deg); }
}

.badge-earned strong {
    display: block;
    color: var(--text-dark);
    font-size: 1.2em;
    margin-bottom: 5px;
}

.badge-earned p {
    color: var(--text-light);
    font-size: 0.95em;
    margin: 0;
}

/* Notifications */
.notification {
    position: fixed;
    top: 90px;
    right: 20px;
    padding: 15px 25px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    z-index: 2000;
    transform: translateX(400px);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    max-width: 350px;
    font-weight: 500;
    backdrop-filter: blur(10px);
}

.notification.show {
    transform: translateX(0);
    opacity: 1;
}

.notification.info {
    background: linear-gradient(135deg, rgba(33, 150, 243, 0.95) 0%, rgba(25, 118, 210, 0.95) 100%);
    color: white;
    border-left: 4px solid #2196f3;
}

.notification.success {
    background: linear-gradient(135deg, rgba(76, 175, 80, 0.95) 0%, rgba(56, 142, 60, 0.95) 100%);
    color: white;
    border-left: 4px solid #4caf50;
}

.notification.error {
    background: linear-gradient(135deg, rgba(244, 67, 54, 0.95) 0%, rgba(211, 47, 47, 0.95) 100%);
    color: white;
    border-left: 4px solid #f44336;
}

/* Recherche ressources */
.resources-search {
    margin-bottom: 30px;
}

.resources-search input {
    width: 100%;
    padding: 15px 20px;
    font-size: 1.1em;
    border: 2px solid rgba(102, 126, 234, 0.3);
    border-radius: 15px;
    background: var(--bg-light);
    color: var(--text-dark);
    transition: all 0.3s;
}

.resources-search input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.resource-card[style*="display: none"] {
    display: none !important;
}

/* Actions statistiques */
.stats-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.stats-actions .btn {
    min-width: 200px;
}

/* Améliorations visuelles */
.mode-card:focus {
    outline: 3px solid var(--primary);
    outline-offset: 2px;
}

.answer-btn:focus {
    outline: 3px solid var(--primary);
    outline-offset: 2px;
}

.btn:focus {
    outline: 3px solid rgba(102, 126, 234, 0.5);
    outline-offset: 2px;
}

/* Amélioration du graphique */
.stats-chart canvas {
    max-width: 100%;
    height: auto;
    min-height: 200px;
}

/* Animation de chargement */
@keyframes shimmer {
    0% { background-position: -1000px 0; }
    100% { background-position: 1000px 0; }
}

.loading {
    background: linear-gradient(90deg, transparent, rgba(102, 126, 234, 0.1), transparent);
    background-size: 1000px 100%;
    animation: shimmer 2s infinite;
}

/* Amélioration de l'accessibilité */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Amélioration du contraste pour l'accessibilité */
@media (prefers-contrast: high) {
    :root {
        --primary: #4a5fc7;
        --text-dark: #000;
        --text-light: #333;
    }
    
    body.dark-theme {
        --text-dark: #fff;
        --text-light: #ccc;
    }
}

/* Styles pour le mode révision */
.mode-card[data-mode="review"] {
    position: relative;
}

.mode-card[data-mode="review"]::after {
    content: '🔄';
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 1.2em;
    opacity: 0.7;
}

/* Amélioration des transitions */
.screen {
    will-change: transform, opacity;
}

.container {
    will-change: transform;
}

/* Optimisation des performances */
.info-card,
.mode-card,
.resource-card,
.stat-card {
    will-change: transform;
    transform: translateZ(0);
}

/* Styles pour les écrans très petits */
@media (max-width: 480px) {
    .notification {
        right: 10px;
        left: 10px;
        max-width: none;
    }
    
    .badges-container {
        padding: 15px;
    }
    
    .badge-earned {
        flex-direction: column;
        text-align: center;
    }
    
    .stats-actions .btn {
        width: 100%;
        min-width: auto;
    }
}
