/* ============================================
   BAILEDU COMPLETE UI LIBRARY CSS
   Based on Brand Style Guide
   Version: 1.0
   ============================================ */

/* 1. CSS VARIABLES - From Brand Guide */
:root {
    --navy: #1A365D;
    --gold: #D4AF37;
    --slate: #708090;
    --white: #FFFFFF;
    --alert: #C41E3A;
    --light-gray: #F5F5F5;
    --medium-gray: #888888;
    --dark-gray: #444444;
    --near-black: #282828;
    
    --font-heading: 'Montserrat', sans-serif;
    --font-body: 'Open Sans', sans-serif;
}

/* 2. RESET & BASE */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.6;
    color: var(--near-black);
    background-color: var(--light-gray);
}

/* 3. TYPOGRAPHY - Exact from UI Library */
.lesson-number {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 16px;
    color: var(--gold);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 0.5rem;
}

h1 {
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 48px;
    line-height: 57px;
    color: var(--navy);
    margin-bottom: 1.5rem;
}

h2 {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 32px;
    line-height: 38px;
    color: var(--navy);
    margin: 2.5rem 0 1rem 0;
}

h3 {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 24px;
    line-height: 30px;
    color: var(--navy);
    margin: 2rem 0 1rem 0;
}

h4 {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 20px;
    line-height: 24px;
    color: var(--navy);
    margin: 1.5rem 0 0.75rem 0;
}

h5 {
    font-family: var(--font-body);
    font-weight: 700;
    font-size: 18px;
    line-height: 22px;
    color: var(--navy);
    margin: 1.5rem 0 0.75rem 0;
}

h6 {
    font-family: var(--font-body);
    font-weight: 700;
    font-size: 16px;
    line-height: 20px;
    color: var(--navy);
    margin: 1rem 0 0.5rem 0;
}

p {
    font-family: var(--font-body);
    font-size: 18px;
    line-height: 26px;
    margin-bottom: 1rem;
}

p.intro {
    font-size: 18px;
    line-height: 28px;
    color: var(--dark-gray);
}

p.note {
    font-size: 14px;
    line-height: 22px;
    color: var(--medium-gray);
    font-style: italic;
}

/* Links */
a {
    color: var(--navy);
    text-decoration: underline;
    text-underline-offset: 2px;
    transition: all 0.2s ease;
}

a:hover {
    color: var(--gold);
}

a.resource-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--navy);
    font-weight: 600;
    text-decoration: none;
    margin-bottom: 0.5rem;
}

a.resource-link:hover {
    color: var(--gold);
}

a.resource-link::before {
    content: "→";
    font-weight: bold;
}

/* Lists */
ul, ol {
    margin: 0 0 1.5rem 1.5rem;
}

ul li, ol li {
    margin-bottom: 0.5rem;
}

ul.bullet-checklist {
    list-style: none;
    margin: 1.5rem 0;
}

ul.bullet-checklist li {
    position: relative;
    padding-left: 1.5rem;
    margin-bottom: 0.75rem;
}

ul.bullet-checklist li::before {
    content: "•";
    position: absolute;
    left: 0;
    color: var(--navy);
    font-size: 1.2em;
}

ul.bullet-checklist.square li::before {
    content: "▪";
    font-size: 0.8em;
}

/* 4. LAYOUT */
.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 2rem;
}

.section {
    padding: 4rem 0;
}

.component-container {
    background-color: var(--white);
    border-radius: 8px;
    padding: 2.5rem;
    margin-bottom: 2rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

/* 5. HEADER & NAVIGATION */
header, .site-header {
    background-color: var(--navy);
    color: var(--white);
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-inner {
    max-width: 1100px;
    margin: 0 auto;
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 24px;
}

.logo a {
    color: var(--white);
    text-decoration: none;
}

.logo span {
    color: var(--gold);
}

nav ul, .nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
    margin: 0;
}

nav a {
    color: var(--white);
    text-decoration: none;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 16px;
    position: relative;
}

nav a.active:after {
    content: "";
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 100%;
    height: 3px;
    background-color: var(--gold);
}

.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
}

.mobile-menu-toggle span {
    display: block;
    width: 25px;
    height: 3px;
    background: var(--white);
    margin: 5px 0;
    transition: 0.3s;
}

/* 6. BUTTONS - From UI Library */
.button {
    display: inline-block;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 16px;
    padding: 0.75rem 1.5rem;
    border-radius: 4px;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s ease;
    border: 2px solid transparent;
}

.button.primary {
    background-color: var(--navy);
    color: var(--white);
    border-color: var(--navy);
}

.button.primary:hover {
    background-color: var(--white);
    color: var(--navy);
}

.button.secondary {
    background-color: var(--white);
    color: var(--navy);
    border-color: var(--navy);
}

.button.secondary:hover {
    background-color: var(--navy);
    color: var(--white);
}

.button.gold {
    background-color: var(--gold);
    color: var(--navy);
    border-color: var(--gold);
}

.button.gold:hover {
    background-color: transparent;
    color: var(--gold);
}

/* 7. CARDS */
.card {
    background-color: var(--white);
    border-radius: 8px;
    padding: 2rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    margin-bottom: 2rem;
}

.card-title {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 24px;
    color: var(--navy);
    margin-bottom: 1rem;
}

/* 8. CALLOUTS - From UI Library */
.callout {
    border-left: 4px solid;
    padding: 1.5rem;
    margin: 1.5rem 0;
    border-radius: 0 4px 4px 0;
}

.callout.info {
    background-color: rgba(26, 54, 93, 0.05);
    border-color: var(--navy);
}

.callout.warning {
    background-color: rgba(212, 175, 55, 0.1);
    border-color: var(--gold);
}

.callout.danger {
    background-color: rgba(196, 30, 58, 0.05);
    border-color: var(--alert);
}

.callout-title {
    font-weight: 700;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.callout.info .callout-title {
    color: var(--navy);
}

.callout.warning .callout-title {
    color: var(--dark-gray);
}

.callout.danger .callout-title {
    color: var(--alert);
}

/* 9. DEFINITIONS - From UI Library */
.definition {
    background-color: var(--light-gray);
    padding: 1.25rem;
    border-radius: 4px;
    margin: 1.5rem 0;
}

.definition-term {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 18px;
    color: var(--navy);
    margin-bottom: 0.5rem;
}

/* 10. BLOCKQUOTES */
blockquote {
    font-style: italic;
    border-left: 3px solid var(--gold);
    padding-left: 1.5rem;
    margin: 1.5rem 0;
    color: var(--dark-gray);
}

blockquote cite {
    display: block;
    font-style: normal;
    font-weight: 600;
    margin-top: 0.5rem;
    font-size: 14px;
}

/* 11. CODE BLOCKS */
pre {
    background-color: var(--light-gray);
    padding: 1.25rem;
    border-radius: 4px;
    overflow-x: auto;
    margin: 1.5rem 0;
    font-family: monospace;
    font-size: 14px;
    line-height: 1.5;
}

code {
    font-family: monospace;
    background-color: var(--light-gray);
    padding: 0.2rem 0.4rem;
    border-radius: 3px;
    font-size: 0.9em;
}

/* 12. TABLES */
table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    font-size: 14px;
}

th {
    background-color: var(--navy);
    color: var(--white);
    text-align: left;
    padding: 0.75rem;
    font-family: var(--font-heading);
    font-weight: 700;
}

td {
    padding: 0.75rem;
    border-bottom: 1px solid var(--light-gray);
}

tr:nth-child(even) {
    background-color: var(--light-gray);
}

/* 13. FORMS */
.form-group {
    margin-bottom: 1.5rem;
}

label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--navy);
}

input[type="text"],
input[type="email"],
input[type="tel"],
textarea,
select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--medium-gray);
    border-radius: 4px;
    font-size: 16px;
    font-family: var(--font-body);
    transition: border-color 0.2s ease;
}

input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--navy);
}

/* 14. QUIZ ELEMENTS */
.quiz-question {
    background-color: var(--light-gray);
    padding: 1.5rem;
    border-radius: 8px;
    margin: 2rem 0;
}

.quiz-options {
    list-style: none;
    margin: 1rem 0 0 0;
}

.quiz-option {
    background-color: var(--white);
    border: 1px solid #E8E8E8;
    border-radius: 4px;
    padding: 1rem;
    margin-bottom: 0.75rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.quiz-option:hover {
    border-color: var(--navy);
}

.quiz-option.selected {
    border-color: var(--navy);
    border-width: 2px;
    background-color: rgba(26, 54, 93, 0.05);
}

/* 15. ACCORDIONS */
.accordion {
    margin: 1.5rem 0;
    border: 1px solid var(--light-gray);
    border-radius: 8px;
    overflow: hidden;
}

.accordion-item {
    border-bottom: 1px solid var(--light-gray);
}

.accordion-item:last-child {
    border-bottom: none;
}

.accordion-header {
    background-color: var(--white);
    padding: 1.25rem;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: var(--font-heading);
    font-weight: 700;
    color: var(--navy);
    transition: background-color 0.2s ease;
}

.accordion-header:hover {
    background-color: var(--light-gray);
}

.accordion-header.active {
    background-color: var(--navy);
    color: var(--white);
}

.accordion-content {
    background-color: var(--white);
    padding: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease;
}

.accordion-content.active {
    padding: 1.25rem;
    max-height: 500px;
}

/* 16. NAVIGATION BUTTONS */
.navigation-buttons {
    display: flex;
    justify-content: space-between;
    margin-top: 3rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--light-gray);
}

.nav-button {
    font-family: var(--font-heading);
    font-weight: 700;
    padding: 0.75rem 1.5rem;
    border-radius: 4px;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.button-previous {
    background-color: var(--white);
    color: var(--navy);
    border: 2px solid var(--navy);
}

.button-next {
    background-color: var(--navy);
    color: var(--white);
    border: 2px solid var(--navy);
}

/* 17. FOOTER */
footer, .site-footer {
    background-color: var(--navy);
    color: var(--white);
    padding: 3rem 2rem 1.5rem 2rem;
    margin-top: 4rem;
}

.footer-content {
    max-width: 1100px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h4, .footer-column h4 {
    color: var(--gold);
    font-size: 18px;
    margin-bottom: 1rem;
}

.footer-section ul, .footer-column ul {
    list-style: none;
    margin: 0;
}

.footer-section a, .footer-column a {
    color: var(--white);
    text-decoration: none;
    line-height: 2;
    transition: color 0.2s ease;
}

.footer-section a:hover, .footer-column a:hover {
    color: var(--gold);
}

.footer-bottom {
    text-align: center;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255,255,255,0.2);
}

/* 18. UTILITY CLASSES */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}

/* 19. MOBILE RESPONSIVE - CRITICAL */
@media (max-width: 768px) {
    /* Typography adjustments */
    h1 { 
        font-size: 36px; 
        line-height: 42px; 
    }
    
    h2 { 
        font-size: 28px; 
        line-height: 34px; 
    }
    
    h3 { 
        font-size: 22px; 
        line-height: 28px; 
    }
    
    /* Header mobile */
    .header-inner {
        flex-direction: column;
        gap: 1rem;
    }
    
    nav ul, .nav-menu {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .mobile-menu-toggle {
        display: block;
    }
    
    .main-navigation {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--navy);
        padding: 1rem;
    }
    
    .main-navigation.active {
        display: block;
    }
    
    .nav-menu {
        flex-direction: column;
        gap: 1rem;
    }
    
    /* Layout adjustments */
    .container {
        padding: 0 1rem;
    }
    
    .grid-2,
    .grid-3,
    .grid-4 {
        grid-template-columns: 1fr;
    }
    
    /* Footer mobile */
    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    /* Navigation buttons mobile */
    .navigation-buttons {
        flex-direction: column;
        gap: 1rem;
    }
    
    /* Tables mobile */
    table {
        font-size: 12px;
    }
    
    th, td {
        padding: 0.5rem;
    }
    
    /* Cards mobile */
    .card {
        padding: 1.5rem;
    }
    
    /* Component container mobile */
    .component-container {
        padding: 1.5rem;
    }
}

/* Extra small devices */
@media (max-width: 480px) {
    body {
        font-size: 14px;
    }
    
    h1 { 
        font-size: 28px; 
        line-height: 34px; 
    }
    
    h2 { 
        font-size: 24px; 
        line-height: 30px; 
    }
    
    .button {
        padding: 0.6rem 1.2rem;
        font-size: 14px;
    }
}

/* Print styles */
@media print {
    .site-header,
    .site-footer,
    .navigation-buttons,
    .mobile-menu-toggle {
        display: none;
    }
    
    body {
        background: white;
        color: black;
    }
}
