/* Interactive Quiz Styles for PYQ Section */

:root {
    --primary-color: #6366f1;
    --secondary-color: #4f46e5;
    --success-color: #10b981;
    --error-color: #ef4444;
    --bg-color: #f8fafc;
    --card-bg: #ffffff;
    --text-color: #334155;
    --heading-color: #1e293b;
    --border-color: #e2e8f0;
}

body {
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--bg-color);
    margin: 0;
    padding: 20px;
}

.container {
    max-width: 900px;
    margin: 0 auto;
}

header {
    text-align: center;
    margin-bottom: 30px;
    padding: 30px 20px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.3);
    position: relative;
}

header h1 {
    margin: 0 0 10px 0;
    font-size: 1.8rem;
    font-weight: 800;
}

.subtitle {
    font-size: 0.95rem;
    opacity: 0.9;
}

.score-display {
    margin-top: 15px;
    background: rgba(255, 255, 255, 0.15);
    padding: 10px 20px;
    border-radius: 25px;
    display: inline-block;
    font-weight: 600;
}

.theme-toggle {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    cursor: pointer;
    font-size: 1.2rem;
}

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

.question-card {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    border: 1px solid var(--border-color);
    transition: transform 0.2s, box-shadow 0.2s;
    position: relative;
}

.question-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}

.year-badge {
    position: absolute;
    top: -12px;
    right: 20px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    padding: 6px 15px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.4);
}

.question-text {
    font-size: 1.05rem;
    color: var(--heading-color);
    margin-bottom: 20px;
    line-height: 1.7;
}

.question-text strong {
    color: var(--primary-color);
}

.options {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.option {
    display: block;
    width: 100%;
    padding: 15px 20px;
    text-align: left;
    background: #f8fafc;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.2s;
    color: var(--text-color);
}

.option:hover:not(.disabled) {
    background: #eef2ff;
    border-color: var(--primary-color);
    transform: translateX(5px);
}

.option.correct {
    background: #dcfce7 !important;
    border-color: var(--success-color) !important;
    color: #166534 !important;
}

.option.wrong {
    background: #fee2e2 !important;
    border-color: var(--error-color) !important;
    color: #991b1b !important;
}

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

.explanation {
    margin-top: 15px;
    padding: 15px;
    background: #f0fdf4;
    border-left: 4px solid var(--success-color);
    border-radius: 0 8px 8px 0;
    font-size: 0.95rem;
    color: #166534;
}

.nav-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 40px;
    flex-wrap: wrap;
}

.nav-btn {
    padding: 12px 25px;
    background: var(--primary-color);
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.2s;
}

.nav-btn:hover {
    background: var(--secondary-color);
    transform: translateY(-2px);
}

/* Chapter Index Styles */
.chapter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 30px;
}

.chapter-card {
    background: var(--card-bg);
    padding: 25px;
    border-radius: 12px;
    text-decoration: none;
    color: inherit;
    border: 1px solid var(--border-color);
    transition: all 0.2s;
}

.chapter-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    border-color: var(--primary-color);
}

.chapter-card h3 {
    margin: 0 0 10px 0;
    color: var(--heading-color);
}

.chapter-card .count {
    font-size: 0.9rem;
    color: #64748b;
}

/* Stats Box */
.stats-box {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin: 20px 0;
    flex-wrap: wrap;
}

.stat-item {
    text-align: center;
    padding: 15px 25px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 10px;
}

.stat-number {
    font-size: 2rem;
    font-weight: 700;
}

.stat-label {
    font-size: 0.85rem;
    opacity: 0.9;
}

/* Dark Theme Support */
body.dark-mode {
    --bg-color: #0f172a;
    --card-bg: #1e293b;
    --text-color: #e2e8f0;
    --heading-color: #f8fafc;
    --border-color: #334155;
}

body.dark-mode .option {
    background: #334155;
    color: var(--text-color);
}

body.dark-mode .option:hover:not(.disabled) {
    background: #3b4c6b;
}

body.dark-mode .option.correct {
    background: #064e3b !important;
    color: #6ee7b7 !important;
}

body.dark-mode .option.wrong {
    background: #7f1d1d !important;
    color: #fca5a5 !important;
}

body.dark-mode .explanation {
    background: #064e3b;
    color: #6ee7b7;
}

@media (max-width: 600px) {
    header h1 {
        font-size: 1.4rem;
    }

    .question-card {
        padding: 20px 15px;
    }

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

    .year-badge {
        top: -10px;
        right: 10px;
        font-size: 0.75rem;
        padding: 5px 12px;
    }
}