/* styles.css */
/* Modern, professional, fully responsive design with dark mode support */

:root {
    --primary: #00d4ff;
    --text: #1a1a2e;
    --bg: #f8f9ff;
    --card-bg: #ffffff;
    --border: #e0e0e0;
    --shadow: 0 10px 30px rgba(0, 212, 255, 0.15);
}

.dark {
    --primary: #00d4ff;
    --text: #f0f0ff;
    --bg: #0f172a;
    --card-bg: #1e2937;
    --border: #334155;
    --shadow: 0 10px 30px rgba(0, 212, 255, 0.25);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    transition: background 0.4s ease, color 0.4s ease;
    min-height: 100vh;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 5%;
    background: var(--card-bg);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.8rem;
    font-weight: 700;
    letter-spacing: -1px;
}

.logo-icon {
    color: var(--primary);
    animation: pulse 2s infinite;
}

.nav-btn {
    background: var(--primary);
    color: #0f172a;
    border: none;
    padding: 10px 20px;
    border-radius: 50px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.nav-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 212, 255, 0.4);
}

.dark-toggle {
    background: none;
    border: none;
    font-size: 1.8rem;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: transform 0.3s ease;
}

.dark-toggle:hover {
    transform: rotate(30deg);
}

.hero {
    max-width: 1200px;
    margin: 4rem auto;
    padding: 0 5%;
    text-align: center;
}

.hero-title {
    font-size: 3.2rem;
    margin-bottom: 1rem;
    background: linear-gradient(90deg, #00d4ff, #0099cc);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-subtitle {
    font-size: 1.4rem;
    color: #64748b;
    margin-bottom: 3rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.5rem;
    max-width: 1200px;
    margin: 0 auto;
}

.category-card {
    background: var(--card-bg);
    border-radius: 20px;
    padding: 2rem 1.5rem;
    text-align: center;
    box-shadow: var(--shadow);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    border: 2px solid transparent;
}

.category-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0, 212, 255, 0.25);
    border-color: var(--primary);
}

.category-card h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: var(--text);
}

.category-card p {
    color: #64748b;
    font-size: 1rem;
}

.screen {
    max-width: 1000px;
    margin: 3rem auto;
    padding: 2rem;
    animation: fadeIn 0.6s ease forwards;
}

.hidden {
    display: none !important;
}

.difficulty-container {
    background: var(--card-bg);
    border-radius: 24px;
    padding: 3rem;
    box-shadow: var(--shadow);
    text-align: center;
}

.back-btn {
    background: none;
    border: none;
    color: var(--primary);
    font-size: 1.1rem;
    cursor: pointer;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 5px;
}

.screen-title {
    font-size: 2rem;
    margin-bottom: 2rem;
}

.category-name {
    color: var(--primary);
}

.difficulty-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.difficulty-card {
    background: var(--card-bg);
    border-radius: 20px;
    padding: 2rem;
    text-align: center;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
    cursor: pointer;
}

.difficulty-card:hover {
    transform: scale(1.05);
}

.difficulty-badge {
    display: inline-block;
    padding: 6px 18px;
    border-radius: 50px;
    font-weight: 700;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.easy { background: #10b981; color: white; }
.medium { background: #f59e0b; color: white; }
.hard { background: #ef4444; color: white; }

.quiz-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 2rem;
}

.badge {
    background: var(--primary);
    color: #0f172a;
    padding: 6px 16px;
    border-radius: 50px;
    font-size: 0.9rem;
    font-weight: 600;
}

.timer-container {
    text-align: center;
}

.timer-label {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 0.7;
}

.timer {
    font-size: 2.8rem;
    font-weight: 700;
    color: var(--primary);
    transition: color 0.3s;
}

.progress-bar {
    height: 6px;
    background: #e2e8f0;
    border-radius: 50px;
    overflow: hidden;
    margin-top: 8px;
    width: 220px;
}

.dark .progress-bar {
    background: #334155;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), #0099cc);
    width: 100%;
    transition: width 0.3s linear;
}

.voice-btn {
    background: var(--card-bg);
    border: 3px solid var(--primary);
    color: var(--primary);
    font-size: 2rem;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
}

.voice-btn:hover {
    transform: scale(1.1);
}

.question-container {
    background: var(--card-bg);
    border-radius: 24px;
    padding: 2.5rem;
    box-shadow: var(--shadow);
}

.question-text {
    font-size: 1.5rem;
    margin-bottom: 2rem;
    line-height: 1.4;
}

.options-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

.option {
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    padding: 1.2rem 1.5rem;
    border-radius: 16px;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 12px;
}

.dark .option {
    background: #1e2937;
    border-color: #334155;
}

.option:hover {
    border-color: var(--primary);
    transform: translateX(8px);
}

.option.correct {
    border-color: #10b981;
    background: #ecfdf5;
}

.dark .option.correct {
    background: #052e16;
}

.option.wrong {
    border-color: #ef4444;
    background: #fef2f2;
}

.dark .option.wrong {
    background: #450a0a;
}

.feedback {
    margin-top: 1.5rem;
    padding: 1rem 1.5rem;
    border-radius: 16px;
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: 1.2rem;
}

.feedback-icon {
    font-size: 2rem;
}

.next-btn {
    margin-top: 2rem;
    width: 100%;
    padding: 18px;
    background: var(--primary);
    color: #0f172a;
    border: none;
    border-radius: 50px;
    font-size: 1.3rem;
    font-weight: 600;
    cursor: pointer;
}

.result-container {
    background: var(--card-bg);
    border-radius: 24px;
    padding: 3rem 2.5rem;
    text-align: center;
    box-shadow: var(--shadow);
    max-width: 700px;
    margin: 0 auto;
}

.score-circle {
    width: 180px;
    height: 180px;
    margin: 2rem auto;
    background: conic-gradient(var(--primary) 0% var(--score-angle), #e2e8f0 var(--score-angle) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.score-inner {
    background: var(--card-bg);
    width: 130px;
    height: 130px;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.percentage {
    font-size: 3rem;
    font-weight: 700;
    color: var(--primary);
}

.score-label {
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    opacity: 0.7;
}

.result-stats {
    display: flex;
    justify-content: center;
    gap: 3rem;
    margin: 2rem 0;
}

.stat-value {
    display: block;
    font-size: 2.2rem;
    font-weight: 700;
}

.stat-label {
    font-size: 0.95rem;
    opacity: 0.7;
}

.result-message {
    font-size: 1.5rem;
    margin: 1rem 0 2rem;
    font-weight: 500;
}

.result-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.btn-primary, .btn-secondary {
    padding: 16px 32px;
    border-radius: 50px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-primary {
    background: var(--primary);
    color: #0f172a;
    border: none;
}

.btn-secondary {
    background: transparent;
    border: 2px solid var(--primary);
    color: var(--primary);
}

.review-section {
    margin-top: 3rem;
    text-align: left;
}

.review-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.review-item {
    background: #f8fafc;
    padding: 1rem;
    border-radius: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.dark .review-item {
    background: #1e2937;
}

/* Responsive */
@media (max-width: 640px) {
    .hero-title { font-size: 2.5rem; }
    .category-grid { grid-template-columns: 1fr; }
    .quiz-header { flex-direction: column; align-items: flex-start; }
    .timer-container { margin: 1rem auto; }
}

/* Animations */
@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.15); }
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}