/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header Styles */
.header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    transition: all 0.3s ease;
}

.header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 20px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo i {
    font-size: 2rem;
    color: #667eea;
}

.logo h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #333;
}

.nav ul {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-link {
    text-decoration: none;
    color: #333;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    transition: all 0.3s ease;
    position: relative;
}

.nav-link:hover,
.nav-link.active {
    color: #667eea;
    background: rgba(102, 126, 234, 0.1);
}

.search-container {
    position: relative;
    display: flex;
    align-items: center;
}

#searchInput {
    padding: 0.5rem 2.5rem 0.5rem 1rem;
    border: 2px solid #e0e0e0;
    border-radius: 25px;
    font-size: 0.9rem;
    width: 250px;
    transition: all 0.3s ease;
}

#searchInput:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.search-container i {
    position: absolute;
    right: 1rem;
    color: #667eea;
    cursor: pointer;
}

.hamburger {
    display: none;
    flex-direction: column;
    cursor: pointer;
    gap: 4px;
}

.hamburger span {
    width: 25px;
    height: 3px;
    background: #333;
    border-radius: 2px;
    transition: all 0.3s ease;
}

/* Main Content */
.main {
    margin-top: 80px;
    min-height: calc(100vh - 80px);
}

.section {
    display: none;
    padding: 2rem 0;
    animation: fadeInUp 0.6s ease;
}

.section.active {
    display: block;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Hero Section */
.hero {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: center;
    padding: 3rem 0;
    min-height: 70vh;
}

.hero-content h2 {
    font-size: 3rem;
    font-weight: 700;
    color: white;
    margin-bottom: 1rem;
    line-height: 1.2;
}

.hero-content p {
    font-size: 1.2rem;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 2rem;
    line-height: 1.6;
}

.hero-stats {
    display: flex;
    gap: 2rem;
    margin-bottom: 2rem;
}

.stat {
    text-align: center;
    color: white;
}

.stat-number {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    color: #FFD700;
}

.stat-label {
    font-size: 0.9rem;
    opacity: 0.9;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: 50px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 40px rgba(102, 126, 234, 0.4);
}

.hero-image {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 400px;
}

.floating-card {
    position: absolute;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 1rem 1.5rem;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    animation: float 3s ease-in-out infinite;
}

.floating-card:nth-child(1) {
    top: 10%;
    left: 10%;
    animation-delay: 0s;
}

.floating-card:nth-child(2) {
    top: 50%;
    right: 20%;
    animation-delay: 1s;
}

.floating-card:nth-child(3) {
    bottom: 20%;
    left: 20%;
    animation-delay: 2s;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-20px);
    }
}

.floating-card i {
    font-size: 1.5rem;
    color: #667eea;
}

/* Section Titles */
.section-title {
    text-align: center;
    font-size: 2.5rem;
    font-weight: 700;
    color: white;
    margin-bottom: 3rem;
    position: relative;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background: #FFD700;
    border-radius: 2px;
}

/* Chapter Grid */
.chapter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.chapter-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    cursor: pointer;
    border: 2px solid transparent;
}

.chapter-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
    border-color: #667eea;
}

.chapter-icon {
    width: 70px;
    height: 70px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
}

.chapter-icon i {
    font-size: 2rem;
    color: white;
}

.chapter-card h3 {
    font-size: 1.3rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 1rem;
    line-height: 1.3;
}

.chapter-card p {
    color: #666;
    margin-bottom: 1.5rem;
    line-height: 1.5;
}

.chapter-progress {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.progress-bar {
    flex: 1;
    height: 8px;
    background: #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 4px;
    transition: width 0.5s ease;
    width: 0%;
}

.progress-text {
    font-size: 0.9rem;
    color: #666;
    white-space: nowrap;
}

/* Chapter Content */
.chapter-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    padding: 1rem 2rem;
    border-radius: 15px;
}

.btn-back {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
    padding: 0.75rem 1.5rem;
    border-radius: 25px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-back:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
}

.chapter-selector {
    display: flex;
    align-items: center;
    gap: 1rem;
    color: white;
}

#chapterSelect {
    padding: 0.75rem 1rem;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    font-size: 1rem;
    cursor: pointer;
}

#chapterSelect option {
    background: #333;
    color: white;
}

.chapter-material {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 3rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    line-height: 1.8;
}

.chapter-material h1 {
    color: #333;
    font-size: 2.5rem;
    margin-bottom: 1rem;
    text-align: center;
}

.chapter-material h2 {
    color: #667eea;
    font-size: 2rem;
    margin: 2rem 0 1rem 0;
    border-bottom: 3px solid #667eea;
    padding-bottom: 0.5rem;
}

.chapter-material h3 {
    color: #333;
    font-size: 1.5rem;
    margin: 1.5rem 0 1rem 0;
}

.chapter-material p {
    margin-bottom: 1rem;
    text-align: justify;
}

.chapter-material ul, .chapter-material ol {
    margin: 1rem 0 1rem 2rem;
}

.chapter-material li {
    margin-bottom: 0.5rem;
}

.example-box {
    background: #f8f9ff;
    border-left: 4px solid #667eea;
    padding: 1.5rem;
    margin: 1.5rem 0;
    border-radius: 0 10px 10px 0;
}

.example-box h4 {
    color: #667eea;
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

.activity-box {
    background: linear-gradient(135deg, #667eea10 0%, #764ba210 100%);
    border: 2px solid #667eea;
    padding: 2rem;
    margin: 2rem 0;
    border-radius: 15px;
}

.activity-box h4 {
    color: #667eea;
    font-size: 1.3rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.quiz-preview {
    background: #f0f8ff;
    border: 2px solid #4a90e2;
    border-radius: 15px;
    padding: 2rem;
    margin: 2rem 0;
}

.quiz-preview h4 {
    color: #4a90e2;
    margin-bottom: 1rem;
}

.quiz-question {
    background: white;
    padding: 1.5rem;
    border-radius: 10px;
    margin: 1rem 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.quiz-options {
    list-style: none;
    margin: 1rem 0;
}

.quiz-options li {
    padding: 0.5rem;
    margin: 0.5rem 0;
    background: #f8f9fa;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.quiz-options li:hover {
    background: #e9ecef;
}

.quiz-explanation {
    background: #e8f5e8;
    border-left: 4px solid #28a745;
    padding: 1rem;
    margin-top: 1rem;
    border-radius: 0 5px 5px 0;
}

/* Quiz Section */
.quiz-header {
    text-align: center;
    margin-bottom: 3rem;
}

.quiz-header p {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.2rem;
    margin-top: 1rem;
}

.quiz-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.stat-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 2rem;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
}

.stat-card i {
    font-size: 3rem;
    color: #667eea;
    margin-bottom: 1rem;
}

.stat-card .stat-number {
    display: block;
    font-size: 2.5rem;
    font-weight: 700;
    color: #333;
}

.stat-card .stat-label {
    color: #666;
    font-size: 1.1rem;
}

.quiz-container {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 3rem;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.quiz-sidebar {
    background: #f8f9ff;
    border-radius: 15px;
    padding: 2rem;
    height: fit-content;
    position: sticky;
    top: 100px;
}

.quiz-sidebar h3 {
    color: #333;
    margin-bottom: 1.5rem;
    text-align: center;
}

.question-navigation {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 0.5rem;
    margin-bottom: 2rem;
}

.nav-btn {
    width: 40px;
    height: 40px;
    border: 2px solid #e0e0e0;
    background: white;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}

.nav-btn:hover {
    border-color: #667eea;
    background: #f0f8ff;
}

.nav-btn.answered {
    background: #28a745;
    color: white;
    border-color: #28a745;
}

.nav-btn.current {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.quiz-timer {
    background: #fff3cd;
    border: 2px solid #ffc107;
    border-radius: 10px;
    padding: 1rem;
    text-align: center;
    font-weight: 600;
    color: #856404;
}

.quiz-timer i {
    margin-right: 0.5rem;
}

.quiz-content {
    flex: 1;
}

.quiz-progress {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
    background: #f8f9ff;
    padding: 1rem 2rem;
    border-radius: 15px;
}

.quiz-progress .progress-bar {
    flex: 1;
    height: 10px;
    background: #e0e0e0;
    border-radius: 5px;
}

.quiz-progress .progress-fill {
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 5px;
    transition: width 0.3s ease;
}

.question-container {
    background: white;
    border-radius: 15px;
    padding: 2.5rem;
    margin-bottom: 2rem;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    min-height: 400px;
}

.question {
    margin-bottom: 2rem;
}

.question h3 {
    color: #333;
    font-size: 1.3rem;
    margin-bottom: 1.5rem;
    line-height: 1.5;
}

.question-type {
    display: inline-block;
    background: #667eea;
    color: white;
    padding: 0.3rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 1rem;
}

.options {
    list-style: none;
    margin: 0;
}

.option {
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    padding: 1rem 1.5rem;
    margin: 0.75rem 0;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.option:hover {
    background: #e9ecef;
    border-color: #667eea;
}

.option.selected {
    background: #e7f3ff;
    border-color: #667eea;
    color: #667eea;
    font-weight: 500;
}

.option.correct {
    background: #d4edda;
    border-color: #28a745;
    color: #155724;
}

.option.incorrect {
    background: #f8d7da;
    border-color: #dc3545;
    color: #721c24;
}

.option-letter {
    width: 30px;
    height: 30px;
    background: #667eea;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    flex-shrink: 0;
}

.essay-input {
    width: 100%;
    min-height: 150px;
    padding: 1rem;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    font-family: inherit;
    font-size: 1rem;
    resize: vertical;
    transition: all 0.3s ease;
}

.essay-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.quiz-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.btn-secondary {
    background: #6c757d;
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 25px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-secondary:hover {
    background: #5a6268;
    transform: translateY(-2px);
}

.btn-secondary:disabled {
    background: #e9ecef;
    color: #6c757d;
    cursor: not-allowed;
    transform: none;
}

.btn-success {
    background: #28a745;
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 25px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-success:hover {
    background: #218838;
    transform: translateY(-2px);
}

/* Progress Section */
.progress-overview {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.progress-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    gap: 2rem;
}

.progress-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.progress-icon i {
    font-size: 2.5rem;
    color: white;
}

.progress-info {
    flex: 1;
}

.progress-info h3 {
    color: #333;
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

.progress-bar.large {
    height: 12px;
    margin-bottom: 0.5rem;
}

.progress-percentage {
    font-size: 1.1rem;
    font-weight: 600;
    color: #667eea;
}

.score-display {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
}

.score-number {
    font-size: 3rem;
    font-weight: 700;
    color: #667eea;
}

.score-total {
    font-size: 1.5rem;
    color: #666;
}

.chapter-progress-detailed {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.chapter-progress-detailed h3 {
    color: #333;
    margin-bottom: 2rem;
    text-align: center;
}

.progress-list {
    display: grid;
    gap: 1rem;
}

.progress-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: #f8f9ff;
    border-radius: 10px;
    transition: all 0.3s ease;
}

.progress-item:hover {
    background: #f0f8ff;
    transform: translateX(5px);
}

.progress-item-icon {
    width: 40px;
    height: 40px;
    background: #667eea;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    flex-shrink: 0;
}

.progress-item-info {
    flex: 1;
}

.progress-item-info h4 {
    color: #333;
    margin-bottom: 0.5rem;
    font-size: 1rem;
}

.progress-item .progress-bar {
    height: 6px;
    background: #e0e0e0;
    border-radius: 3px;
}

.progress-item-status {
    font-size: 0.9rem;
    color: #667eea;
    font-weight: 500;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 2000;
    animation: fadeIn 0.3s ease;
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: white;
    border-radius: 20px;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    animation: scaleIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 2rem 2rem 1rem 2rem;
    border-bottom: 2px solid #f0f0f0;
}

.modal-header h3 {
    color: #333;
    margin: 0;
}

.close {
    font-size: 2rem;
    cursor: pointer;
    color: #999;
    transition: color 0.3s ease;
}

.close:hover {
    color: #333;
}

.modal-body {
    padding: 2rem;
    line-height: 1.6;
}

.modal-body h4 {
    color: #667eea;
    margin-bottom: 1rem;
}

.modal-body .correct-answer {
    background: #d4edda;
    border-left: 4px solid #28a745;
    padding: 1rem;
    margin: 1rem 0;
    border-radius: 0 10px 10px 0;
}

.modal-body .explanation {
    background: #f8f9ff;
    border-left: 4px solid #667eea;
    padding: 1rem;
    margin: 1rem 0;
    border-radius: 0 10px 10px 0;
}

/* Footer */
.footer {
    background: rgba(0, 0, 0, 0.8);
    color: white;
    text-align: center;
    padding: 2rem 0;
    margin-top: 3rem;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .hero {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 2rem;
    }
    
    .hero-content h2 {
        font-size: 2.5rem;
    }
    
    .quiz-container {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .quiz-sidebar {
        position: static;
        order: 2;
    }
}

@media (max-width: 768px) {
    .header .container {
        flex-wrap: wrap;
        gap: 1rem;
    }
    
    .nav {
        display: none;
        width: 100%;
        order: 3;
    }
    
    .nav.active {
        display: block;
    }
    
    .nav ul {
        flex-direction: column;
        gap: 0;
        background: white;
        border-radius: 10px;
        padding: 1rem;
        margin-top: 1rem;
    }
    
    .hamburger {
        display: flex;
    }
    
    #searchInput {
        width: 200px;
    }
    
    .hero-content h2 {
        font-size: 2rem;
    }
    
    .hero-stats {
        justify-content: center;
        gap: 1rem;
    }
    
    .section-title {
        font-size: 2rem;
    }
    
    .chapter-grid {
        grid-template-columns: 1fr;
    }
    
    .chapter-navigation {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .chapter-material {
        padding: 2rem 1.5rem;
    }
    
    .quiz-stats {
        grid-template-columns: 1fr;
    }
    
    .quiz-container {
        padding: 1rem;
    }
    
    .question-navigation {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .progress-overview {
        grid-template-columns: 1fr;
    }
    
    .progress-card {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 15px;
    }
    
    .hero-content h2 {
        font-size: 1.8rem;
    }
    
    .hero-content p {
        font-size: 1rem;
    }
    
    .chapter-material {
        padding: 1.5rem 1rem;
    }
    
    .chapter-material h1 {
        font-size: 2rem;
    }
    
    .chapter-material h2 {
        font-size: 1.5rem;
    }
    
    .question-container {
        padding: 1.5rem 1rem;
    }
    
    .quiz-controls {
        flex-direction: column;
        gap: 1rem;
    }
    
    .quiz-controls .btn-secondary,
    .quiz-controls .btn-primary,
    .quiz-controls .btn-success {
        width: 100%;
        justify-content: center;
    }
    
    .modal-content {
        width: 95%;
        margin: 1rem;
    }
    
    .modal-header,
    .modal-body {
        padding: 1.5rem 1rem;
    }
}

/* Print Styles */
@media print {
    .header,
    .footer,
    .quiz-sidebar,
    .quiz-controls,
    .chapter-navigation {
        display: none !important;
    }
    
    .main {
        margin-top: 0;
    }
    
    .chapter-material {
        background: white !important;
        box-shadow: none !important;
        border: 1px solid #ddd;
    }
    
    .section {
        display: block !important;
        page-break-before: always;
    }
    
    .section:first-child {
        page-break-before: auto;
    }
}

/* Dark mode support (optional) */
@media (prefers-color-scheme: dark) {
    /* Add dark mode styles if needed */
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .btn-primary,
    .progress-fill,
    .chapter-icon {
        background: #000 !important;
    }
    
    .chapter-card,
    .modal-content {
        border: 2px solid #000 !important;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus styles for accessibility */
.nav-link:focus,
.btn-primary:focus,
.btn-secondary:focus,
.btn-success:focus,
.chapter-card:focus,
.option:focus,
#searchInput:focus,
#chapterSelect:focus {
    outline: 3px solid #667eea;
    outline-offset: 2px;
}

/* Skip link for accessibility */
.skip-link {
    position: absolute;
    top: -40px;
    left: 6px;
    background: #000;
    color: white;
    padding: 8px;
    text-decoration: none;
    z-index: 9999;
}

.skip-link:focus {
    top: 6px;
}