/* Styles of _CitizenshipLayout (moved out of the layout in phase 9.7 so they are cached). */
/* ═══════════════════════════════════════════════
   DESIGN TOKENS  (light theme defaults)
═══════════════════════════════════════════════ */
:root {
    /* Brand */
    --ep: #406882;
    --ep-dark: #2d4f64;
    --ep-light: #5a87a8;
    --ep-xlight: rgba(64, 104, 130, .10);
    --ep-xxlight: rgba(64, 104, 130, .05);

    /* Surfaces */
    --e-bg: #f0f4f7;
    --e-surface: #ffffff;
    --e-surface-2: #f7f9fb;
    --e-surface-3: #eef2f6;
    --e-border: #e2e8f0;
    --e-border-2: rgba(64, 104, 130, .12);

    /* Text */
    --e-text: #1e293b;
    --e-text-2: #334155;
    --e-text-muted: #64748b;
    --e-text-faint: #94a3b8;

    /* Shadows */
    --e-shadow-xs: 0 1px 3px rgba(0,0,0,.06);
    --e-shadow-sm: 0 2px 8px rgba(64,104,130,.08);
    --e-shadow: 0 4px 20px rgba(64,104,130,.12);
    --e-shadow-lg: 0 8px 40px rgba(64,104,130,.18);

    /* Layout */
    --e-nav-h: 62px;
    --e-r: 12px;
    --e-r-sm: 8px;
    --e-r-lg: 18px;
    --e-r-xl: 24px;
    --e-tr: .2s ease;
}

/* ═══════════════════════════════════════════════
   DARK THEME OVERRIDES
═══════════════════════════════════════════════ */
[data-edu-theme="dark"] {
    --e-bg: #0c1c29;
    --e-surface: #122233;
    --e-surface-2: #192e40;
    --e-surface-3: #20394f;
    --e-border: rgba(255,255,255,.07);
    --e-border-2: rgba(64, 104, 130, .25);

    --e-text: #e4edf5;
    --e-text-2: #b8cfdf;
    --e-text-muted: #7a9db5;
    --e-text-faint: #4d7189;

    --e-shadow-xs: 0 1px 3px rgba(0,0,0,.35);
    --e-shadow-sm: 0 2px 8px rgba(0,0,0,.40);
    --e-shadow: 0 4px 20px rgba(0,0,0,.45);
    --e-shadow-lg: 0 8px 40px rgba(0,0,0,.55);

    --ep-xlight: rgba(64, 104, 130, .18);
    --ep-xxlight: rgba(64, 104, 130, .09);
}

/* ═══════════════════════════════════════════════
   BASE
═══════════════════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    font-family: 'Pelak', 'Vazir', Tahoma, sans-serif;
    background: var(--e-bg);
    color: var(--e-text);
    min-height: 100vh;
    transition: background var(--e-tr), color var(--e-tr);
}

a { color: inherit; }
img { max-width: 100%; }

/* ═══════════════════════════════════════════════
   SCROLLBAR (thin branded)
═══════════════════════════════════════════════ */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--e-surface-2); }
::-webkit-scrollbar-thumb { background: var(--ep-light); border-radius: 6px; }

/* ═══════════════════════════════════════════════
   TOP NAVBAR
═══════════════════════════════════════════════ */
.edu-nav {
    height: var(--e-nav-h);
    background: var(--e-surface);
    border-bottom: 1px solid var(--e-border);
    position: sticky;
    top: 0;
    z-index: 1030;
    box-shadow: var(--e-shadow-xs);
    transition: background var(--e-tr), border-color var(--e-tr), box-shadow var(--e-tr);
}

.edu-nav-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
    padding: 0 1.25rem;
}

/* Brand */
.edu-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}
.edu-brand-icon {
    width: 38px; height: 38px;
    background: var(--ep);
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-size: 19px;
    flex-shrink: 0;
    box-shadow: 0 3px 10px rgba(64,104,130,.35);
    transition: transform .2s;
}
.edu-brand:hover .edu-brand-icon { transform: scale(1.06); }
.edu-brand-text {
    font-weight: 700;
    font-size: .9rem;
    color: var(--e-text);
    transition: color var(--e-tr);
}

/* Center nav links */
.edu-nav-links {
    display: flex;
    align-items: center;
    gap: 2px;
}
.edu-nav-link {
    display: flex;
    align-items: center;
    gap: 5px;
    color: var(--e-text-muted);
    text-decoration: none;
    font-size: .865rem;
    font-weight: 500;
    padding: 6px 13px;
    border-radius: var(--e-r-sm);
    transition: background .15s, color .15s;
    white-space: nowrap;
}
.edu-nav-link:hover { background: var(--ep-xlight); color: var(--ep); }
.edu-nav-link.active { background: var(--ep-xlight); color: var(--ep); font-weight: 600; }

/* Nav actions group */
.edu-nav-actions { display: flex; align-items: center; gap: 8px; }

/* Theme toggle */
.edu-theme-btn {
    width: 36px; height: 36px;
    border: 1.5px solid var(--e-border);
    border-radius: 50%;
    background: var(--e-surface-2);
    color: var(--e-text-muted);
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    transition: all .15s;
    font-size: 15px;
    flex-shrink: 0;
}
.edu-theme-btn:hover {
    background: var(--ep-xlight);
    color: var(--ep);
    border-color: var(--ep);
}

/* User avatar */
.edu-avatar {
    width: 34px; height: 34px;
    border-radius: 50%;
    background: var(--ep);
    color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-size: .78rem; font-weight: 700;
    flex-shrink: 0;
    letter-spacing: .02em;
}

/* Dropdown override for dark mode */
.dropdown-menu {
    background: var(--e-surface);
    border: 1px solid var(--e-border);
    box-shadow: var(--e-shadow);
    border-radius: var(--e-r);
    transition: background var(--e-tr), border-color var(--e-tr);
}
.dropdown-item {
    color: var(--e-text-2);
    font-size: .865rem;
    border-radius: var(--e-r-sm);
    margin: 1px 4px;
    padding: 7px 12px;
    transition: background .12s, color .12s;
}
.dropdown-item:hover { background: var(--ep-xlight); color: var(--ep); }
.dropdown-divider { border-color: var(--e-border); margin: 4px 0; }

/* Mobile menu button */
.edu-hamburger {
    width: 36px; height: 36px;
    border: 1.5px solid var(--e-border);
    border-radius: var(--e-r-sm);
    background: var(--e-surface-2);
    color: var(--e-text-muted);
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; font-size: 18px;
    transition: all .15s;
}
.edu-hamburger:hover { background: var(--ep-xlight); color: var(--ep); }

/* ═══════════════════════════════════════════════
   MOBILE OFFCANVAS
═══════════════════════════════════════════════ */
.offcanvas {
    background: var(--e-surface);
    border-color: var(--e-border);
    transition: background var(--e-tr);
}
.offcanvas-header { border-bottom: 1px solid var(--e-border); }
.offcanvas-title { color: var(--e-text); }
.btn-close { filter: none; }
[data-edu-theme="dark"] .btn-close { filter: invert(1) grayscale(1); }

.mobile-nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--e-text-2);
    text-decoration: none;
    padding: 11px 14px;
    border-radius: var(--e-r-sm);
    font-size: .9rem;
    font-weight: 500;
    transition: background .12s, color .12s;
    margin-bottom: 2px;
}
.mobile-nav-link:hover { background: var(--ep-xlight); color: var(--ep); }
.mobile-nav-link i { font-size: 18px; color: var(--ep); }

/* ═══════════════════════════════════════════════
   CARDS
═══════════════════════════════════════════════ */
.edu-card {
    background: var(--e-surface);
    border: 1px solid var(--e-border);
    border-radius: var(--e-r);
    box-shadow: var(--e-shadow-xs);
    transition: background var(--e-tr), border-color var(--e-tr),
                box-shadow .2s, transform .2s;
}
.edu-card-hover:hover {
    box-shadow: var(--e-shadow-lg);
    transform: translateY(-3px);
    border-color: var(--e-border-2);
}

/* Course thumbnail */
.edu-thumb {
    position: relative;
    border-radius: var(--e-r) var(--e-r) 0 0;
    overflow: hidden;
    background: var(--ep-xlight);
}
.edu-thumb img {
    width: 100%; height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .35s ease;
}
.edu-card-hover:hover .edu-thumb img { transform: scale(1.04); }
.edu-thumb-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--ep);
    opacity: .25;
}

/* ═══════════════════════════════════════════════
   BUTTONS
═══════════════════════════════════════════════ */
.btn-edu {
    background: var(--ep);
    color: #fff;
    border: none;
    border-radius: var(--e-r-sm);
    padding: 8px 20px;
    font-size: .875rem;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s, box-shadow .15s, transform .1s;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.btn-edu:hover {
    background: var(--ep-dark);
    color: #fff;
    box-shadow: 0 4px 14px rgba(64,104,130,.35);
}
.btn-edu:active { transform: scale(.98); }

.btn-edu-outline {
    background: transparent;
    color: var(--ep);
    border: 1.5px solid var(--ep);
    border-radius: var(--e-r-sm);
    padding: 7px 18px;
    font-size: .875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all .15s;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.btn-edu-outline:hover { background: var(--ep); color: #fff; }

.btn-edu-ghost {
    background: var(--ep-xlight);
    color: var(--ep);
    border: none;
    border-radius: var(--e-r-sm);
    padding: 7px 16px;
    font-size: .875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all .15s;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.btn-edu-ghost:hover { background: var(--ep-xlight); color: var(--ep-dark); box-shadow: var(--e-shadow-sm); }

/* Override Bootstrap btn-primary to use brand color */
.btn-primary { background: var(--ep) !important; border-color: var(--ep) !important; }
.btn-primary:hover { background: var(--ep-dark) !important; border-color: var(--ep-dark) !important; }
.btn-outline-primary { color: var(--ep) !important; border-color: var(--ep) !important; }
.btn-outline-primary:hover { background: var(--ep) !important; border-color: var(--ep) !important; color: #fff !important; }

/* ═══════════════════════════════════════════════
   BADGES
═══════════════════════════════════════════════ */
.edu-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: .75rem;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 20px;
    letter-spacing: .01em;
}
.edu-badge-brand {
    background: var(--ep-xlight);
    color: var(--ep);
}

/* ═══════════════════════════════════════════════
   PROGRESS
═══════════════════════════════════════════════ */
.edu-progress {
    height: 6px;
    border-radius: 20px;
    background: var(--e-surface-3);
    overflow: hidden;
    transition: background var(--e-tr);
}
.edu-progress-bar {
    height: 100%;
    border-radius: 20px;
    background: var(--ep);
    transition: width .5s ease;
}
.edu-progress-bar.success { background: #16a34a; }

/* ═══════════════════════════════════════════════
   SECTION HELPERS
═══════════════════════════════════════════════ */
.edu-section-label {
    font-size: .75rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--ep);
    margin-bottom: 4px;
}
.edu-section-title {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--e-text);
    margin-bottom: 0;
    line-height: 1.3;
}
.edu-divider {
    border: none;
    border-top: 1px solid var(--e-border);
    margin: 0;
    transition: border-color var(--e-tr);
}

/* ═══════════════════════════════════════════════
   STAT CHIP
═══════════════════════════════════════════════ */
.edu-stat {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: .8rem;
    color: var(--e-text-muted);
    font-weight: 500;
    transition: color var(--e-tr);
}
.edu-stat i { font-size: 14px; }

/* ═══════════════════════════════════════════════
   FORM CONTROLS
═══════════════════════════════════════════════ */
.edu-input {
    background: var(--e-surface);
    border: 1.5px solid var(--e-border);
    border-radius: var(--e-r-sm);
    color: var(--e-text);
    padding: 9px 14px;
    font-size: .875rem;
    font-family: inherit;
    transition: border-color .15s, box-shadow .15s, background var(--e-tr), color var(--e-tr);
    width: 100%;
}
.edu-input:focus {
    outline: none;
    border-color: var(--ep);
    box-shadow: 0 0 0 3px rgba(64,104,130,.15);
    background: var(--e-surface);
}
.edu-input::placeholder { color: var(--e-text-faint); }

/* ═══════════════════════════════════════════════
   PAGE CONTENT
═══════════════════════════════════════════════ */
.edu-content {
    min-height: calc(100vh - var(--e-nav-h));
}

/* ═══════════════════════════════════════════════
   SIDEBAR SCROLL SNAP (for Learn page)
═══════════════════════════════════════════════ */
.edu-learn-sidebar {
    background: var(--e-surface);
    border-left: 1px solid var(--e-border);
    transition: background var(--e-tr), border-color var(--e-tr);
}
[data-edu-theme="dark"] .edu-learn-sidebar {
    background: #0c1c29;
    border-left-color: rgba(255,255,255,.06);
}

/* ═══════════════════════════════════════════════
   CATEGORY PILL (index page)
═══════════════════════════════════════════════ */
.cat-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: .82rem;
    font-weight: 600;
    white-space: nowrap;
    text-decoration: none;
    border: 1.5px solid var(--e-border);
    background: var(--e-surface);
    color: var(--e-text-muted);
    transition: all .15s;
    cursor: pointer;
}
.cat-pill:hover { border-color: var(--ep); color: var(--ep); background: var(--ep-xlight); }
.cat-pill.active { border-color: var(--ep); color: var(--ep); background: var(--ep-xlight); font-weight: 700; }

/* ═══════════════════════════════════════════════
   HORIZONTAL SCROLL ROW
═══════════════════════════════════════════════ */
.h-scroll {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 4px;
    scrollbar-width: none;
}
.h-scroll::-webkit-scrollbar { display: none; }

/* ═══════════════════════════════════════════════
   HERO
═══════════════════════════════════════════════ */
.edu-hero {
    background: linear-gradient(135deg, #406882 0%, #2d4f64 60%, #1e3547 100%);
    position: relative;
    overflow: hidden;
}
.edu-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.04'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    pointer-events: none;
}
.edu-hero-content { position: relative; z-index: 1; }

/* ═══════════════════════════════════════════════
   SEARCH BOX (hero)
═══════════════════════════════════════════════ */
.edu-search-wrap {
    background: rgba(255,255,255,.12);
    border: 1.5px solid rgba(255,255,255,.25);
    border-radius: 40px;
    display: flex;
    align-items: center;
    overflow: hidden;
    backdrop-filter: blur(4px);
    max-width: 520px;
    transition: border-color .2s, box-shadow .2s;
}
.edu-search-wrap:focus-within {
    border-color: rgba(255,255,255,.6);
    box-shadow: 0 0 0 3px rgba(255,255,255,.12);
}
.edu-search-wrap input {
    flex: 1;
    background: transparent;
    border: none;
    color: #fff;
    padding: 11px 16px;
    font-size: .9rem;
    font-family: inherit;
}
.edu-search-wrap input::placeholder { color: rgba(255,255,255,.55); }
.edu-search-wrap input:focus { outline: none; }
.edu-search-wrap button {
    background: #fff;
    color: var(--ep-dark);
    border: none;
    padding: 8px 18px;
    margin: 4px;
    border-radius: 30px;
    font-size: .85rem;
    font-weight: 700;
    cursor: pointer;
    transition: opacity .15s;
    font-family: inherit;
}
.edu-search-wrap button:hover { opacity: .9; }

/* ═══════════════════════════════════════════════
   EMPTY STATE
═══════════════════════════════════════════════ */
.edu-empty {
    text-align: center;
    padding: 64px 24px;
    color: var(--e-text-muted);
}
.edu-empty i { font-size: 56px; opacity: .3; display: block; margin-bottom: 16px; }
.edu-empty h5 { color: var(--e-text-2); font-weight: 600; margin-bottom: 8px; }
.edu-empty p { font-size: .9rem; margin-bottom: 20px; }

/* ═══════════════════════════════════════════════
   MISC OVERRIDES
═══════════════════════════════════════════════ */
.text-brand { color: var(--ep) !important; }
.bg-brand { background: var(--ep) !important; }
.border-brand { border-color: var(--ep) !important; }

/* Fix Bootstrap card/table in dark mode */
[data-edu-theme="dark"] .card { background: var(--e-surface); border-color: var(--e-border); }
[data-edu-theme="dark"] .table { color: var(--e-text); }
[data-edu-theme="dark"] .form-control, [data-edu-theme="dark"] .form-select {
    background: var(--e-surface-2);
    color: var(--e-text);
    border-color: var(--e-border);
}
[data-edu-theme="dark"] .alert { border: 1px solid var(--e-border); }
[data-edu-theme="dark"] .modal-content { background: var(--e-surface); color: var(--e-text); border-color: var(--e-border); }
[data-edu-theme="dark"] .modal-header, [data-edu-theme="dark"] .modal-footer { border-color: var(--e-border); }

/* Smooth all transitions on theme switch */
*, *::before, *::after {
    transition-property: background-color, border-color, color;
    transition-duration: var(--e-tr);
    transition-timing-function: ease;
}
/* But NOT layout/transform transitions (prevent jank) */
.edu-card-hover, .edu-card-hover * { transition: all .2s ease; }
