/* ==========================================
   MAIN.CSS - Design Tokens, Variables & Base
   ========================================== */

:root {
    /* Color Palette - Modern EduTech Theme */
    --color-primary: #1e1b4b;       /* Deep Indigo */
    --color-primary-light: #312e81;
    --color-secondary: #4c1d95;     /* Royal Violet */
    --color-accent: #f59e0b;        /* Warm Amber */
    --color-accent-hover: #d97706;
    
    /* Backgrounds */
    --bg-main: #f8fafc;             /* Cool Slate Tint */
    --bg-surface: #ffffff;          /* Pure White Card */
    --bg-header: #1e1b4b;
    --bg-nav: #0f172a;
    --bg-card: #ffffff;
    --bg-hover: #f1f5f9;
    
    /* Text Colors */
    --text-primary: #0f172a;        /* Deep Slate Body Text (Contrast > 10:1) */
    --text-muted: #475569;          /* Slate Muted */
    --text-on-dark: #f8fafc;        /* White text for dark headers */
    --text-accent: #b45309;
    
    /* Highlights & Borders */
    --border-color: #e2e8f0;
    --border-focus: #f59e0b;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
    --shadow-lg: 0 10px 25px rgba(0,0,0,0.12);
    
    /* Highlight Colors for Poetic Devices */
    --hl-octave: #dbeafe;          /* Soft Blue */
    --hl-sestet: #fef3c7;          /* Soft Gold */
    --hl-volta: #fce7f3;           /* Soft Pink */
    --hl-allusion: #e0e7ff;        /* Soft Indigo */
    --hl-personification: #dcfce7; /* Soft Mint */
    
    /* Active Line Reader Focus */
    --reading-active-bg: #fffbeb;
    --reading-active-border: #f59e0b;

    /* Base Typography */
    --font-heading: 'Playfair Display', Georgia, serif;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --base-font-size: 16px;
    --font-scale: 1;
    --line-height-body: 1.6;
    
    /* Radius & Spacing */
    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 18px;
    --radius-full: 9999px;
}

/* CSS Reset & Base Elements */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: calc(var(--base-font-size) * var(--font-scale));
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    font-size: 1rem;
    line-height: var(--line-height-body);
    color: var(--text-primary);
    background-color: var(--bg-main);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Typography Hierarchy */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    color: var(--text-primary);
    line-height: 1.25;
    margin-bottom: 0.5em;
    font-weight: 700;
}

h1 { font-size: 2.2rem; }
h2 { font-size: 1.75rem; }
h3 { font-size: 1.35rem; }
h4 { font-size: 1.1rem; }

p {
    margin-bottom: 1em;
}

p:last-child {
    margin-bottom: 0;
}

/* Utility Containers */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.25rem;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Skip link for Accessibility */
.skip-link {
    position: absolute;
    top: -60px;
    left: 10px;
    background: var(--color-accent);
    color: #000000;
    font-weight: 700;
    padding: 12px 20px;
    z-index: 9999;
    border-radius: var(--radius-sm);
    text-decoration: none;
    transition: top 0.2s ease;
    box-shadow: var(--shadow-lg);
}

.skip-link:focus {
    top: 10px;
    outline: 3px solid #000000;
}

/* App Structural Shell */
.app-header {
    background-color: var(--bg-header);
    color: var(--text-on-dark);
    padding: 1rem 0;
    box-shadow: var(--shadow-md);
    position: sticky;
    top: 0;
    z-index: 100;
}

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

.brand {
    display: flex;
    flex-direction: column;
}

.ncf-badge {
    background: var(--color-secondary);
    color: #ffffff;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 2px 10px;
    border-radius: var(--radius-full);
    width: fit-content;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.lesson-title {
    font-size: 1.5rem;
    color: var(--text-on-dark);
    margin: 0;
}

.author-subtitle {
    font-family: var(--font-body);
    font-size: 0.9rem;
    font-weight: 400;
    opacity: 0.85;
}

.app-main {
    flex: 1;
    padding: 2rem 0;
}

.app-footer {
    background-color: var(--bg-nav);
    color: var(--text-on-dark);
    padding: 1.5rem 0;
    margin-top: auto;
    font-size: 0.9rem;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.footer-badges {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.wcag-badge {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: #22c55e;
}
