/* ===== GLOBAL STYLES ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Subject colors */
    --biology-primary: #4caf50;
    --biology-light: #e8f5e8;
    --chemistry-primary: #ff9800;
    --chemistry-light: #fff3e0;
    --earth-science-primary: #8bc34a;
    --earth-science-light: #f1f8e9;
    --math-primary: #9c27b0;
    --math-light: #f3e5f5;

    /* Common colors */
    --story-bg: #e8f4fd;
    --story-border: #2196f3;
    --concept-bg: #f8f9ff;
    --concept-border: #e1e5fe;
    --fact-bg: #f0f8ff;
    --importance-bg: #e3f2fd;
    --importance-border: #2196f3;

    /* Grays */
    --gray-50: #fafafa;
    --gray-100: #f5f5f5;
    --gray-200: #eeeeee;
    --gray-300: #e0e0e0;
    --gray-700: #616161;
    --gray-900: #212121;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: var(--gray-900);
    background-color: var(--gray-50);
}

/* ===== NAVIGATION ===== */
.top-nav {
    background: white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 1rem 0;
}

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

.nav-container h1 {
    font-size: 1.5rem;
    color: var(--gray-900);
}

.nav-controls {
    display: flex;
    gap: 1rem;
    align-items: center;
}

#day-indicator {
    font-weight: 600;
    color: var(--gray-700);
}

.nav-btn {
    padding: 0.5rem 1rem;
    border: 1px solid var(--gray-300);
    background: white;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s;
}

.nav-btn:hover:not(:disabled) {
    background: var(--gray-100);
    border-color: var(--gray-700);
}

.nav-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* ===== MAIN CONTENT ===== */
.main-content {
    max-width: 900px;
    margin: 2rem auto;
    padding: 0 2rem;
}

.lesson-container {
    background: white;
    border-radius: 8px;
    padding: 2rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

/* ===== LESSON HEADER ===== */
.day-header {
    padding: 2rem;
    border-radius: 8px;
    margin-bottom: 2rem;
}

.day-header.biology { background: var(--biology-light); }
.day-header.chemistry { background: var(--chemistry-light); }
.day-header.earth-science { background: var(--earth-science-light); }
.day-header.math { background: var(--math-light); }

.day-header h1 {
    font-size: 2rem;
    margin-bottom: 1rem;
}

.day-header p {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.timer {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: white;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
    margin-top: 0.5rem;
}

/* ===== OBJECTIVES ===== */
.objectives {
    background: var(--gray-100);
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 2rem;
}

.objectives h2 {
    margin-bottom: 1rem;
    color: var(--gray-900);
}

.objectives ul {
    list-style: none;
    padding-left: 0;
}

.objectives li {
    padding: 0.5rem 0;
    padding-left: 1.5rem;
    position: relative;
}

.objectives li:before {
    content: "✓";
    position: absolute;
    left: 0;
    color: var(--biology-primary);
    font-weight: bold;
}

/* ===== STORY BOX ===== */
.story-box {
    background: var(--story-bg);
    border-left: 4px solid var(--story-border);
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 2rem;
}

.story-box h3 {
    margin-bottom: 1rem;
    color: var(--story-border);
}

/* ===== CONCEPT BOX ===== */
.concept-box {
    background: var(--concept-bg);
    border: 1px solid var(--concept-border);
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 2rem;
}

.concept-box h3 {
    margin-bottom: 1rem;
    color: var(--gray-900);
}

.analogy-box {
    background: #fff9e6;
    border-left: 3px solid #ffd54f;
    padding: 1rem;
    margin: 1rem 0;
    border-radius: 4px;
}

.fact-box {
    background: var(--fact-bg);
    padding: 1rem;
    border-radius: 4px;
    margin: 1rem 0;
}

.fact-box h4 {
    margin-bottom: 0.5rem;
}

.fact-box ul {
    margin-left: 1.5rem;
}

.importance-box {
    background: var(--importance-bg);
    border: 2px solid var(--importance-border);
    padding: 1.5rem;
    border-radius: 12px;
    margin: 1rem 0;
}

/* ===== WORKED EXAMPLES ===== */
.worked-examples {
    margin: 2rem 0;
}

.worked-example {
    background: #fff8e1;
    border: 1px solid #ffb74d;
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
}

.worked-example h4 {
    color: #e65100;
    margin-bottom: 1rem;
}

.problem-setup {
    font-style: italic;
    margin-bottom: 1rem;
    color: var(--gray-700);
}

.solution-steps {
    margin: 1rem 0;
}

.step {
    background: white;
    padding: 1rem;
    margin: 0.5rem 0;
    border-radius: 4px;
    border-left: 3px solid #ff9800;
}

.step em {
    color: var(--gray-700);
    display: block;
    margin-top: 0.5rem;
}

.solution {
    background: #e8f5e9;
    padding: 1rem;
    border-radius: 4px;
    margin-top: 1rem;
}

.real-world {
    margin-top: 1rem;
    padding: 1rem;
    background: #e3f2fd;
    border-radius: 4px;
}

/* ===== PRACTICE PROBLEMS ===== */
.practice-problems {
    margin: 2rem 0;
}

.practice-problem {
    background: #f3e5f5;
    border: 1px solid #ce93d8;
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
}

.practice-problem.easy { border-left: 4px solid #66bb6a; }
.practice-problem.medium { border-left: 4px solid #ffa726; }
.practice-problem.hard { border-left: 4px solid #ef5350; }

.hints-toggle {
    margin-top: 1rem;
    padding: 0.5rem 1rem;
    background: white;
    border: 1px solid var(--gray-300);
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
}

.hints-toggle:hover {
    background: var(--gray-100);
}

.hints {
    margin-top: 1rem;
    padding: 1rem;
    background: white;
    border-radius: 4px;
}

.hints ul {
    margin-left: 1.5rem;
}

/* ===== QUIZ ===== */
.quiz-section {
    margin: 2rem 0;
}

.quiz {
    background: var(--gray-100);
    padding: 2rem;
    border-radius: 8px;
}

.quiz-question {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
}

.quiz-options {
    margin-top: 1rem;
}

.quiz-option {
    display: block;
    padding: 0.75rem;
    margin: 0.5rem 0;
    background: var(--gray-50);
    border: 2px solid transparent;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

.quiz-option:hover {
    background: var(--gray-100);
    border-color: var(--gray-300);
}

.quiz-option input[type="radio"] {
    margin-right: 0.5rem;
}

.quiz-feedback {
    margin-top: 1rem;
    padding: 1rem;
    border-radius: 4px;
}

.quiz-feedback.correct {
    background: #e8f5e9;
    border-left: 4px solid #4caf50;
}

.quiz-feedback.incorrect {
    background: #ffebee;
    border-left: 4px solid #f44336;
}

.quiz-feedback.warning {
    background: #fff3e0;
    border-left: 4px solid #ff9800;
}

.submit-quiz {
    margin-top: 1rem;
    padding: 1rem 2rem;
    background: var(--biology-primary);
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.submit-quiz:hover {
    background: #388e3c;
    transform: translateY(-1px);
}

.quiz-score {
    margin-top: 1.5rem;
    padding: 1.5rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 8px;
    text-align: center;
}

.quiz-score h3 {
    margin: 0;
    font-size: 1.5rem;
}

.completion-status {
    margin-top: 1.5rem;
}

.completion-badge {
    padding: 1.5rem;
    border-radius: 8px;
    text-align: center;
    font-size: 1.1rem;
    font-weight: 600;
}

.completion-badge.completed {
    background: linear-gradient(135deg, #4caf50 0%, #81c784 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.4);
}

.completion-badge.incomplete {
    background: #fff3e0;
    color: #e65100;
    border: 2px solid #ffb74d;
}

/* ===== SELF ASSESSMENT ===== */
.self-assessment {
    background: var(--gray-100);
    padding: 1.5rem;
    border-radius: 8px;
    margin-top: 2rem;
}

.self-assessment h3 {
    margin-bottom: 1rem;
}

.self-assessment ul {
    list-style: none;
}

.self-assessment li {
    margin: 0.5rem 0;
}

.self-assessment label {
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 4px;
    transition: background 0.2s;
}

.self-assessment label:hover {
    background: white;
}

.self-assessment input[type="checkbox"] {
    margin-right: 0.75rem;
    width: 18px;
    height: 18px;
}

/* ===== FOOTER ===== */
.page-footer {
    text-align: center;
    padding: 2rem;
    color: var(--gray-700);
    background: white;
    margin-top: 4rem;
    border-top: 1px solid var(--gray-200);
}

/* ===== LOADING & ERROR ===== */
.loading {
    text-align: center;
    padding: 4rem 2rem;
    font-size: 1.2rem;
    color: var(--gray-700);
}

.error-message {
    text-align: center;
    padding: 4rem 2rem;
}

.error-message h2 {
    color: #f44336;
    margin-bottom: 1rem;
}

.error-message button {
    margin-top: 1rem;
    padding: 0.75rem 1.5rem;
    background: var(--biology-primary);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
}

/* ===== KEY TERMS ===== */
.key-terms {
    background: #fafbfc;
    padding: 2rem;
    border-radius: 4px;
    margin: 2rem 0;
    border: 1px solid #e1e4e8;
}

.key-terms h3 {
    color: #24292e;
    margin-bottom: 1.5rem;
    font-size: 1.2rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.key-terms h3::before {
    content: "📖";
    font-size: 1.1rem;
}

.key-term {
    background: white;
    padding: 1.25rem 1.5rem;
    margin: 1rem 0;
    border-radius: 4px;
    border: 1px solid #e1e4e8;
}

.key-term:hover {
    border-color: #c8ccd0;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.key-term strong {
    display: inline;
    color: #0366d6;
    font-size: 1.05rem;
    font-weight: 600;
}

.key-term strong::after {
    content: ":";
    color: #24292e;
    margin-right: 0.3rem;
}

.key-term {
    color: #586069;
    line-height: 1.7;
}

.term-example {
    margin-top: 0.75rem;
    padding: 0.75rem 1rem;
    background: #f6f8fa;
    border-radius: 3px;
    font-style: italic;
    color: #586069;
    font-size: 0.95rem;
    border-left: 2px solid #d1d5da;
}

.term-example::before {
    content: "Example: ";
    font-style: normal;
    font-weight: 500;
    color: #24292e;
}

/* ===== COMMON MISTAKES ===== */
.common-mistakes {
    background: #fff3e0;
    padding: 1.5rem;
    border-radius: 8px;
    margin: 2rem 0;
    border-left: 4px solid #ff9800;
}

.common-mistakes h3 {
    color: #f57c00;
    margin-bottom: 1rem;
}

.mistake-item {
    background: white;
    padding: 1rem;
    margin: 0.75rem 0;
    border-radius: 4px;
}

.mistake {
    color: #d32f2f;
    margin-bottom: 0.5rem;
}

.correction {
    color: #388e3c;
    margin-bottom: 0.5rem;
}

.why-matters {
    margin-top: 0.5rem;
    padding: 0.5rem;
    background: #e3f2fd;
    border-radius: 4px;
    font-size: 0.9rem;
}

/* ===== MEMORY AIDS ===== */
.memory-aids {
    background: #f3e5f5;
    padding: 1.5rem;
    border-radius: 8px;
    margin: 2rem 0;
    border-left: 4px solid #9c27b0;
}

.memory-aids h3 {
    color: #7b1fa2;
    margin-bottom: 1rem;
}

.memory-aid {
    background: white;
    padding: 1rem;
    margin: 0.75rem 0;
    border-radius: 4px;
}

.memory-aid .technique {
    font-weight: 600;
    color: #7b1fa2;
    margin-bottom: 0.5rem;
}

.memory-aid .description {
    margin-bottom: 0.5rem;
}

.aid-example {
    margin-top: 0.5rem;
    padding: 0.5rem;
    background: #f3e5f5;
    border-radius: 4px;
    font-style: italic;
}

/* ===== QUICK REFERENCE ===== */
.quick-reference {
    background: #e0f2f1;
    padding: 1.5rem;
    border-radius: 8px;
    margin: 2rem 0;
    border-left: 4px solid #009688;
}

.quick-reference h3 {
    color: #00796b;
    margin-bottom: 1rem;
}

.reference-item {
    background: white;
    padding: 1rem;
    margin: 0.75rem 0;
    border-radius: 4px;
}

.ref-title {
    font-weight: 600;
    color: #00796b;
    margin-bottom: 0.5rem;
}

.ref-content {
    color: var(--gray-700);
}

.reference-item.formula {
    font-family: 'Courier New', monospace;
    border-left: 3px solid #00bcd4;
}

/* ===== VISUAL AIDS ===== */
.visual-aids {
    background: var(--gray-100);
    padding: 1.5rem;
    border-radius: 8px;
    margin: 2rem 0;
}

.visual-aids h3 {
    margin-bottom: 1rem;
}

.visual-aid {
    background: white;
    padding: 1rem;
    margin: 0.75rem 0;
    border-radius: 4px;
    text-align: center;
}

.visual-placeholder {
    padding: 2rem;
    border: 2px dashed var(--gray-300);
    border-radius: 4px;
}

.placeholder-icon {
    font-size: 3rem;
    display: block;
    margin-bottom: 1rem;
}

.visual-description {
    margin-top: 1rem;
    color: var(--gray-700);
    font-style: italic;
}

/* ===== LESSON CONNECTIONS ===== */
.lesson-connections {
    background: #e8f5e9;
    padding: 1.5rem;
    border-radius: 8px;
    margin: 2rem 0;
    border-left: 4px solid #4caf50;
}

.lesson-connections h3 {
    color: #2e7d32;
    margin-bottom: 1rem;
}

.connection-item {
    background: white;
    padding: 1rem;
    margin: 0.5rem 0;
    border-radius: 4px;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.connection-icon {
    font-size: 1.2rem;
}

.connection-link {
    color: #1976d2;
    text-decoration: none;
    font-weight: 500;
}

.connection-link:hover {
    text-decoration: underline;
}

.connection-reason {
    margin-left: auto;
    font-size: 0.9rem;
    color: var(--gray-700);
    font-style: italic;
}

/* ===== LESSON SUMMARY ===== */
.lesson-summary {
    color: #333;
    padding: 1.5rem;
    border-radius: 8px;
    margin: 2rem 0;
}

.lesson-summary h3 {
    color: #333;
    margin-bottom: 1rem;
}

.lesson-summary ul {
    margin-left: 1.5rem;
}

.lesson-summary li {
    margin: 0.5rem 0;
}

/* ===== DASHBOARD ===== */
.dashboard-container {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 2rem;
}

.dashboard-title {
    font-size: 2rem;
    margin-bottom: 2rem;
    color: var(--gray-900);
}

.progress-overview {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: white;
    border-radius: 8px;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: transform 0.2s, box-shadow 0.2s;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

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

.stat-icon {
    font-size: 2.5rem;
}

.stat-content h3 {
    font-size: 0.9rem;
    opacity: 0.9;
    margin-bottom: 0.5rem;
}

.stat-card.primary .stat-content h3 {
    color: white;
}

.stat-value {
    font-size: 1.8rem;
    font-weight: 700;
}

.progress-section {
    background: white;
    border-radius: 8px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.progress-section h2 {
    margin-bottom: 1rem;
}

.progress-bar-container {
    background: var(--gray-200);
    border-radius: 10px;
    height: 24px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.progress-bar-container.small {
    height: 12px;
}

.progress-bar {
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    height: 100%;
    border-radius: 10px;
    transition: width 0.5s ease;
}

.progress-text {
    color: var(--gray-700);
    font-size: 0.9rem;
}

.subject-section {
    background: white;
    border-radius: 8px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.subject-section h2 {
    margin-bottom: 1.5rem;
}

.subject-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.subject-card {
    background: var(--gray-100);
    border-radius: 8px;
    padding: 1.5rem;
    border-left: 4px solid;
}

.subject-card.biology {
    border-left-color: var(--biology-primary);
}

.subject-card.chemistry {
    border-left-color: var(--chemistry-primary);
}

.subject-card.earth-science {
    border-left-color: var(--earth-science-primary);
}

.subject-card.math {
    border-left-color: var(--math-primary);
}

.subject-card h3 {
    margin-bottom: 1rem;
}

.subject-stats {
    display: flex;
    justify-content: space-between;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    color: var(--gray-700);
}

.quiz-history-section {
    background: white;
    border-radius: 8px;
    padding: 2rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.quiz-history-section h2 {
    margin-bottom: 1.5rem;
}

.quiz-history-table {
    width: 100%;
    border-collapse: collapse;
}

.quiz-history-table thead {
    background: var(--gray-100);
}

.quiz-history-table th {
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    border-bottom: 2px solid var(--gray-300);
}

.quiz-history-table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--gray-200);
}

.quiz-history-table tbody tr:hover {
    background: var(--gray-50);
}

.quiz-history-table a {
    color: #0366d6;
    text-decoration: none;
}

.quiz-history-table a:hover {
    text-decoration: underline;
}

.percentage {
    font-weight: 600;
}

.percentage.excellent {
    color: #4caf50;
}

.percentage.good {
    color: #2196f3;
}

.percentage.fair {
    color: #ff9800;
}

.percentage.needs-work {
    color: #f44336;
}

.status-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
}

.status-badge.excellent {
    background: #e8f5e9;
    color: #2e7d32;
}

.status-badge.good {
    background: #e3f2fd;
    color: #1565c0;
}

.status-badge.fair {
    background: #fff3e0;
    color: #e65100;
}

.status-badge.needs-work {
    background: #ffebee;
    color: #c62828;
}

.no-data {
    text-align: center;
    color: var(--gray-700);
    padding: 3rem;
    font-style: italic;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .nav-container {
        flex-direction: column;
        gap: 1rem;
    }

    .nav-controls {
        width: 100%;
        justify-content: space-between;
    }

    .main-content {
        padding: 0 1rem;
    }

    .lesson-container {
        padding: 1rem;
    }

    .day-header h1 {
        font-size: 1.5rem;
    }

    .dashboard-container {
        padding: 0 1rem;
    }

    .progress-overview {
        grid-template-columns: 1fr;
    }

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

    .quiz-history-table {
        font-size: 0.85rem;
    }

    .quiz-history-table th,
    .quiz-history-table td {
        padding: 0.5rem;
    }
}
