/* =========================================
   PSI Kyiv STEM Student Portal
   Brand-compliant styles from PSI-Kyiv-Brand-Book
   ========================================= */

/* =========================================
   FONT DECLARATIONS
   ========================================= */
@font-face {
    font-family: 'Navigo';
    src: local('Navigo'), local('navigo');
    font-weight: 400;
    font-style: normal;
}
@font-face {
    font-family: 'Navigo';
    src: local('Navigo SemiBold'), local('navigo-semibold');
    font-weight: 600;
    font-style: normal;
}
@font-face {
    font-family: 'Navigo';
    src: local('Navigo Bold'), local('navigo-bold');
    font-weight: 700;
    font-style: normal;
}
@font-face {
    font-family: 'Navigo';
    src: local('Navigo ExtraBold'), local('navigo-extrabold');
    font-weight: 800;
    font-style: normal;
}

/* =========================================
   CSS CUSTOM PROPERTIES
   ========================================= */
:root {
    /* Primary Brand Colors */
    --primary-blue: #003DA5;
    --dark-blue: #001452;
    --mint: #AFDFE0;

    /* Secondary Colors - Purples */
    --purple-extra-dark: #291849;
    --purple-medium: #63539D;
    --purple-light: #A18DBE;

    /* Secondary Colors - Tomato Reds */
    --tomato-dark: #69270A;
    --tomato-medium: #E1633B;
    --tomato-light: #EB9B73;

    /* Secondary Colors - Pinks */
    --pink-violet: #843648;
    --pink: #F0B8B4;
    --pink-misty: #F8E1DE;

    /* Secondary Colors - Warm */
    --chocolate: #321800;
    --orange: #EA903D;
    --amber: #FACC46;

    /* Digital Colors */
    --digital-dark: #020D2A;
    --digital-key1: #012FD7;
    --digital-key2: #000871;
    --digital-light: #EEEFF1;
    --digital-blue-2: #2C65F6;
    --digital-blue-3: #43AFFC;
    --digital-blue-4: #A2D5FE;
    --digital-blue-5: #E0E9F1;
    --digital-yellow: #F9DD17;

    /* Typography */
    --font-primary: 'Navigo', -apple-system, system-ui, 'Helvetica Neue', 'Calibri Light', 'Roboto', sans-serif;
    --font-accent: 'Lora', Georgia, serif;

    /* Spacing */
    --section-padding: 120px;
    --container-max: 1200px;

    /* Shadows */
    --shadow-large: 0px 8px 56px rgba(17,17,26,0.1), 0px 32px 140px rgba(17,17,26,0.1);
    --shadow-small: 0px 1px 4px rgba(17,17,26,0.05), 0px 0px 8px rgba(17,17,26,0.05);
    --shadow-card: 0 2px 12px rgba(0,20,82,0.08);
    --shadow-lg: 0 8px 24px rgba(0,20,82,0.12);
    --shadow: 0 2px 8px rgba(0,20,82,0.08);

    /* Semantic tokens */
    --surface: #f4f6fa;
    --border: #dee2e8;
    --text: #1a1a2e;
    --text-muted: #6c757d;
    --radius: 8px;
    --transition: 0.2s ease;

    /* Font alias */
    --font-body: var(--font-primary);
}

/* =========================================
   RESET & BASE STYLES
   ========================================= */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }

body {
    font-family: var(--font-primary);
    font-weight: 400;
    line-height: 1.5;
    color: var(--digital-dark);
    background: #ffffff;
    overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-primary);
    line-height: 1.2;
    font-weight: 700;
    margin-bottom: 1rem;
}

h1 { font-size: 3.5rem; font-weight: 800; }
h2 { font-size: 2.5rem; }
h3 { font-size: 2rem; }
h4 { font-size: 1.5rem; }
h5 { font-size: 1.25rem; }
h6 { font-size: 1rem; }

p { margin-bottom: 1rem; }

a {
    color: var(--digital-key1);
    text-decoration: none;
    transition: all 200ms ease;
}

a:hover {
    color: var(--primary-blue);
}

/* Prevent generic a:hover from overriding button text colors */
a.btn:hover,
a.btn-solid:hover,
a.btn-primary:hover {
    color: inherit;
}
a.btn-solid:hover {
    color: #fff;
}

img { max-width: 100%; height: auto; display: block; }

.container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 1.5rem;
}

@media (min-width: 768px) {
    .container { padding: 0 2rem; }
}

@media (min-width: 1200px) {
    .container { padding: 0; }
}

/* =========================================
   NAVIGATION (from Brand Book)
   ========================================= */
.nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(0, 20, 82, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    z-index: 1000;
    padding: 1rem 2rem;
    box-shadow: var(--shadow-small);
}

.nav-container {
    max-width: var(--container-max);
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: white;
    font-weight: 700;
    font-size: 1.1rem;
}

.nav-brand:hover { color: var(--mint); }

.nav-logo {
    height: 40px;
    width: auto;
}

.nav-logo-invert {
    filter: brightness(0) invert(1);
}

.nav-brand-text { color: white; }

.nav-links {
    display: flex;
    gap: 2rem;
    list-style: none;
    align-items: center;
}

.nav-links a {
    color: white;
    font-size: 0.9rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 200ms ease;
}

.nav-links a:hover {
    color: var(--mint);
    transform: translateY(-2px);
}

.nav-login-btn {
    background: var(--primary-blue) !important;
    color: white !important;
    padding: 0.5rem 1.5rem !important;
    border-radius: 8px;
}

.nav-login-btn:hover {
    background: var(--digital-key1) !important;
    transform: scale(1.05) !important;
}

.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
}

.nav-toggle span {
    width: 24px;
    height: 2px;
    background: white;
    border-radius: 2px;
    transition: all 200ms;
}

/* =========================================
   HERO / COVER SECTION (from Brand Book)
   ========================================= */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    background: linear-gradient(135deg, rgba(0,61,165,0.75) 0%, rgba(0,20,82,0.8) 50%, rgba(41,24,73,0.85) 100%);
    color: white;
    text-align: center;
    padding: 8rem 2rem 4rem;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 20% 50%, rgba(175,223,224,0.15) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(99,83,157,0.15) 0%, transparent 50%);
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 900px;
    text-align: center;
    animation: fadeInUp 1.2s ease-out;
}

.hero-badge {
    width: 160px;
    height: auto;
    margin: 0 auto 2rem;
    display: block;
}

.hero-logo {
    width: 200px;
    height: auto;
    margin: 0 auto 3rem;
    display: block;
    animation: pulse 3s ease-in-out infinite;
}

.hero h1 {
    font-size: 4.5rem;
    font-weight: 800;
    color: white;
    margin-bottom: 1rem;
    text-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

.hero-subtitle {
    font-size: 1.5rem;
    color: rgba(255,255,255,0.9);
    margin-bottom: 1rem;
}

.hero-tagline {
    font-family: var(--font-accent);
    font-style: italic;
    font-size: 2rem;
    color: var(--mint);
    margin: 2rem 0;
    text-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

.hero p {
    font-size: 1.1rem;
    color: rgba(255,255,255,0.8);
    margin-bottom: 2rem;
    line-height: 1.7;
}

.hero-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 2rem;
}

.hero-scroll {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    color: white;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    animation: bounce 2s ease-in-out infinite;
}

/* =========================================
   GATEWAY - Non-authenticated landing (Moodle-style)
   ========================================= */
.gateway {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(0,61,165,0.75) 0%, rgba(0,20,82,0.8) 50%, rgba(41,24,73,0.85) 100%);
    position: relative;
    overflow: hidden;
}

.gateway::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 20% 50%, rgba(175,223,224,0.15) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(99,83,157,0.15) 0%, transparent 50%);
}

.gateway-content {
    position: relative;
    z-index: 2;
    text-align: center;
    max-width: 480px;
    padding: 2rem;
    animation: fadeInUp 1.2s ease-out;
}

.gateway-logo {
    width: 140px;
    height: auto;
    margin: 0 auto 2rem;
    animation: pulse 3s ease-in-out infinite;
}

.gateway-title {
    font-size: 2rem;
    font-weight: 800;
    color: white;
    margin-bottom: 0.25rem;
}

.gateway-subtitle {
    font-size: 1.1rem;
    color: rgba(255,255,255,0.7);
    margin-bottom: 0.5rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.gateway-tagline {
    font-family: var(--font-accent);
    font-style: italic;
    font-size: 1.4rem;
    color: var(--mint);
    margin-bottom: 3rem;
    text-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

.gateway-login {
    background: rgba(255,255,255,0.08);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 16px;
    padding: 2.5rem 2rem;
    margin-bottom: 2rem;
}

.gateway-login h2 {
    font-size: 1.3rem;
    color: white;
    margin-bottom: 0.5rem;
}

.gateway-login p {
    font-size: 0.9rem;
    color: rgba(255,255,255,0.7);
    margin-bottom: 1.5rem;
}

.gateway-login .btn-lg {
    padding: 1rem 2.5rem;
    font-size: 1.05rem;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gateway-footer {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
}

.gateway-footer a {
    color: rgba(255,255,255,0.6);
    font-size: 0.85rem;
    font-weight: 500;
}

.gateway-footer a:hover {
    color: var(--mint);
}

.gateway-footer span {
    color: rgba(255,255,255,0.3);
}

/* =========================================
   COMPACT HERO - Authenticated users
   ========================================= */
.hero-compact {
    min-height: auto;
    padding: 8rem 2rem 3rem;
}

.hero-compact .hero-content {
    max-width: 700px;
}

.hero-compact h1 {
    font-size: 2.5rem;
}

/* =========================================
   QUICK LINKS GRID - Authenticated dashboard
   ========================================= */
.quick-links-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    max-width: var(--container-max);
    margin: 0 auto;
}

.quick-link-card {
    background: white;
    border-radius: 8px;
    padding: 1.5rem;
    text-align: center;
    box-shadow: var(--shadow-small);
    transition: all 300ms ease;
    color: var(--dark-blue);
    text-decoration: none;
}

.quick-link-card:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: var(--shadow-large);
    color: var(--primary-blue);
}

.quick-link-card svg {
    margin: 0 auto 0.75rem;
    color: var(--primary-blue);
}

.quick-link-card h4 {
    font-size: 1rem;
    margin-bottom: 0.25rem;
}

.quick-link-card p {
    font-size: 0.85rem;
    color: #666;
    margin: 0;
}

@media (max-width: 992px) {
    .quick-links-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .gateway-title {
        font-size: 1.5rem;
    }

    .gateway-tagline {
        font-size: 1.1rem;
    }

    .gateway-login {
        padding: 1.5rem;
    }

    .hero-compact {
        padding: 6rem 1.5rem 2rem;
    }

    .hero-compact h1 {
        font-size: 1.8rem;
    }

    .quick-links-grid {
        grid-template-columns: 1fr 1fr;
        gap: 1rem;
    }

    .quick-link-card {
        padding: 1.25rem 1rem;
    }
}

/* =========================================
   BUTTONS (from Brand Book)
   ========================================= */
.btn {
    display: inline-block;
    padding: 0.875rem 2rem;
    font-family: var(--font-primary);
    font-size: 1rem;
    font-weight: 600;
    text-align: center;
    cursor: pointer;
    transition: all 200ms ease;
    border: 2px solid transparent;
    text-decoration: none;
}

.btn:hover {
    transform: scale(1.05);
}

.btn:active {
    transform: scale(1.02);
}

/* Brand button variants */
.btn-solid {
    background: var(--primary-blue);
    color: white;
}

.btn-solid:hover,
.btn-solid:focus {
    background: var(--dark-blue);
    color: #fff;
}

.btn-outline {
    background: transparent;
    color: var(--primary-blue);
    border-color: var(--primary-blue);
}

.btn-transparent {
    background: transparent;
    color: var(--primary-blue);
    text-decoration: underline;
}

/* Border radius variants */
.btn-sharp { border-radius: 0; }
.btn-soft { border-radius: 4px; }
.btn-rounded { border-radius: 8px; }
.btn-pill { border-radius: 100px; }

/* Portal-specific button styles */
.btn-primary {
    background: var(--mint);
    color: var(--dark-blue);
    border-radius: 8px;
}

.btn-primary:hover {
    background: white;
    color: var(--dark-blue);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.2);
}

.btn-secondary {
    background: transparent;
    color: white;
    border-color: rgba(255,255,255,0.4);
    border-radius: 8px;
}

.btn-secondary:hover {
    border-color: var(--mint);
    color: var(--mint);
    transform: translateY(-2px);
}

/* =========================================
   SECTION STYLES (from Brand Book)
   ========================================= */
.section {
    padding: var(--section-padding) 2rem;
    position: relative;
}

.section-alt {
    background: var(--digital-light);
}

.section-dark {
    background: var(--dark-blue);
    color: white;
}

.section-gradient {
    background: linear-gradient(to bottom, rgba(0,20,82,0.65), rgba(0,20,82,0.92));
    color: white;
}

.section-header {
    text-align: center;
    margin-bottom: 4rem;
}

.section-label {
    font-size: 0.9rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--primary-blue);
    margin-bottom: 1rem;
}

.section-dark .section-label,
.section-gradient .section-label {
    color: var(--mint);
}

.section-title {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 1.5rem;
}

.section-description {
    font-size: 1.2rem;
    color: #666;
    max-width: 700px;
    margin: 0 auto;
}

.section-dark .section-description,
.section-gradient .section-description {
    color: rgba(255,255,255,0.8);
}

/* Backwards compat with simpler section headers */
.section-header h2 {
    font-size: 3rem;
    font-weight: 800;
    color: var(--dark-blue);
    margin-bottom: 1.5rem;
}

.section-dark .section-header h2 {
    color: white;
}

.section-header p {
    font-size: 1.2rem;
    color: #666;
    max-width: 700px;
    margin: 0 auto;
}

.section-dark .section-header p {
    color: rgba(255,255,255,0.8);
}

/* =========================================
   SERVICE CARDS (value-card pattern from Brand Book)
   ========================================= */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2rem;
    max-width: var(--container-max);
    margin: 0 auto;
}

.service-card {
    background: white;
    padding: 2.5rem;
    border-radius: 8px;
    box-shadow: var(--shadow-small);
    transition: all 300ms ease;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.service-card:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: var(--shadow-large);
}

.service-card-icon {
    width: 72px;
    height: 72px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    margin-bottom: 1.5rem;
    color: white;
}

.service-card h3 {
    font-size: 1.4rem;
    color: var(--dark-blue);
    margin-bottom: 0.75rem;
}

.service-card p {
    color: #555;
    font-size: 1.05rem;
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

.service-card .btn {
    margin-top: auto;
    font-size: 0.9rem;
    padding: 0.6rem 1.5rem;
}

/* =========================================
   ANNOUNCEMENTS
   ========================================= */
.announcements-list {
    max-width: 800px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.announcement-item {
    background: white;
    border-radius: 8px;
    padding: 1.5rem 2rem;
    box-shadow: var(--shadow-small);
    border-left: 4px solid var(--primary-blue);
    transition: all 300ms ease;
}

.announcement-item:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-large);
}

.announcement-item.pinned {
    border-left-color: var(--amber);
}

.announcement-item h3 {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    color: var(--dark-blue);
}

.announcement-item h3 a {
    color: var(--dark-blue);
}

.announcement-item h3 a:hover {
    color: var(--primary-blue);
}

.announcement-date {
    font-size: 0.85rem;
    color: #999;
    margin-bottom: 0.5rem;
}

.announcement-body {
    color: #555;
    font-size: 0.95rem;
}

.pinned-badge {
    display: inline-block;
    background: var(--amber);
    color: var(--dark-blue);
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.25rem 0.625rem;
    border-radius: 100px;
    margin-left: 0.5rem;
    vertical-align: middle;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* =========================================
   CONTENT PAGES
   ========================================= */
.page-header {
    background: linear-gradient(135deg, var(--dark-blue) 0%, var(--digital-key2) 100%);
    color: white;
    padding: 140px 2rem 80px;
    text-align: center;
    position: relative;
}

.page-header::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 30% 40%, rgba(175,223,224,0.1) 0%, transparent 50%),
        radial-gradient(circle at 70% 60%, rgba(1,47,215,0.1) 0%, transparent 50%);
}

.page-header h1 {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    position: relative;
}

.page-header p {
    font-size: 1.2rem;
    color: rgba(255,255,255,0.8);
    position: relative;
}

.page-content {
    max-width: 900px;
    margin: 0 auto;
    padding: 3rem 2rem;
}

.page-content h2 { font-size: 1.8rem; margin-top: 2.5rem; color: var(--dark-blue); font-weight: 800; }
.page-content h3 { font-size: 1.4rem; margin-top: 1.5rem; color: var(--dark-blue); }
.page-content p { margin-bottom: 1rem; line-height: 1.7; }
.page-content ul, .page-content ol { margin-bottom: 1rem; padding-left: 1.5rem; }
.page-content li { margin-bottom: 0.25rem; }
.page-content img { border-radius: 8px; margin: 1.5rem 0; box-shadow: var(--shadow-small); }

/* Code blocks (from Brand Book .code-block) */
.page-content pre,
.page-content code {
    font-family: 'Monaco', 'Menlo', 'Courier New', monospace;
}

.page-content pre {
    background: var(--digital-dark);
    color: var(--mint);
    padding: 2rem;
    border-radius: 8px;
    font-size: 0.9rem;
    line-height: 1.6;
    overflow-x: auto;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-large);
}

.page-content code {
    background: var(--digital-dark);
    color: var(--mint);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.9rem;
}

/* =========================================
   MANUALS / VIDEOS INDEX (demo-card pattern)
   ========================================= */
.content-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
}

.content-card {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow-small);
    transition: transform 300ms ease, box-shadow 300ms ease;
}

.content-card:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: var(--shadow-large);
}

.content-card-body {
    padding: 1.5rem;
}

.content-card h3 {
    font-size: 1.15rem;
    margin-bottom: 0.5rem;
}

.content-card h3 a {
    color: var(--dark-blue);
}

.content-card h3 a:hover {
    color: var(--primary-blue);
}

.content-card .meta {
    font-size: 0.85rem;
    color: #999;
    margin-bottom: 0.5rem;
}

.content-card p {
    color: #666;
    font-size: 0.9rem;
}

/* Tags (from Brand Book demo-badge pattern) */
.tag {
    display: inline-block;
    background: var(--digital-blue-5);
    color: var(--primary-blue);
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.25rem 0.625rem;
    border-radius: 100px;
    margin-right: 0.25rem;
    margin-bottom: 0.25rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* =========================================
   FAQ
   ========================================= */
.faq-list {
    max-width: 800px;
    margin: 0 auto;
}

.faq-item {
    border-bottom: 1px solid var(--digital-light);
    padding: 1.5rem 0;
}

.faq-item h3 {
    font-size: 1.3rem;
    color: var(--dark-blue);
    margin-bottom: 0.75rem;
}

.faq-item div,
.faq-answer {
    color: #555;
    line-height: 1.7;
    font-size: 1.05rem;
}

.empty-state {
    text-align: center;
    color: #666;
    padding: 2rem;
    font-size: 1rem;
}

/* =========================================
   DASHBOARD
   ========================================= */
.dashboard-welcome {
    text-align: center;
    padding: 2rem 0 1rem;
}

.dashboard-welcome h2 {
    color: var(--dark-blue);
    font-size: 1.75rem;
}

/* =========================================
   ALERTS (from Brand Book)
   ========================================= */
.alert {
    padding: 0.875rem 1.25rem;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.alert-info {
    background: rgba(0,61,165,0.08);
    color: var(--primary-blue);
    border-left: 3px solid var(--primary-blue);
}

.alert-success {
    background: rgba(34,197,94,0.08);
    color: #16a34a;
    border-left: 3px solid #22c55e;
}

.alert-warning {
    background: rgba(234,144,61,0.08);
    color: #b45309;
    border-left: 3px solid var(--orange);
}

.alert-error {
    background: rgba(225,99,59,0.08);
    color: var(--tomato-dark);
    border-left: 3px solid var(--tomato-medium);
}

/* =========================================
   BREADCRUMBS (from Brand Book)
   ========================================= */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: #666;
    padding: 1rem 0;
}

.breadcrumb a {
    color: var(--primary-blue);
    font-weight: 500;
}

.breadcrumb-sep {
    color: #ccc;
}

/* =========================================
   SOCIAL LINKS (from Brand Book)
   ========================================= */
.social-links {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    flex-wrap: wrap;
}

.social-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 1.5rem;
    background: white;
    border-radius: 8px;
    color: var(--dark-blue);
    font-weight: 600;
    box-shadow: var(--shadow-small);
    transition: all 300ms ease;
}

.social-link:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-large);
    color: var(--primary-blue);
}

/* Social links in dark context */
.section-dark .social-link,
.section-gradient .social-link,
.footer .social-link {
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.1);
    color: rgba(255,255,255,0.8);
    box-shadow: none;
}

.section-dark .social-link:hover,
.section-gradient .social-link:hover,
.footer .social-link:hover {
    background: rgba(255,255,255,0.1);
    color: var(--mint);
    box-shadow: none;
}

/* =========================================
   FOOTER
   ========================================= */
.footer {
    background: var(--digital-dark);
    color: rgba(255,255,255,0.7);
    padding: 80px 2rem 30px;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    max-width: var(--container-max);
    margin: 0 auto 3rem;
}

.footer-col h4 {
    color: white;
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.footer-col p {
    font-size: 0.9rem;
    line-height: 1.6;
}

.footer-col ul {
    list-style: none;
}

.footer-col ul li {
    margin-bottom: 0.5rem;
}

.footer-col ul a {
    color: rgba(255,255,255,0.6);
    font-size: 0.9rem;
    transition: all 200ms ease;
}

.footer-col ul a:hover {
    color: var(--mint);
}

.footer-col a {
    color: rgba(255,255,255,0.6);
    transition: all 200ms ease;
}

.footer-col a:hover {
    color: var(--mint);
}

.footer-tagline {
    font-family: var(--font-accent);
    font-style: italic;
    font-size: 1.2rem;
    color: var(--mint);
    margin-bottom: 1rem;
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid rgba(255,255,255,0.1);
    font-size: 0.85rem;
    max-width: var(--container-max);
    margin: 0 auto;
}

/* =========================================
   SCROLL PROGRESS BAR (from Brand Book)
   ========================================= */
.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-blue), var(--mint), var(--digital-key1));
    z-index: 9999;
    width: 0%;
    transition: width 100ms ease-out;
}

/* =========================================
   SKIP NAVIGATION (WCAG accessibility)
   ========================================= */
.skip-nav {
    position: absolute;
    top: -100%;
    left: 0;
    background: var(--primary-blue);
    color: white;
    padding: 0.75rem 1.5rem;
    font-weight: 700;
    z-index: 10000;
    transition: top 200ms ease;
}

.skip-nav:focus {
    top: 0;
    color: white;
}

/* =========================================
   SCROLL REVEAL (from Brand Book)
   ========================================= */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* =========================================
   HERO META (from Brand Book)
   ========================================= */
.hero-meta {
    font-size: 1.1rem;
    color: rgba(255,255,255,0.8);
    margin-top: 2rem;
}

.hero-meta strong {
    color: white;
    font-weight: 600;
}

/* =========================================
   UI COMPONENTS (from Brand Book)
   ========================================= */

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.25rem;
    margin-top: 3rem;
    padding: 1rem 0;
}

.pagination a,
.pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 500;
    color: #666;
    cursor: pointer;
    transition: all 200ms ease;
}

.pagination a:hover {
    background: var(--digital-light);
    color: var(--dark-blue);
}

.pagination .current {
    background: var(--primary-blue);
    color: white;
}

.pagination .disabled {
    color: #ccc;
    pointer-events: none;
}

/* Tables (from Brand Book .psi-table) */
.psi-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
    margin-bottom: 1.5rem;
}

.psi-table th {
    background: var(--dark-blue);
    color: white;
    padding: 0.75rem 1rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.psi-table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--digital-light);
    color: #555;
}

.psi-table tr:hover td {
    background: rgba(0,61,165,0.03);
}

/* Form Inputs (from Brand Book .psi-input) */
.psi-input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid var(--digital-blue-5);
    border-radius: 6px;
    font-family: var(--font-primary);
    font-size: 0.95rem;
    color: var(--digital-dark);
    background: white;
    transition: border-color 200ms ease, box-shadow 200ms ease;
    outline: none;
}

.psi-input:focus {
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px rgba(0,61,165,0.15);
}

.psi-input::placeholder {
    color: #767676;
}

.psi-input.error {
    border-color: var(--tomato-medium);
    box-shadow: 0 0 0 3px rgba(225,99,59,0.15);
}

.psi-input.success {
    border-color: #22c55e;
    box-shadow: 0 0 0 3px rgba(34,197,94,0.15);
}

/* Textarea (from Brand Book) */
.psi-textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid var(--digital-blue-5);
    border-radius: 6px;
    font-family: var(--font-primary);
    font-size: 0.95rem;
    color: var(--digital-dark);
    min-height: 80px;
    resize: vertical;
    transition: border-color 200ms ease, box-shadow 200ms ease;
    outline: none;
}

.psi-textarea:focus {
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px rgba(0,61,165,0.15);
}

/* Select (from Brand Book) */
.psi-select {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid var(--digital-blue-5);
    border-radius: 6px;
    font-family: var(--font-primary);
    font-size: 0.95rem;
    color: var(--digital-dark);
    background: white;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23666' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    cursor: pointer;
    transition: border-color 200ms ease;
    outline: none;
}

.psi-select:focus {
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px rgba(0,61,165,0.15);
}

/* Label (from Brand Book) */
.psi-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--dark-blue);
    margin-bottom: 0.5rem;
}

/* Progress Bars (from Brand Book) */
.progress {
    width: 100%;
    height: 8px;
    background: var(--digital-light);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 1rem;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-blue), var(--digital-key1));
    border-radius: 4px;
    transition: width 600ms ease;
}

.progress-bar.success { background: linear-gradient(90deg, #22c55e, #16a34a); }
.progress-bar.warning { background: linear-gradient(90deg, var(--orange), var(--amber)); }
.progress-bar.error { background: linear-gradient(90deg, var(--tomato-medium), var(--tomato-dark)); }

/* Badges (from Brand Book) */
.badge {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.25rem 0.625rem;
    border-radius: 100px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    vertical-align: middle;
}

.badge-primary { background: var(--primary-blue); color: white; }
.badge-mint { background: var(--mint); color: var(--dark-blue); }
.badge-warning { background: var(--amber); color: var(--dark-blue); }
.badge-error { background: var(--tomato-medium); color: white; }
.badge-dark { background: var(--dark-blue); color: white; }
.badge-success { background: #22c55e; color: white; }
.badge-outline { background: transparent; border: 1px solid var(--primary-blue); color: var(--primary-blue); }

/* Modal (from Brand Book .psi-modal) */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,20,82,0.5);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 300ms ease;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal {
    background: white;
    border-radius: 12px;
    padding: 2.5rem;
    max-width: 560px;
    width: 90%;
    box-shadow: var(--shadow-large);
    text-align: center;
    transform: scale(0.9) translateY(20px);
    transition: transform 300ms ease;
}

.modal-overlay.active .modal {
    transform: scale(1) translateY(0);
}

.modal h3 {
    font-size: 1.5rem;
    color: var(--dark-blue);
    margin-bottom: 0.75rem;
}

.modal p {
    color: #666;
    margin-bottom: 2rem;
}

.modal-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

/* Toggle Switch (from Brand Book .psi-toggle) */
.toggle {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 26px;
    cursor: pointer;
}

.toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    inset: 0;
    background: var(--digital-light);
    border-radius: 26px;
    transition: all 200ms ease;
}

.toggle-slider::before {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 20px;
    height: 20px;
    background: white;
    border-radius: 50%;
    box-shadow: var(--shadow-small);
    transition: all 200ms ease;
}

.toggle input:checked + .toggle-slider {
    background: var(--primary-blue);
}

.toggle input:checked + .toggle-slider::before {
    transform: translateX(22px);
}

/* Tooltip (from Brand Book) */
.tooltip {
    position: relative;
    display: inline-block;
}

.tooltip-content {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background: var(--dark-blue);
    color: white;
    padding: 0.5rem 0.75rem;
    border-radius: 4px;
    font-size: 0.75rem;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transition: opacity 200ms ease, transform 200ms ease;
    transform: translateX(-50%) translateY(4px);
}

.tooltip-content::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: var(--dark-blue);
}

.tooltip:hover .tooltip-content {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* Skeleton Loading (from Brand Book) */
.skeleton {
    background: linear-gradient(90deg, var(--digital-light) 25%, #e8e9eb 50%, var(--digital-light) 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
    border-radius: 4px;
}

.skeleton-text {
    height: 1rem;
    margin-bottom: 0.75rem;
}

.skeleton-text:last-child {
    width: 60%;
}

.skeleton-heading {
    height: 1.5rem;
    width: 40%;
    margin-bottom: 1rem;
}

.skeleton-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
}

.skeleton-card {
    height: 200px;
    border-radius: 8px;
}

@keyframes skeleton-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Contact Card (from Brand Book) */
.contact-card {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: var(--shadow-small);
}

.contact-card h4 {
    color: var(--primary-blue);
    margin-bottom: 1rem;
}

.contact-card p {
    color: #666;
    margin-bottom: 0.5rem;
}

.contact-card a {
    color: var(--digital-key1);
    font-weight: 600;
}

/* Glass Card (from Brand Book glassmorphism) */
.glass-card {
    background: rgba(255,255,255,0.08);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 16px;
    padding: 1.5rem;
    transition: all 300ms ease;
}

.glass-card:hover {
    background: rgba(255,255,255,0.12);
    border-color: rgba(255,255,255,0.2);
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(0,0,0,0.2);
}

/* Tabs (from Brand Book) */
.tabs {
    display: flex;
    gap: 0;
    border-bottom: 2px solid var(--digital-light);
    margin-bottom: 2rem;
}

.tab {
    padding: 0.75rem 1.25rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: #666;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    cursor: pointer;
    transition: all 200ms ease;
}

.tab:hover {
    color: var(--primary-blue);
}

.tab.active {
    color: var(--primary-blue);
    border-bottom-color: var(--primary-blue);
}

/* Avatar (from Brand Book) */
.avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--primary-blue);
    color: white;
    font-weight: 700;
    overflow: hidden;
}

.avatar-sm { width: 32px; height: 32px; font-size: 0.75rem; }
.avatar { width: 40px; height: 40px; font-size: 0.85rem; }
.avatar-lg { width: 56px; height: 56px; font-size: 1.1rem; }

.avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.avatar-group {
    display: flex;
}

.avatar-group .avatar {
    margin-left: -8px;
    border: 2px solid white;
}

.avatar-group .avatar:first-child {
    margin-left: 0;
}

/* =========================================
   ANIMATIONS (from Brand Book)
   ========================================= */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

@keyframes bounce {
    0%, 100% { transform: translateX(-50%) translateY(0); }
    50% { transform: translateX(-50%) translateY(-10px); }
}

@keyframes heroFloat {
    0%, 100% { transform: scale(1) translateY(0); }
    50% { transform: scale(1.05) translateY(-20px); }
}

@keyframes scroll {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

@keyframes slideInLeft {
    from { opacity: 0; transform: translateX(-40px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes slideInRight {
    from { opacity: 0; transform: translateX(40px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes scaleIn {
    from { opacity: 0; transform: scale(0.8); }
    to { opacity: 1; transform: scale(1); }
}

/* =========================================
   RESPONSIVE (from Brand Book)
   ========================================= */
@media (max-width: 992px) {
    :root {
        --section-padding: 80px;
    }

    .hero h1 {
        font-size: 3rem;
    }

    .hero-tagline {
        font-size: 1.5rem;
    }

    .section-title,
    .section-header h2 {
        font-size: 2.5rem;
    }

    .nav-links {
        display: none;
    }

    .nav-toggle {
        display: flex;
    }
}

/* Tablet-specific (from Brand Book) */
@media (min-width: 768px) and (max-width: 991px) {
    .cards-grid,
    .content-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .hero h1 {
        font-size: 3.5rem;
    }

    .hero-badge {
        width: 120px;
    }

    .hero-logo {
        width: 180px;
    }

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

@media (max-width: 768px) {
    :root {
        --section-padding: 60px;
    }

    h1 { font-size: 2.5rem; }
    h2 { font-size: 2rem; }
    h3 { font-size: 1.5rem; }

    .hero {
        min-height: 85vh;
        padding: 5rem 1.5rem 3rem !important;
    }

    .hero-badge {
        width: 80px;
    }

    .hero-logo {
        width: 160px;
        margin-bottom: 2rem;
    }

    .hero h1 {
        font-size: 2.2rem !important;
        line-height: 1.15;
        letter-spacing: -0.5px;
    }

    .hero-tagline {
        font-size: 1.1rem !important;
        line-height: 1.4;
    }

    .section {
        padding: 60px 1.5rem;
    }

    .nav {
        background: rgba(0, 20, 82, 0.92) !important;
        backdrop-filter: blur(24px) saturate(180%) !important;
        -webkit-backdrop-filter: blur(24px) saturate(180%) !important;
    }

    .nav-links {
        display: none;
        position: absolute;
        top: 64px;
        left: 0;
        right: 0;
        background: rgba(0, 20, 82, 0.98);
        flex-direction: column;
        padding: 1rem 2rem 2rem;
        gap: 0.75rem;
    }

    .nav-links.active { display: flex; }

    .cards-grid,
    .content-grid {
        grid-template-columns: 1fr;
    }

    .page-header h1 {
        font-size: 2rem;
    }

    .page-header {
        padding: 100px 1.5rem 50px;
    }

    /* Mobile button touch feedback */
    .btn {
        min-height: 48px;
        font-size: 0.95rem;
        -webkit-tap-highlight-color: transparent;
        touch-action: manipulation;
    }

    .btn:active {
        transform: scale(0.96) !important;
        transition: transform 100ms ease !important;
    }

    /* Mobile scroll animations (smoother/faster) */
    .section {
        animation-duration: 600ms !important;
    }

    /* Mobile gradient overlays */
    .section-gradient::after,
    .section-dark::after {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        height: 1px;
        background: linear-gradient(90deg,
            transparent 0%,
            var(--mint) 20%,
            var(--primary-blue) 50%,
            var(--mint) 80%,
            transparent 100%
        );
        opacity: 0.3;
    }

    /* Mobile section dividers */
    .section + .section-alt,
    .section-alt + .section {
        position: relative;
    }

    .section + .section-alt::before,
    .section-alt + .section::before {
        content: '';
        position: absolute;
        top: 0;
        left: 50%;
        transform: translateX(-50%);
        width: 60px;
        height: 3px;
        background: linear-gradient(90deg, var(--primary-blue), var(--mint));
        border-radius: 2px;
    }

    /* Mobile card touch feedback */
    .service-card,
    .content-card,
    .announcement-item {
        transition: transform 200ms ease, box-shadow 200ms ease;
    }

    .service-card:active,
    .content-card:active {
        transform: scale(0.97);
    }

    /* Mobile shadow enhancements */
    .section-alt {
        box-shadow: inset 0 1px 0 rgba(0,61,165,0.05), inset 0 -1px 0 rgba(0,61,165,0.05);
    }

    /* Mobile section label */
    .section-label {
        font-size: 0.75rem !important;
        letter-spacing: 1.5px !important;
    }

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

    /* Mobile safe areas */
    .nav {
        padding-top: max(1rem, env(safe-area-inset-top));
        padding-left: max(1rem, env(safe-area-inset-left));
        padding-right: max(1rem, env(safe-area-inset-right));
    }

    .section:last-of-type {
        padding-bottom: max(60px, calc(60px + env(safe-area-inset-bottom)));
    }

    /* Mobile smooth scroll */
    html {
        -webkit-overflow-scrolling: touch;
    }

    /* Mobile glass cards */
    .glass-card {
        border-radius: 12px;
        padding: 1.25rem;
    }
}

/* STREAK MINI INDICATOR */
.streak-mini {
    position: absolute;
    bottom: -2px;
    right: -2px;
    background: #f5a623;
    color: #fff;
    font-size: 0.6rem;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    border: 2px solid var(--dark-blue);
}

.nav-dropdown-toggle {
    position: relative;
}

/* CONTINUE READING SECTION */
.continue-reading-section {
    padding: 2rem 0;
}

.continue-reading-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.continue-reading-card {
    display: block;
    padding: 1.25rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    text-decoration: none;
    color: var(--text);
    transition: transform 0.2s, box-shadow 0.2s;
}

.continue-reading-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    color: var(--text);
}

.continue-reading-card h3 {
    margin: 0.75rem 0 0.25rem;
    font-size: 1rem;
}

/* =========================================
   PRINT STYLES (from Brand Book)
   ========================================= */
@media print {
    .nav,
    .hero-scroll,
    .footer {
        display: none;
    }

    .section {
        page-break-inside: avoid;
        padding: 40px 20px;
    }

    .hero {
        min-height: auto;
        padding: 40px 20px;
    }

    body {
        font-size: 12pt;
    }

    h1 { font-size: 24pt; }
    h2 { font-size: 20pt; }
    h3 { font-size: 16pt; }
}

/* =========================================
   REDUCED MOTION (from Brand Book)
   ========================================= */
@media (prefers-reduced-motion: reduce) {
    *,
    html { scroll-behavior: auto !important; }
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* =========================================
   SEARCH PAGE
   ========================================= */
.search-form {
    margin-bottom: 2rem;
}

.search-input-group {
    display: flex;
    gap: 0.75rem;
    max-width: 600px;
}

.search-input {
    flex: 1;
    padding: 0.75rem 1rem;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    font-size: 1rem;
    font-family: var(--font-body);
    transition: border-color var(--transition);
}

.search-input:focus {
    outline: none;
    border-color: var(--primary-blue);
}

.search-meta {
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

.search-result-item {
    padding: 1.25rem 0;
    border-bottom: 1px solid var(--border);
}

.search-result-item h3 {
    margin-bottom: 0.25rem;
}

.search-result-item h3 a {
    color: var(--primary-blue);
    text-decoration: none;
}

.search-result-item h3 a:hover {
    text-decoration: underline;
}

.search-result-item p {
    color: var(--text-muted);
    margin: 0;
}

/* =========================================
   CODE BLOCK
   ========================================= */
.code-block {
    margin: 1.5rem 0;
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border);
}

.code-block-header {
    background: var(--dark-blue);
    color: #fff;
    padding: 0.5rem 1rem;
    font-size: 0.8rem;
    font-family: var(--font-body);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.code-block pre {
    margin: 0;
    padding: 1.25rem;
    background: #0a1628;
    color: #e0e6f0;
    overflow-x: auto;
    font-size: 0.9rem;
    line-height: 1.6;
}

.code-block code {
    font-family: "Fira Code", "Consolas", "Monaco", monospace;
}

/* =========================================
   ALERT BLOCK
   ========================================= */
.alert {
    padding: 1rem 1.25rem;
    border-radius: var(--radius);
    margin: 1.5rem 0;
    border-left: 4px solid;
}

.alert-info {
    background: #e8f4fd;
    border-left-color: var(--primary-blue);
    color: var(--dark-blue);
}

.alert-warning {
    background: #fff8e1;
    border-left-color: #f9a825;
    color: #5d4037;
}

.alert-success {
    background: #e8f5e9;
    border-left-color: #43a047;
    color: #1b5e20;
}

.alert-danger {
    background: #fce4ec;
    border-left-color: #e53935;
    color: #b71c1c;
}

/* =========================================
   VIDEO EMBED
   ========================================= */
.video-embed {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    border-radius: var(--radius);
    margin-bottom: 2rem;
}

.video-embed iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

/* =========================================
   CONTACT FORM
   ========================================= */
.contact-form {
    max-width: 640px;
}

.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.375rem;
    color: var(--dark-blue);
}

.form-group .required {
    color: #e53935;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="url"],
.form-group input[type="number"],
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    font-size: 1rem;
    font-family: var(--font-body);
    transition: border-color var(--transition);
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-blue);
}

.form-group textarea {
    min-height: 120px;
    resize: vertical;
}

.help-text {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

.error-list {
    list-style: none;
    padding: 0;
    margin: 0.25rem 0 0;
    color: #e53935;
    font-size: 0.85rem;
}

/* =========================================
   TAG LIST
   ========================================= */
.tag-list {
    margin-top: 2rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

/* =========================================
   BUTTONS
   ========================================= */
.btn {
    display: inline-block;
    padding: 0.625rem 1.25rem;
    border-radius: var(--radius);
    font-size: 0.95rem;
    font-weight: 600;
    font-family: var(--font-body);
    text-decoration: none;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all var(--transition);
}

.btn-primary {
    background: var(--primary-blue);
    color: #fff;
    border-color: var(--primary-blue);
}

.btn-primary:hover {
    background: var(--dark-blue);
    border-color: var(--dark-blue);
    color: #fff;
}

.btn-outline {
    background: transparent;
    color: var(--primary-blue);
    border-color: var(--primary-blue);
}

.btn-outline:hover {
    background: var(--primary-blue);
    color: #fff;
}

/* =========================================
   PAGINATION
   ========================================= */
.pagination {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
}

/* =========================================
   FILTER BAR
   ========================================= */
.filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.filter-chip {
    display: inline-block;
    padding: 0.375rem 1rem;
    border-radius: 2rem;
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    background: var(--surface);
    color: var(--text-muted);
    border: 1px solid var(--border);
    transition: all var(--transition);
}

.filter-chip:hover,
.filter-chip.active {
    background: var(--primary-blue);
    color: #fff;
    border-color: var(--primary-blue);
}

.filter-active {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: #e8f4fd;
    border-radius: var(--radius);
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
}

.filter-clear {
    color: var(--primary-blue);
    font-weight: 600;
    text-decoration: none;
}

.filter-clear:hover {
    text-decoration: underline;
}

/* =========================================
   CONTENT CARD THUMBNAIL
   ========================================= */
.content-card-thumb {
    position: relative;
    overflow: hidden;
    border-radius: var(--radius) var(--radius) 0 0;
}

.content-card-thumb .card-img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform var(--transition);
}

.content-card:hover .content-card-thumb .card-img {
    transform: scale(1.03);
}

.duration-badge {
    position: absolute;
    bottom: 0.5rem;
    right: 0.5rem;
    background: rgba(0, 0, 0, 0.8);
    color: #fff;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
}

/* =========================================
   PAGINATION INFO
   ========================================= */
.pagination-info {
    display: flex;
    align-items: center;
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* =========================================
   ERROR PAGES
   ========================================= */
.error-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    text-align: center;
    padding: 2rem;
}

.error-content {
    max-width: 480px;
}

.error-code {
    font-size: 8rem;
    font-weight: 700;
    color: var(--primary-blue);
    line-height: 1;
    margin-bottom: 0.5rem;
}

.error-content h2 {
    margin-bottom: 0.75rem;
    color: var(--dark-blue);
}

.error-content p {
    color: var(--text-muted);
    margin-bottom: 2rem;
}

.error-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

/* =========================================
   RELATED CONTENT
   ========================================= */
.related-section {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
}

.related-section h3 {
    margin-bottom: 1rem;
    color: var(--dark-blue);
}

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

.related-item {
    padding: 1rem;
    background: var(--surface);
    border-radius: var(--radius);
    text-decoration: none;
    color: inherit;
    transition: box-shadow var(--transition);
}

.related-item:hover {
    box-shadow: var(--shadow);
}

.related-item h4 {
    margin-bottom: 0.25rem;
    color: var(--primary-blue);
}

.related-item .meta {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* =========================================
   REVIEW BADGE
   ========================================= */
.review-badge {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    background: #fff8e1;
    color: #f57f17;
    margin-left: 0.5rem;
}

/* =========================================
   TOAST NOTIFICATIONS
   ========================================= */
.toast-container {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.toast {
    padding: 0.75rem 1.25rem;
    border-radius: var(--radius);
    font-size: 0.9rem;
    background: var(--dark-blue);
    color: #fff;
    box-shadow: var(--shadow-lg);
    animation: toastIn 0.3s ease;
}

.toast-success { background: #43a047; }
.toast-error { background: #e53935; }
.toast-warning { background: #f9a825; color: #333; }

@keyframes toastIn {
    from { opacity: 0; transform: translateX(1rem); }
    to { opacity: 1; transform: translateX(0); }
}

/* =========================================
   USER DROPDOWN MENU
   ========================================= */
.nav-dropdown {
    position: relative;
}

.nav-dropdown-toggle {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.25rem;
    display: flex;
    align-items: center;
}

.nav-user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--mint);
    color: var(--dark-blue);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
    transition: box-shadow var(--transition);
}

.nav-dropdown-toggle:hover .nav-user-avatar {
    box-shadow: 0 0 0 3px rgba(175, 223, 224, 0.5);
}

.nav-dropdown-menu {
    display: none;
    position: absolute;
    right: 0;
    top: calc(100% + 0.5rem);
    background: #fff;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    min-width: 200px;
    padding: 0.5rem 0;
    z-index: 1000;
    list-style: none;
}

.nav-dropdown.open .nav-dropdown-menu {
    display: block;
}

.nav-dropdown-menu li a {
    display: block;
    padding: 0.5rem 1rem;
    color: var(--text);
    text-decoration: none;
    font-size: 0.9rem;
    transition: background var(--transition);
}

.nav-dropdown-menu li a:hover {
    background: var(--surface);
    color: var(--primary-blue);
}

.dropdown-user-info {
    padding: 0.5rem 1rem;
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
    margin-bottom: 0.25rem;
}

.dropdown-divider {
    height: 1px;
    background: var(--border);
    margin: 0.25rem 0;
}

/* =========================================
   ACCOUNT PAGES
   ========================================= */
.account-card {
    background: #fff;
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow);
    margin-bottom: 1.5rem;
}

.form-card {
    max-width: 600px;
}

.card-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.card-header-row h3 {
    margin: 0;
}

.link-subtle {
    color: var(--primary-blue);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
}

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

/* Profile */
.profile-layout {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1.5rem;
    align-items: start;
}

@media (max-width: 768px) {
    .profile-layout {
        grid-template-columns: 1fr;
    }
}

.profile-header-info {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    margin-bottom: 1.5rem;
}

.profile-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--primary-blue);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 700;
    flex-shrink: 0;
}

.profile-header-info h2 {
    margin: 0 0 0.25rem;
}

.profile-bio {
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: var(--surface);
    border-radius: var(--radius);
}

.profile-bio h4 {
    margin: 0 0 0.5rem;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}

.profile-actions {
    display: flex;
    gap: 0.75rem;
}

/* Sidebar nav */
.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 0.75rem;
    border-radius: var(--radius);
    color: var(--text);
    text-decoration: none;
    font-size: 0.9rem;
    transition: background var(--transition);
}

.sidebar-nav a:hover {
    background: var(--surface);
    color: var(--primary-blue);
}

.count-badge {
    margin-left: auto;
    background: var(--primary-blue);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.125rem 0.5rem;
    border-radius: 2rem;
}

/* Info list */
.info-list {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.5rem 1rem;
    font-size: 0.9rem;
}

.info-list dt {
    color: var(--text-muted);
    font-weight: 500;
}

.info-list dd {
    margin: 0;
    color: var(--text);
}

/* Activity list */
.activity-list {
    display: flex;
    flex-direction: column;
}

.activity-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border);
    text-decoration: none;
    color: inherit;
    transition: background var(--transition);
}

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

.activity-item:hover {
    background: var(--surface);
    border-radius: var(--radius);
    padding-left: 0.5rem;
    padding-right: 0.5rem;
}

.activity-icon {
    color: var(--text-muted);
    flex-shrink: 0;
}

.activity-content {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
    min-width: 0;
}

.activity-title {
    font-weight: 500;
    color: var(--dark-blue);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.activity-meta {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Notes */
.notes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1rem;
}

.note-card {
    background: #fff;
    border-radius: var(--radius);
    padding: 1.25rem;
    box-shadow: var(--shadow);
    border-left: 3px solid var(--primary-blue);
}

.note-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.75rem;
}

.note-card-header h3,
.note-card-header h4 {
    margin: 0;
    font-size: 1rem;
}

.note-preview {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 0.75rem;
}

.note-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border);
}

.note-actions {
    display: flex;
    gap: 0.5rem;
}

/* Bookmark & action buttons on pages */
.page-actions {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.btn-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: #fff;
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
}

.btn-icon:hover {
    border-color: var(--primary-blue);
    color: var(--primary-blue);
    background: #f0f7ff;
}

.bookmark-btn.bookmarked {
    color: var(--primary-blue);
    border-color: var(--primary-blue);
    background: #f0f7ff;
}

/* Small button variant */
.btn-sm {
    padding: 0.3rem 0.75rem;
    font-size: 0.8rem;
}

.btn-danger-outline {
    color: #e53935;
    border-color: #e53935;
}

.btn-danger-outline:hover {
    background: #e53935;
    color: #fff;
}

/* Content card footer */
.content-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1.25rem;
    border-top: 1px solid var(--border);
}

.card-description {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin: 0.5rem 0 0;
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-muted);
}

.empty-state svg {
    margin-bottom: 1rem;
    opacity: 0.4;
}

.empty-state h3 {
    margin-bottom: 0.5rem;
    color: var(--dark-blue);
}

.empty-state p {
    margin-bottom: 1.5rem;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

/* Forms */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

@media (max-width: 480px) {
    .form-row {
        grid-template-columns: 1fr;
    }
}

.form-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
}

.form-error {
    display: block;
    color: #e53935;
    font-size: 0.8rem;
    margin-top: 0.25rem;
}

.form-help {
    display: block;
    color: var(--text-muted);
    font-size: 0.8rem;
    margin-top: 0.25rem;
}

.form-input {
    width: 100%;
    padding: 0.625rem 0.875rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.95rem;
    font-family: var(--font-body);
    transition: border-color var(--transition), box-shadow var(--transition);
    background: #fff;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px rgba(0, 61, 165, 0.1);
}

textarea.form-input {
    resize: vertical;
}

/* Auth form (login page) */
.auth-form {
    text-align: left;
}

.auth-form .form-group {
    margin-bottom: 1rem;
}

.auth-form label {
    display: block;
    margin-bottom: 0.375rem;
    font-weight: 500;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.9);
}

.auth-form .form-input {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    color: #fff;
}

.auth-form .form-input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.auth-form .form-input:focus {
    border-color: var(--mint);
    box-shadow: 0 0 0 3px rgba(175, 223, 224, 0.2);
}

/* Text utilities */
.text-muted {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin: 0;
}

/* Alert for forms */
.alert {
    padding: 0.75rem 1rem;
    border-radius: var(--radius);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.alert-danger {
    background: #fde8e8;
    color: #c62828;
    border: 1px solid #ef9a9a;
}

.alert-success {
    background: #e8f5e9;
    color: #2e7d32;
    border: 1px solid #a5d6a7;
}

.alert-info {
    background: #e3f2fd;
    color: #1565c0;
    border: 1px solid #90caf9;
}

.alert-warning {
    background: #fff8e1;
    color: #f57f17;
    border: 1px solid #ffe082;
}

/* =========================================
   NAV BADGE (unread announcements)
   ========================================= */
.nav-link-badge-wrap {
    position: relative;
}

.nav-badge {
    position: absolute;
    top: -8px;
    right: -12px;
    background: #e53935;
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

/* =========================================
   TABLE OF CONTENTS
   ========================================= */
.toc {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem 1.5rem;
    margin-bottom: 2rem;
}

.toc h4 {
    margin: 0 0 0.75rem;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}

.toc ol {
    margin: 0;
    padding-left: 1.25rem;
    list-style: decimal;
}

.toc ol li {
    padding: 0.25rem 0;
}

.toc ol li a {
    color: var(--primary-blue);
    text-decoration: none;
    font-size: 0.95rem;
}

.toc ol li a:hover {
    text-decoration: underline;
}

/* =========================================
   FAQ ACCORDION
   ========================================= */
.faq-item {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 0.75rem;
    background: #fff;
}

.faq-question {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    list-style: none;
    color: var(--dark-blue);
    transition: background var(--transition);
}

.faq-question:hover {
    background: var(--surface);
}

.faq-question::-webkit-details-marker {
    display: none;
}

.faq-chevron {
    flex-shrink: 0;
    transition: transform 0.2s ease;
    color: var(--text-muted);
}

details.faq-item[open] .faq-chevron {
    transform: rotate(180deg);
}

.faq-answer {
    padding: 0 1.25rem 1.25rem;
    color: var(--text);
    line-height: 1.7;
    border-top: 1px solid var(--border);
    padding-top: 1rem;
}

/* =========================================
   CODE BLOCK COPY BUTTON
   ========================================= */
.code-block {
    position: relative;
    margin-bottom: 1.5rem;
}

.code-block-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--dark-blue);
    color: rgba(255, 255, 255, 0.7);
    padding: 0.5rem 1rem;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-radius: var(--radius) var(--radius) 0 0;
}

.code-copy-btn {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    background: none;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.7);
    padding: 0.25rem 0.625rem;
    border-radius: 4px;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all var(--transition);
}

.code-copy-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.4);
}

.code-copy-btn.copied {
    color: var(--mint);
    border-color: var(--mint);
}

.code-block pre {
    margin: 0;
    background: #1a1a2e;
    padding: 1.25rem;
    overflow-x: auto;
    border-radius: 0 0 var(--radius) var(--radius);
}

.code-block code {
    font-family: 'Fira Code', 'Consolas', 'Monaco', monospace;
    font-size: 0.875rem;
    line-height: 1.6;
    color: #e0e0e0;
}

/* =========================================
   BACK TO TOP BUTTON
   ========================================= */
.back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--primary-blue);
    color: #fff;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-lg);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s ease;
    z-index: 100;
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.back-to-top:hover {
    background: var(--dark-blue);
    transform: translateY(-2px);
}

/* =========================================
   SEARCH ENHANCEMENTS
   ========================================= */
.search-result-item {
    padding: 1rem 0;
    border-bottom: 1px solid var(--border);
}

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

.search-result-item h3 {
    margin: 0 0 0.25rem;
}

.search-result-item h3 a {
    color: var(--dark-blue);
    text-decoration: none;
}

.search-result-item h3 a:hover {
    color: var(--primary-blue);
    text-decoration: underline;
}

.search-result-meta {
    margin-bottom: 0.375rem;
}

.search-result-type {
    display: inline-block;
    background: var(--surface);
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.125rem 0.5rem;
    border-radius: 4px;
    text-transform: capitalize;
}

.search-result-item p {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin: 0;
}

.search-meta {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border);
}

.search-form {
    margin-bottom: 1.5rem;
}

.search-input-group {
    display: flex;
    gap: 0.5rem;
}

.search-input {
    flex: 1;
    padding: 0.75rem 1rem;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    font-size: 1rem;
    font-family: var(--font-body);
    transition: border-color var(--transition);
}

.search-input:focus {
    outline: none;
    border-color: var(--primary-blue);
}

/* =========================================
   TAG INLINE LISTS (for index pages)
   ========================================= */
.tag-list-inline {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    margin-top: 0.5rem;
}

.tag-sm {
    display: inline-block;
    padding: 0.125rem 0.5rem;
    background: var(--surface);
    color: var(--text-muted);
    font-size: 0.75rem;
    border-radius: 2rem;
    text-decoration: none;
    transition: all var(--transition);
}

.tag-sm:hover {
    background: var(--primary-blue);
    color: #fff;
}

/* =========================================
   USER MANAGEMENT TABLE
   ========================================= */
.table-responsive {
    overflow-x: auto;
}

.account-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.account-table th,
.account-table td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.account-table th {
    font-weight: 600;
    color: var(--text-muted);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.account-table tr:hover {
    background: var(--surface);
}

.account-table .row-inactive {
    opacity: 0.6;
}

.actions-cell {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.badge {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: 2rem;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-success {
    background: #d4edda;
    color: #155724;
}

.badge-muted {
    background: var(--surface);
    color: var(--text-muted);
}

.btn-sm {
    padding: 0.25rem 0.75rem;
    font-size: 0.8rem;
}

.btn-danger-outline {
    border: 1px solid #dc3545;
    color: #dc3545;
    background: transparent;
    border-radius: 2rem;
    cursor: pointer;
    transition: all var(--transition);
}

.btn-danger-outline:hover {
    background: #dc3545;
    color: #fff;
}

.btn-outline {
    border: 1px solid var(--border);
    color: var(--text);
    background: transparent;
    border-radius: 2rem;
    cursor: pointer;
    text-decoration: none;
    transition: all var(--transition);
}

.btn-outline:hover {
    background: var(--surface);
}

.account-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.container-narrow {
    max-width: 600px;
    margin: 0 auto;
}

.checkbox-wrap {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* =========================================
   PROGRESS DASHBOARD
   ========================================= */
.progress-bar-wrap {
    background: var(--surface);
    border-radius: 2rem;
    height: 8px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: var(--primary-blue);
    border-radius: 2rem;
    transition: width 0.3s;
}

.progress-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border);
}

.progress-percent {
    font-size: 0.85rem;
    font-weight: 600;
    min-width: 3rem;
    text-align: right;
}

.continue-reading {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    text-decoration: none;
    color: var(--text);
    transition: box-shadow var(--transition), border-color var(--transition);
}

.continue-reading:hover {
    border-color: var(--primary-blue);
    box-shadow: var(--shadow-card);
    color: var(--text);
}

/* =========================================
   BADGES
   ========================================= */
.badges-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1.5rem;
}

.badge-card {
    text-align: center;
    padding: 1.5rem 1rem;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    transition: transform var(--transition), box-shadow var(--transition);
}

.badge-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-card);
}

.badge-card.earned {
    background: var(--surface);
    border-color: var(--primary-blue);
}

.badge-card.unearned {
    opacity: 0.4;
    filter: grayscale(1);
}

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

.badge-tier {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: 2rem;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    background: var(--primary-blue);
    color: #fff;
    margin-top: 0.5rem;
}

.streak-display {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.2rem;
    font-weight: 700;
}

/* =========================================
   COMMENTS
   ========================================= */
.comments-section {
    margin-top: 3rem;
    border-top: 1px solid var(--border);
    padding-top: 2rem;
}

.comment {
    padding: 1rem 0;
    border-bottom: 1px solid var(--border);
}

.comment-reply {
    margin-left: 2rem;
    border-left: 2px solid var(--border);
    padding-left: 1rem;
}

.comment-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.comment-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--primary-blue);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.8rem;
    flex-shrink: 0;
}

.comment-meta {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.comment-actions {
    display: flex;
    gap: 1rem;
    margin-top: 0.5rem;
    font-size: 0.85rem;
}

.comment-actions button,
.comment-actions a {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0;
}

.comment-actions button:hover,
.comment-actions a:hover {
    color: var(--primary-blue);
}

.upvote-btn.voted {
    color: var(--primary-blue);
    font-weight: 600;
}

/* =========================================
   NOTIFICATIONS
   ========================================= */
.notification-bell {
    position: relative;
}

.notification-count {
    position: absolute;
    top: -5px;
    right: -8px;
    background: #dc3545;
    color: #fff;
    font-size: 0.65rem;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

.notification-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border);
}

.notification-item.unread {
    background: rgba(0, 61, 165, 0.05);
}

.notification-dot {
    width: 8px;
    height: 8px;
    background: var(--primary-blue);
    border-radius: 50%;
    flex-shrink: 0;
    margin-top: 0.5rem;
}

.notification-dot.read {
    background: transparent;
}

/* =========================================
   LAB STATUS
   ========================================= */
.lab-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.lab-card {
    padding: 1.5rem;
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

.lab-status-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
}

.lab-status-dot.up {
    background: #28a745;
}

.lab-status-dot.down {
    background: #dc3545;
}

.lab-status-dot.unknown {
    background: #6c757d;
}

/* =========================================
   EVENTS CALENDAR
   ========================================= */
.calendar-embed {
    width: 100%;
    border: none;
    height: 600px;
    border-radius: var(--radius);
}

.event-list {
    list-style: none;
    padding: 0;
}

.event-item {
    display: flex;
    gap: 1rem;
    padding: 1rem 0;
    border-bottom: 1px solid var(--border);
}

.event-date-badge {
    background: var(--primary-blue);
    color: #fff;
    padding: 0.5rem;
    border-radius: var(--radius);
    text-align: center;
    min-width: 60px;
}

.event-date-badge .day {
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1;
}

.event-date-badge .month {
    font-size: 0.75rem;
    text-transform: uppercase;
}

.event-type-badge {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: 2rem;
    font-size: 0.7rem;
    font-weight: 600;
}

/* =========================================
   PROJECT SHOWCASE
   ========================================= */
.project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.project-card {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
}

.project-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.project-card-thumb {
    height: 180px;
    background: var(--surface);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.project-card-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.project-card-body {
    padding: 1.25rem;
}

.project-links {
    display: flex;
    gap: 0.75rem;
    margin-top: 1rem;
}

/* =========================================
   RATING WIDGET
   ========================================= */
.rating-widget {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 1.5rem 0;
}

.stars {
    display: flex;
    gap: 0.25rem;
}

.star {
    font-size: 1.5rem;
    color: var(--border);
    cursor: pointer;
    transition: color 0.15s;
}

.star.star-filled {
    color: #f5a623;
}

.star:hover,
.star.star-hover {
    color: #f5a623;
}

.rating-count {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.feedback-section {
    margin-top: 1rem;
    padding: 1rem;
    background: var(--surface);
    border-radius: var(--radius);
}

.feedback-types {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.feedback-type-btn {
    padding: 0.25rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: 2rem;
    background: transparent;
    cursor: pointer;
    font-size: 0.85rem;
}

.feedback-type-btn.selected {
    background: var(--primary-blue);
    color: #fff;
    border-color: var(--primary-blue);
}

/* =========================================
   CHEAT SHEETS
   ========================================= */
.cheat-sheet-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1rem;
}

.cheat-sheet-card {
    padding: 1.25rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.language-badge {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: 2rem;
    font-size: 0.75rem;
    font-weight: 600;
    background: var(--primary-blue);
    color: #fff;
}

.language-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.shortcut-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.shortcut-table th,
.shortcut-table td {
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid var(--border);
    text-align: left;
}

.shortcut-table th {
    font-weight: 600;
    background: var(--surface);
}

.shortcut-table code {
    background: var(--surface);
    padding: 0.1rem 0.4rem;
    border-radius: 3px;
    font-size: 0.85em;
}

.two-column {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

@media (max-width: 768px) {
    .two-column {
        grid-template-columns: 1fr;
    }
}

/* =========================================
   ONBOARDING OVERLAY
   ========================================= */
.shepherd-element {
    max-width: 400px;
}

/* =========================================
   PRINT STYLES
   ========================================= */
@media print {
    .nav, .footer, .scroll-progress, .skip-nav,
    .page-actions, .back-to-top, .toast-container,
    .breadcrumb, .related-section, .tag-list,
    .pagination, .filter-bar, .filter-active {
        display: none !important;
    }

    body {
        font-size: 12pt;
        color: #000;
        background: #fff;
    }

    .page-header {
        background: none !important;
        color: #000 !important;
        padding: 1rem 0 !important;
        min-height: auto !important;
    }

    .page-header h1 {
        color: #000 !important;
        font-size: 18pt;
    }

    .page-content {
        max-width: 100%;
        padding: 0;
    }

    .toc {
        border: 1px solid #ccc;
        page-break-after: always;
    }

    .code-block {
        border: 1px solid #ccc;
        page-break-inside: avoid;
    }

    .code-block-header {
        background: #eee !important;
        color: #333 !important;
    }

    .code-copy-btn {
        display: none !important;
    }

    .code-block pre {
        background: #f5f5f5 !important;
        color: #000 !important;
    }

    a[href]:after {
        content: none;
    }

    h2, h3 {
        page-break-after: avoid;
    }

    img {
        max-width: 100% !important;
        page-break-inside: avoid;
    }
}
