/* ==========================================================================
   AINewZ Design System v2.0 — Premium Edition
   Inspired by Linear, Vercel, Notion, Apple
   ========================================================================== */

/* ==========================================================================
   1. Design Tokens
   ========================================================================== */

:root {
    color-scheme: dark;

    /* Background Hierarchy */
    --bg: #08080c;
    --bg-elevated: #0f0f15;
    --surface: #161620;
    --surface-hover: #1c1c28;

    /* Text Hierarchy */
    --text-primary: #f0f0f5;
    --text-secondary: #8b8fa3;
    --text-tertiary: #5a5e72;

    /* Legacy text aliases (backwards compat) */
    --text: var(--text-primary);
    --text-muted: var(--text-secondary);
    --text-subtle: var(--text-tertiary);

    /* Brand */
    --brand: #7c5cff;
    --brand-soft: rgba(124, 92, 255, 0.12);
    --brand-glow: rgba(124, 92, 255, 0.15);
    --accent: #00c2ff;
    --accent-soft: rgba(0, 194, 255, 0.12);
    --accent-glow: rgba(0, 194, 255, 0.15);

    /* Borders */
    --border: rgba(255, 255, 255, 0.06);
    --border-hover: rgba(255, 255, 255, 0.12);
    --border-strong: rgba(255, 255, 255, 0.15);

    /* Legacy */
    --panel: var(--bg-elevated);
    --panel-soft: var(--surface);
    --panel-hover: var(--surface-hover);

    /* Spacing Scale */
    --sp-1: 4px;
    --sp-2: 8px;
    --sp-3: 12px;
    --sp-4: 16px;
    --sp-5: 20px;
    --sp-6: 24px;
    --sp-8: 32px;
    --sp-10: 40px;
    --sp-12: 48px;
    --sp-16: 64px;
    --sp-20: 80px;
    --sp-section: clamp(48px, 8vw, 80px);

    /* Legacy spacing */
    --space-xs: 8px;
    --space-sm: 16px;
    --space-md: 24px;
    --space-lg: 32px;
    --space-xl: 48px;
    --space-2xl: 64px;
    --space-section: 80px;

    /* Radii */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-2xl: 24px;
    --radius-pill: 999px;

    /* Shadows */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.12);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.2);
    --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.3);
    --shadow-brand: 0 8px 30px rgba(124, 92, 255, 0.2);

    /* Transitions */
    --ease-fast: 150ms ease;
    --ease-base: 250ms ease;
    --ease-slow: 400ms ease;
    --ease-spring: 400ms cubic-bezier(0.16, 1, 0.3, 1);

    /* Layout */
    --container-max: 1280px;
}

/* ==========================================================================
   2. Reset & Base
   ========================================================================== */

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; text-size-adjust: 100%; }
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    background: var(--bg);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-feature-settings: 'cv02', 'cv03', 'cv04', 'cv11';
}

img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; transition: color var(--ease-fast); }
button, input, select, textarea { font: inherit; outline: none; border: none; }
button { cursor: pointer; }
::selection { background: var(--brand); color: #fff; }

/* ==========================================================================
   3. Typography System
   ========================================================================== */

h1, h2, h3, h4, h5, h6 {
    color: var(--text-primary);
    font-weight: 700;
    letter-spacing: -0.025em;
    line-height: 1.15;
}

.display-xl {
    font-size: clamp(48px, 6vw, 72px);
    font-weight: 800;
    letter-spacing: -0.04em;
    line-height: 1.05;
}

.display-hero {
    font-size: clamp(36px, 4.5vw, 56px);
    font-weight: 800;
    letter-spacing: -0.04em;
    line-height: 1.08;
}

.heading-1 { font-size: clamp(28px, 3vw, 36px); }
.heading-2 { font-size: clamp(22px, 2.5vw, 28px); }
.heading-3 { font-size: 20px; font-weight: 700; }
.heading-4 {
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-tertiary);
    line-height: 1.4;
}

.text-body { font-size: 16px; color: var(--text-secondary); line-height: 1.7; }
.text-lead { font-size: 18px; color: var(--text-secondary); line-height: 1.7; }
.text-small { font-size: 14px; color: var(--text-secondary); line-height: 1.6; }
.text-tiny {
    font-size: 12px;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 600;
    line-height: 1.4;
}
.text-large { font-size: 18px; color: var(--text-secondary); line-height: 1.8; }

.text-gradient {
    background: linear-gradient(135deg, #fff 0%, var(--brand) 50%, var(--accent) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ==========================================================================
   4. Layout & Containers
   ========================================================================== */

.container {
    width: 100%;
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 24px;
}

.section { padding: var(--sp-section) 0; }
.section-padding { padding-top: var(--sp-section); padding-bottom: var(--sp-section); }
.section-padding-sm { padding-top: var(--sp-12); padding-bottom: var(--sp-12); }

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 40px;
}

.section-label {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-tertiary);
    display: flex;
    align-items: center;
    gap: 12px;
}
.section-label::before {
    content: '';
    display: block;
    width: 2px;
    height: 16px;
    background: var(--brand);
    border-radius: 2px;
}

.section-link {
    font-size: 14px;
    font-weight: 600;
    color: var(--brand);
    transition: opacity var(--ease-fast);
}
.section-link:hover { opacity: 0.8; }

/* ==========================================================================
   5. Grid System
   ========================================================================== */

.grid { display: grid; gap: 24px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-auto { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }

/* Legacy grids */
.grid-sidebar-layout { display: grid; grid-template-columns: 1fr 340px; gap: 48px; }
.grid-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 24px; }
.grid-cols-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 24px; }
.grid-collections { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 20px; }

/* ==========================================================================
   6. Button System
   ========================================================================== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.01em;
    transition: all var(--ease-spring);
    white-space: nowrap;
    cursor: pointer;
    border: none;
    text-decoration: none;
}

.btn-primary {
    background: var(--brand);
    color: #fff;
    box-shadow: 0 2px 12px rgba(124, 92, 255, 0.25);
}
.btn-primary:hover {
    filter: brightness(1.15);
    transform: translateY(-1px);
    box-shadow: var(--shadow-brand);
}

.btn-secondary {
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text-primary);
}
.btn-secondary:hover {
    border-color: var(--border-hover);
    background: var(--surface-hover);
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
}
.btn-ghost:hover {
    background: var(--surface);
    color: var(--text-primary);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-secondary);
}
.btn-outline:hover {
    border-color: var(--brand);
    color: var(--brand);
}

.btn-premium {
    background: linear-gradient(135deg, var(--brand), var(--accent));
    color: #fff;
    border: none;
    box-shadow: 0 4px 14px rgba(124, 92, 255, 0.2);
}
.btn-premium:hover {
    filter: brightness(1.15);
    transform: translateY(-1px);
}

.btn-sm { padding: 8px 16px; font-size: 13px; border-radius: var(--radius-sm); }
.btn-lg { padding: 16px 32px; font-size: 16px; }
.btn-icon {
    width: 40px; height: 40px; padding: 0;
    border-radius: var(--radius-md);
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text-secondary);
}
.btn-icon:hover { border-color: var(--border-hover); color: var(--text-primary); }

/* ==========================================================================
   7. Card System
   ========================================================================== */

.card {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: all var(--ease-spring);
}
.card:hover {
    border-color: var(--border-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}


/* --- Universal Card System Extensions --- */

/* --- Universal Card Semantic Classes --- */
.universal-card-link {
    text-decoration: none;
    color: inherit;
}
.card-media-reel {
    aspect-ratio: 9/16;
    max-height: 400px;
}
.card-media-standard {
    /* Uses the existing .card-media aspect-ratio: 16/9 */
}
.card-badges-absolute {
    position: absolute;
    top: 12px;
    right: 12px;
    display: flex;
    gap: 6px;
}
.card-header-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 8px;
}
.card-type-label {
    display: flex;
    align-items: center;
    font-size: 13px;
    color: var(--text-tertiary);
    font-weight: 600;
}
.card-badges-inline {
    display: flex;
    gap: 6px;
}
.card-title-text {
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text-primary);
    line-height: 1.3;
}
.card-title-standard { font-size: 18px; }
.card-title-expanded { font-size: 24px; }
.card-subtitle-text {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 16px;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.card-footer-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
    padding-top: 12px;
}
.card-metadata-row {
    display: flex;
    gap: 12px;
    font-size: 13px;
    color: var(--text-tertiary);
}
.card-cta-text {
    font-size: 13px;
    font-weight: 600;
    color: var(--brand);
}

/* Theme Colors */
.theme-color-course { color: #7c5cff; }
.theme-color-lesson { color: #7c5cff; }
.theme-color-reel { color: #f43f5e; }
.theme-color-prompt { color: #fbbf24; }
.theme-color-tool { color: #0ea5e9; }
.theme-color-research { color: #fb923c; }
.theme-color-expert { color: #10b981; }
.theme-color-collection { color: #8b5cf6; }
.theme-color-news { color: #a8a29e; }
.card-compact {
    display: flex;
    flex-direction: row;
    align-items: center;
    padding: 12px 16px;
    gap: 16px;
}
.card-compact .card-media {
    width: 60px;
    height: 60px;
    border-radius: var(--radius-sm);
    aspect-ratio: 1;
}
.card-compact .card-body {
    padding: 0;
    flex: 1;
}

.card-expanded {
    display: flex;
    flex-direction: column;
}
@media (min-width: 768px) {
    .card-expanded {
        flex-direction: row;
    }
    .card-expanded .card-media {
        width: 40%;
        aspect-ratio: auto;
    }
    .card-expanded .card-body {
        width: 60%;
        padding: 32px;
    }
}

.content-type-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.08);
    font-size: 12px;
    margin-right: 8px;
    vertical-align: middle;
}

/* Legacy card classes */
.card-base {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: all var(--ease-spring);
}

.card-interactive { cursor: pointer; }
.card-interactive:hover {
    border-color: var(--border-hover);
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.card-body { padding: 24px; }
.card-media { aspect-ratio: 16/9; overflow: hidden; background: var(--surface); position: relative; }
.card-media img {
    width: 100%; height: 100%; object-fit: cover;
    transition: transform 600ms var(--ease-spring);
}
.card:hover .card-media img,
.card-interactive:hover .card-media img { transform: scale(1.03); }

.card-sm { border-radius: var(--radius-md); }
.card-sm .card-body { padding: 20px; }

/* ==========================================================================
   8. Badge System
   ========================================================================== */

.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: var(--radius-pill);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.02em;
    white-space: nowrap;
    background: var(--brand-soft);
    color: #b4a0ff;
    border: none;
}

.badge-brand { background: var(--brand-soft); color: #b4a0ff; }
.badge-accent { background: var(--accent-soft); color: #66d9ff; }
.badge-neutral { background: rgba(255, 255, 255, 0.06); color: var(--text-secondary); }
.badge-success { background: rgba(52, 211, 153, 0.12); color: #34d399; }
.badge-warning { background: rgba(251, 191, 36, 0.12); color: #fbbf24; }
.badge-danger { background: rgba(248, 113, 113, 0.12); color: #f87171; }
.badge-row { display: flex; gap: 8px; flex-wrap: wrap; }

/* ==========================================================================
   9. Form System
   ========================================================================== */

.form-input, .input {
    width: 100%;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 12px 16px;
    color: var(--text-primary);
    font-size: 14px;
    transition: all var(--ease-fast);
}
.form-input:focus, .input:focus {
    background: rgba(255, 255, 255, 0.06);
    border-color: var(--brand);
    box-shadow: 0 0 0 3px var(--brand-soft);
}
.form-input::placeholder, .input::placeholder { color: var(--text-tertiary); }
.input-lg { padding: 16px 20px; font-size: 16px; }

/* ==========================================================================
   10. Header & Navigation (class names preserved for navbar.php)
   ========================================================================== */

.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(8, 8, 12, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
}

/* Legacy global-header compat */
header.global-header {
    position: sticky; top: 0; z-index: 1000;
    background: rgba(8, 8, 12, 0.8);
    backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
}

.header-wrap {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
    padding: 0;
}

.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 64px;
}

.logo-wrapper { display: flex; align-items: center; gap: 10px; }
.logo-wrapper img { height: 32px; width: auto; }
.logo-wrapper span { font-size: 1.2rem; font-weight: 800; letter-spacing: -0.04em; color: #fff; }

.nav-links { display: flex; gap: var(--sp-8); list-style: none; }
.nav-links a { font-size: 14px; font-weight: 500; color: var(--text-secondary); }
.nav-links a:hover, .nav-links a.active { color: var(--text-primary); }

.header-actions { display: flex; align-items: center; gap: var(--sp-4); }
.search-toggle {
    display: flex; align-items: center; gap: 8px;
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--border);
    padding: 8px 16px;
    border-radius: var(--radius-pill);
    color: var(--text-secondary);
    font-size: 14px;
    cursor: text;
    transition: all var(--ease-fast);
}
.search-toggle:focus-within { border-color: var(--brand); background: rgba(255,255,255,0.06); }
.search-toggle input { background: transparent; color: var(--text-primary); width: 120px; transition: width 0.3s; }
.search-toggle input:focus { width: 200px; }
.search-toggle input::placeholder { color: var(--text-tertiary); }

/* ==========================================================================
   11. Footer (class names preserved for footer.php)
   ========================================================================== */

.global-footer, footer.global-footer {
    background: transparent;
    border-top: 1px solid var(--border);
    padding: 64px 0 32px;
    color: var(--text-secondary);
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 48px;
    margin-bottom: 48px;
}

.footer-brand { display: flex; flex-direction: column; }
.footer-brand .logo-wrapper {
    display: inline-flex; align-items: center; gap: 10px;
    text-decoration: none; color: #fff; margin-bottom: 16px;
}
.footer-brand .logo-wrapper img { height: 18px; width: auto; }
.footer-brand .logo-wrapper span { font-size: 1.1rem; font-weight: 800; letter-spacing: -0.04em; }
.footer-brand p { color: var(--text-tertiary); font-size: 14px; line-height: 1.6; max-width: 280px; }

.footer-nav h4 {
    font-size: 13px; font-weight: 600; color: var(--text-tertiary);
    margin-bottom: 20px; text-transform: uppercase; letter-spacing: 0.08em;
}
.footer-nav ul { list-style: none; display: flex; flex-direction: column; gap: 12px; }
.footer-nav a { color: var(--text-secondary); font-size: 14px; transition: color var(--ease-fast); }
.footer-nav a:hover { color: var(--text-primary); }

.footer-bottom {
    display: flex; justify-content: space-between; align-items: center;
    padding-top: 32px; border-top: 1px solid var(--border);
    font-size: 13px; color: var(--text-tertiary);
}
.copyright-text { display: flex; gap: 16px; align-items: center; }
.built-for { color: var(--text-tertiary); }

.footer-social { display: flex; gap: 16px; align-items: center; }
.footer-social a { color: var(--text-tertiary); transition: color var(--ease-fast); display: flex; align-items: center; }
.footer-social a:hover { color: var(--text-primary); }
.footer-social svg { width: 18px; height: 18px; fill: currentColor; }

/* ==========================================================================
   12. Hero & Banner Components
   ========================================================================== */

.hero-banner {
    padding: 80px 40px;
    border-radius: var(--radius-xl);
    background: linear-gradient(135deg, var(--bg-elevated), #0d1520);
    text-align: center;
}
.hero-banner.research {
    background: radial-gradient(ellipse at top, rgba(0, 194, 255, 0.1) 0%, transparent 60%);
    padding: 100px 20px;
}

.hero-detail {
    padding: 48px; border-radius: var(--radius-xl);
    background: var(--bg-elevated); border: 1px solid var(--border);
    position: relative; overflow: hidden;
    display: flex; align-items: center; gap: 40px; flex-wrap: wrap;
}
.hero-detail .bg-glow {
    position: absolute; inset: 0;
    background: radial-gradient(circle at top right, var(--brand-soft) 0%, transparent 60%);
    pointer-events: none;
}
.hero-logo {
    width: 120px; height: 120px; border-radius: var(--radius-xl); object-fit: cover;
    background: var(--surface); border: 1px solid var(--border);
    display: flex; align-items: center; justify-content: center;
    font-size: 48px; flex-shrink: 0; z-index: 1;
}
.hero-content { flex: 1; min-width: 280px; z-index: 1; }

/* ==========================================================================
   13. Sidebar & Detail Components
   ========================================================================== */

.sidebar-sticky {
    display: flex; flex-direction: column; gap: 24px;
    position: sticky; top: 88px; height: fit-content;
}

.fact-row {
    display: flex; justify-content: space-between;
    padding: 12px 0; border-bottom: 1px solid var(--border);
    font-size: 14px;
}
.fact-row:last-child { border-bottom: none; }
.fact-label { color: var(--text-secondary); font-weight: 500; }
.fact-value { color: var(--text-primary); font-weight: 600; }

.related-row {
    padding: 16px 20px;
    display: flex; align-items: center; justify-content: space-between;
    background: transparent; text-decoration: none;
    transition: background var(--ease-fast);
    border-radius: var(--radius-sm);
}
.related-row:hover { background: var(--surface); }

/* ==========================================================================
   14. Item Cards (Tools, Prompts)
   ========================================================================== */

.item-card {
    display: flex; flex-direction: column; position: relative;
    padding: 28px; border-radius: var(--radius-xl);
}
.item-card-logo {
    width: 56px; height: 56px; border-radius: var(--radius-md); object-fit: cover;
    background: var(--surface); border: 1px solid var(--border);
    display: flex; align-items: center; justify-content: center; font-size: 22px;
}
.item-card-featured {
    position: absolute; top: 16px; right: 16px;
    background: linear-gradient(135deg, #f59e0b, #fbbf24); color: #fff;
    font-size: 11px; font-weight: 700; padding: 4px 12px; border-radius: var(--radius-pill);
    text-transform: uppercase; letter-spacing: 0.06em;
}

/* ==========================================================================
   15. Research Cards
   ========================================================================== */

.research-card {
    padding: 0; display: flex; flex-direction: column; overflow: hidden;
    background: var(--bg-elevated); text-decoration: none;
}
.research-card-img-wrap {
    position: relative; aspect-ratio: 16/9; overflow: hidden; background: var(--surface);
}
.research-card-img-wrap img {
    width: 100%; height: 100%; object-fit: cover;
    transition: transform 600ms var(--ease-spring);
}
.research-card:hover .research-card-img-wrap img { transform: scale(1.03); }
.research-card-content {
    padding: 24px; display: flex; flex-direction: column; flex-grow: 1;
}
.research-card-meta {
    display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px;
    font-size: 12px; font-weight: 600; color: var(--text-tertiary);
    text-transform: uppercase; letter-spacing: 0.06em;
}

/* ==========================================================================
   16. Feature Lists & Blocks
   ========================================================================== */

.feature-list { list-style: none; display: grid; gap: 10px; padding: 0; }
.feature-item {
    padding: 14px 18px; border-radius: var(--radius-md);
    display: flex; align-items: center; gap: 14px;
    font-weight: 500; font-size: 14px;
    background: rgba(255,255,255,0.02); border: 1px solid var(--border);
    transition: background var(--ease-fast);
}
.feature-item:hover { background: rgba(255,255,255,0.04); }
.icon-box {
    width: 32px; height: 32px; border-radius: var(--radius-sm);
    display: flex; align-items: center; justify-content: center; font-size: 14px;
    background: var(--brand-soft);
}

/* ==========================================================================
   17. Article & Content
   ========================================================================== */

.article-section {
    padding-bottom: 16px; border-bottom: 1px solid var(--border); margin-bottom: 24px;
}
.article-body {
    font-size: 17px; line-height: 1.8; color: var(--text-secondary);
}
.article-body h2, .article-body h3 { color: var(--text-primary); margin-top: 32px; margin-bottom: 16px; }
.article-body p { margin-bottom: 20px; }
.article-body a { color: var(--brand); text-decoration: underline; text-underline-offset: 3px; }

.rich-text-content {
    font-family: 'Inter', sans-serif;
    letter-spacing: 0.01em;
    line-height: 1.8;
}

/* ==========================================================================
   18. Ecosystem & Knowledge Blocks
   ========================================================================== */

.ecosystem-block {
    background: linear-gradient(135deg, var(--brand-soft), var(--accent-soft));
    border: 1px solid rgba(124, 92, 255, 0.1);
    padding: 32px; border-radius: var(--radius-lg);
}
.knowledge-block {
    margin-bottom: 24px; padding: 28px;
    background: var(--bg-elevated); border: 1px solid var(--border);
    border-radius: var(--radius-lg);
}
.knowledge-header { margin-bottom: 16px; display: flex; align-items: center; gap: 12px; }
.knowledge-icon {
    width: 40px; height: 40px; border-radius: var(--radius-md);
    display: inline-flex; align-items: center; justify-content: center; font-size: 20px;
    background: var(--brand-soft);
}

/* ==========================================================================
   19. Related Content & Internal Linking
   ========================================================================== */

.related-content-box {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-top: 32px;
}
.related-content-box h4 {
    margin-bottom: 16px; color: var(--text-tertiary);
    font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em; font-weight: 600;
}
.related-list { list-style: none; padding: 0; }
.related-list li { margin-bottom: 8px; }
.related-list a { color: var(--text-secondary); font-size: 14px; transition: color var(--ease-fast); }
.related-list a:hover { color: var(--text-primary); }

/* ==========================================================================
   20. Empty States
   ========================================================================== */

.empty-state {
    text-align: center;
    padding: var(--sp-16) var(--sp-8);
    background: rgba(255, 255, 255, 0.02);
    border: 1px dashed var(--border-hover);
    border-radius: var(--radius-lg);
}
.empty-state .icon { font-size: 3rem; margin-bottom: var(--sp-4); opacity: 0.4; }
.empty-state h3 { margin-bottom: var(--sp-2); color: var(--text-primary); }
.empty-state p { max-width: 400px; margin: 0 auto; color: var(--text-secondary); font-size: 14px; }

/* ==========================================================================
   21. Utility Classes
   ========================================================================== */

.text-center { text-align: center; }
.text-right { text-align: right; }
.flex { display: flex; }
.flex-col { display: flex; flex-direction: column; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.gap-sm { gap: 8px; }
.gap-md { gap: 16px; }
.gap-lg { gap: 24px; }
.gap-xl { gap: 32px; }
.mt-section { margin-top: var(--sp-section); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }

/* ==========================================================================
   22. Animations
   ========================================================================== */

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}
.animate-in { animation: fadeIn 0.5s ease forwards; }

/* ==========================================================================
   23. Scrollbar
   ========================================================================== */

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--surface); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--brand); }
* { scrollbar-width: thin; scrollbar-color: var(--surface) var(--bg); }

/* ==========================================================================
   24. Responsive
   ========================================================================== */

@media (max-width: 1024px) {
    .grid-sidebar-layout { grid-template-columns: 1fr; }
    .grid-3 { grid-template-columns: repeat(2, 1fr); }
    .grid-4 { grid-template-columns: repeat(2, 1fr); }
    .footer-grid { grid-template-columns: 1fr 1fr; gap: 40px; }
    .search-toggle input:focus { width: 140px; }
    .hero-detail { padding: 32px; }
}

@media (max-width: 768px) {
    :root { --container-max: 100%; }
    .container { padding: 0 20px; }

    .nav-links { display: none; }
    .header-actions .search-toggle { display: none; }

    .grid-2 { grid-template-columns: 1fr; }
    .grid-3 { grid-template-columns: 1fr; }
    .grid-4 { grid-template-columns: 1fr; }
    .grid-sidebar-layout { grid-template-columns: 1fr; gap: 32px; }

    .footer-grid {
        grid-template-columns: 1fr;
        gap: 32px; margin-bottom: 32px;
    }
    .footer-brand { text-align: center; align-items: center; }
    .footer-brand p { text-align: center; max-width: 100%; }
    .footer-nav h4 { margin-bottom: 12px; }
    .footer-bottom { flex-direction: column; gap: 20px; text-align: center; }
    .copyright-text { flex-direction: column; gap: 4px; }

    .display-hero { font-size: 2.2rem; }
    .display-xl { font-size: 2.5rem; }
    .heading-1 { font-size: 1.75rem; }

    .hero-banner { padding: 48px 24px; border-radius: var(--radius-lg); }
    .hero-detail { padding: 24px; flex-direction: column; }
    .hero-logo { width: 80px; height: 80px; font-size: 32px; }

    .section-header { flex-direction: column; align-items: flex-start; gap: 12px; }
}

@media (max-width: 640px) {
    .container { padding: 0 16px; }
    .grid-cards { grid-template-columns: 1fr; }
    .card-body { padding: 20px; }
    .item-card { padding: 20px; }
}

/* ==========================================================================
   25. New Design System Components (Sprint 44)
   ========================================================================== */

/* Cards & Panels */
.glass-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-xl);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    transition: all var(--ease-spring);
    padding: var(--sp-6);
}
.glass-card:hover {
    border-color: var(--border-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.panel {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--sp-6);
}

.metric-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: var(--sp-4);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}
.metric-card-value {
    font-size: 28px;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: var(--sp-1);
}
.metric-card-label {
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-tertiary);
    font-weight: 600;
}

/* Headers */
.page-header {
    margin-bottom: var(--sp-10);
    text-align: center;
}
.page-header h1 {
    font-size: clamp(32px, 5vw, 56px);
    margin-bottom: var(--sp-4);
}
.page-header p {
    color: var(--text-secondary);
    font-size: 18px;
    max-width: 600px;
    margin: 0 auto;
}

/* Status Chips & Badges */
.status-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: var(--radius-pill);
    font-size: 13px;
    font-weight: 600;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-primary);
}
.status-chip-success {
    border-color: rgba(52, 211, 153, 0.3);
    background: rgba(52, 211, 153, 0.1);
    color: #34d399;
}
.status-chip-warning {
    border-color: rgba(251, 191, 36, 0.3);
    background: rgba(251, 191, 36, 0.1);
    color: #fbbf24;
}

/* Forms & Inputs */
.search-bar {
    display: flex;
    gap: var(--sp-2);
    max-width: 500px;
    margin: 0 auto;
}
.search-bar input {
    flex: 1;
    padding: 14px 20px;
    border-radius: var(--radius-pill);
    border: 1px solid var(--border-strong);
    background: rgba(0,0,0,0.5);
    color: var(--text-primary);
    transition: all var(--ease-fast);
}
.search-bar input:focus {
    border-color: var(--brand);
    background: rgba(0,0,0,0.8);
    box-shadow: 0 0 0 3px var(--brand-soft);
}
.filter-bar {
    display: flex;
    gap: var(--sp-3);
    overflow-x: auto;
    padding-bottom: var(--sp-2);
    margin-bottom: var(--sp-6);
}

/* Hero Sections */
.hero-section {
    padding-top: var(--sp-20);
    padding-bottom: var(--sp-10);
    border-bottom: 1px solid var(--border);
}
.hero-section-primary {
    background: linear-gradient(180deg, var(--brand-glow) 0%, var(--bg) 100%);
}
.hero-section-accent {
    background: linear-gradient(180deg, var(--accent-glow) 0%, var(--bg) 100%);
}
.hero-section-warning {
    background: linear-gradient(180deg, rgba(234, 179, 8, 0.1) 0%, var(--bg) 100%);
}
.hero-section-purple {
    background: linear-gradient(180deg, rgba(168, 85, 247, 0.1) 0%, var(--bg) 100%);
}

/* Loading States */
.loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--sp-12);
    color: var(--text-secondary);
}
.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border);
    border-top-color: var(--brand);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: var(--sp-4);
}
@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Profile / Entity Layouts */
.entity-header-wrapper {
    display: flex;
    gap: var(--sp-10);
    align-items: flex-start;
    flex-wrap: wrap;
    margin-bottom: var(--sp-6);
}
.entity-avatar {
    width: 120px;
    height: 120px;
    border-radius: var(--radius-2xl);
    overflow: hidden;
    border: 1px solid var(--border-strong);
    background: rgba(255,255,255,0.05);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
}
.entity-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.entity-avatar-lg {
    width: 200px;
    height: 200px;
}
.entity-details {
    flex-grow: 1;
    max-width: 800px;
}

/* Tables (Responsive wrapper) */
.table-responsive {
    overflow-x: auto;
    width: 100%;
    -webkit-overflow-scrolling: touch;
}

/* Timeline */
.timeline-container {
    border-left: 2px solid var(--border-strong);
    padding-left: 30px;
    margin-left: 20px;
}
.timeline-event {
    position: relative;
    margin-bottom: 40px;
}
.timeline-dot {
    position: absolute;
    left: -41px;
    top: 4px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 4px solid var(--bg);
    background: var(--brand);
}
.timeline-date {
    font-size: 14px;
    font-weight: 600;
    color: var(--brand);
    margin-bottom: 4px;
}
.timeline-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}
.timeline-desc {
    font-size: 15px;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* Animations */
.hover-lift {
    transition: transform var(--ease-spring), box-shadow var(--ease-spring);
}
.hover-lift:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}
.hover-glow:hover {
    box-shadow: 0 0 20px var(--brand-glow);
}

/* Milestone 2 Cleanup - Semantic Classes */
.course-section-title { font-size: 24px; margin-bottom: 20px; }
.course-materials-grid { display: flex; flex-wrap: wrap; gap: 12px; }
.course-material-card { display: flex; align-items: center; gap: 10px; padding: 12px 20px; background: rgba(124, 92, 255, 0.1); border: 1px solid rgba(124, 92, 255, 0.2); border-radius: 8px; text-decoration: none; color: #fff; }
.course-material-card-text { font-weight: 600; font-size: 14px; }

.course-curriculum-container { margin-top: 40px; }
.course-curriculum-box { background: rgba(255,255,255,0.02); border: 1px solid rgba(255,255,255,0.05); border-radius: 16px; padding: 20px; }
.course-module-group { display: flex; flex-direction: column; gap: 20px; }
.course-module-title { font-size: 18px; margin-bottom: 12px; color: var(--text-primary); font-weight: 600; padding-left: 8px; border-left: 3px solid var(--brand); }
.course-lesson-list { display: flex; flex-direction: column; gap: 8px; }
.course-lesson-item { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; background: rgba(0,0,0,0.2); border: 1px solid rgba(255,255,255,0.03); border-radius: 8px; text-decoration: none; transition: all 0.2s; }
.course-lesson-item:hover { background: rgba(255,255,255,0.05); border-color: rgba(124,92,255,0.3); }
.course-lesson-item-left { display: flex; align-items: center; gap: 16px; }
.course-lesson-item-num { width: 32px; height: 32px; border-radius: 50%; background: rgba(255,255,255,0.08); display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; color: #fff; }
.course-lesson-item-title { font-weight: 600; color: #fff; font-size: 15px; }
.course-lesson-item-preview { background: rgba(124,92,255,0.15); color: #b4a0ff; padding: 2px 8px; border-radius: 4px; font-size: 11px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; }
.course-lesson-item-right { color: #888; font-size: 13px; font-weight: 600; display: flex; align-items: center; gap: 6px; }

.related-content-box { margin-top: 60px; padding: 30px; background: rgba(255,255,255,0.02); border: 1px solid rgba(255,255,255,0.05); border-radius: 16px; }
.related-content-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 20px; }

.course-breadcrumb { margin-bottom: 24px; font-size: 14px; font-weight: 600; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.course-breadcrumb-link { color: var(--text-tertiary); text-decoration: none; }
.course-breadcrumb-separator { color: var(--border); }
.course-breadcrumb-current { color: var(--text-primary); }

.lesson-nav-container { display: flex; justify-content: space-between; align-items: center; margin-top: 60px; padding-top: 30px; border-top: 1px solid rgba(255,255,255,0.1); flex-wrap: wrap; gap: 20px; }
.lesson-nav-buttons { display: flex; gap: 15px; flex-wrap: wrap; }
.btn-outline-secondary { border: 1px solid rgba(255,255,255,0.1); background: transparent; padding: 10px 20px; border-radius: 8px; color: #fff; text-decoration: none; }
.btn-outline-secondary:hover { background: rgba(255,255,255,0.05); }
.btn-outline-primary { border: 1px solid rgba(255,255,255,0.1); background: rgba(255,255,255,0.05); padding: 10px 20px; border-radius: 8px; color: #fff; text-decoration: none; }
.btn-outline-primary:hover { background: rgba(255,255,255,0.1); }
.btn-solid-premium { padding: 10px 20px; border-radius: 8px; text-decoration: none; font-weight: 600; background: linear-gradient(135deg, #7c5cff, #00c2ff); color: #fff; }
.btn-solid-primary { background: var(--brand); color: #fff; padding: 10px 20px; border-radius: 8px; text-decoration: none; font-weight: 600; }
