/* ============================================
   GUFRAN OUTLOOK — Main Stylesheet v3.0
   Light Mode Default + Dark Mode Toggle
   ============================================ */

/* ── Google Fonts ── */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&family=Playfair+Display:ital,wght@0,400;0,500;0,600;0,700;0,800;1,400;1,700&family=JetBrains+Mono:wght@400;500&display=swap');

/* ════════════════════════════════
   LIGHT MODE (Default)
   ════════════════════════════════ */
:root {
    /* Brand Colors */
    --primary:        #2563eb;
    --primary-light:  #3b82f6;
    --primary-dark:   #1d4ed8;
    --primary-50:     #eff6ff;
    --primary-100:    #dbeafe;
    --primary-200:    #bfdbfe;
    --primary-300:    #93c5fd;
    --primary-400:    #60a5fa;
    --primary-500:    #3b82f6;
    --primary-600:    #2563eb;
    --primary-700:    #1d4ed8;
    --primary-800:    #1e40af;
    --primary-900:    #1e3a8a;

    /* Backgrounds */
    --bg-body:        #f8fafc;
    --bg-card:        #ffffff;
    --bg-card-hover:  #f1f5f9;
    --bg-navbar:      rgba(255,255,255,0.9);
    --bg-footer:      #0f172a;
    --bg-hero:        #0f172a;

    /* Text */
    --text-primary:   #0f172a;
    --text-secondary: #334155;
    --text-muted:     #64748b;
    --text-white:     #ffffff;
    --text-link:      #2563eb;

    /* Borders */
    --border-color:   #e2e8f0;
    --border-light:   #f1f5f9;

    /* Surfaces (for cards/widgets) */
    --surface-1:      #ffffff;
    --surface-2:      #f8fafc;
    --surface-3:      #f1f5f9;

    /* Accents */
    --success:        #16a34a;
    --warning:        #d97706;
    --danger:         #dc2626;
    --info:           #0891b2;

    /* Typography */
    --font-heading:   'Playfair Display', Georgia, serif;
    --font-body:      'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono:      'JetBrains Mono', 'Fira Code', monospace;

    --font-size-xs:   0.75rem;
    --font-size-sm:   0.875rem;
    --font-size-base: 1rem;
    --font-size-lg:   1.125rem;
    --font-size-xl:   1.25rem;
    --font-size-2xl:  1.5rem;
    --font-size-3xl:  1.875rem;
    --font-size-4xl:  2.25rem;
    --font-size-5xl:  3rem;

    /* Radii */
    --radius-sm:      6px;
    --radius:         10px;
    --radius-lg:      16px;
    --radius-xl:      24px;
    --radius-full:    9999px;

    /* Shadows */
    --shadow-sm:      0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    --shadow:         0 4px 6px -1px rgba(0,0,0,0.07), 0 2px 4px -2px rgba(0,0,0,0.05);
    --shadow-md:      0 10px 15px -3px rgba(0,0,0,0.08), 0 4px 6px -4px rgba(0,0,0,0.04);
    --shadow-lg:      0 20px 25px -5px rgba(0,0,0,0.10), 0 8px 10px -6px rgba(0,0,0,0.04);
    --shadow-card:    0 1px 3px rgba(0,0,0,0.06), 0 4px 16px rgba(0,0,0,0.06);

    /* Spacing */
    --space-1: 0.25rem; --space-2: 0.5rem;  --space-3: 0.75rem;
    --space-4: 1rem;    --space-5: 1.25rem; --space-6: 1.5rem;
    --space-8: 2rem;    --space-10: 2.5rem; --space-12: 3rem;
    --space-16: 4rem;   --space-20: 5rem;   --space-24: 6rem;

    /* Transitions */
    --transition-fast:   150ms ease;
    --transition:        250ms ease;
    --transition-slow:   350ms ease;

    /* Layout */
    --navbar-height:  70px;
    --reading-width:  720px;

    /* Z-index */
    --z-dropdown:   100;
    --z-sticky:     200;
    --z-fixed:      300;
    --z-modal-bg:   400;
    --z-modal:      500;
    --z-toast:      600;
}

/* ════════════════════════════════
   DARK MODE OVERRIDES
   ════════════════════════════════ */
body.dark-mode {
    --bg-body:        #0f172a;
    --bg-card:        #1e293b;
    --bg-card-hover:  #334155;
    --bg-navbar:      rgba(15,23,42,0.95);

    --text-primary:   #f1f5f9;
    --text-secondary: #cbd5e1;
    --text-muted:     #94a3b8;
    --text-link:      #60a5fa;

    --border-color:   #334155;
    --border-light:   #1e293b;

    --surface-1:      #1e293b;
    --surface-2:      #0f172a;
    --surface-3:      #334155;

    --primary-50:     rgba(37,99,235,0.15);
    --primary-100:    rgba(37,99,235,0.2);
    --primary-200:    rgba(37,99,235,0.3);

    --shadow-card:    0 1px 3px rgba(0,0,0,0.3), 0 4px 16px rgba(0,0,0,0.3);
    --shadow-md:      0 10px 15px -3px rgba(0,0,0,0.4), 0 4px 6px -4px rgba(0,0,0,0.3);
}

/* ── Reset ── */
*, *::before, *::after {
    margin: 0; padding: 0;
    box-sizing: border-box;
}

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

body {
    font-family: var(--font-body);
    font-size: var(--font-size-base);
    font-weight: 400;
    line-height: 1.7;
    color: var(--text-primary);
    background-color: var(--bg-body);
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
    transition: background-color 0.3s ease, color 0.3s ease;
}

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

a { color: var(--text-link); text-decoration: none; transition: color var(--transition-fast); }
a:hover { color: var(--primary-dark); }

h1,h2,h3,h4,h5,h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    line-height: 1.3;
    color: var(--text-primary);
    margin-bottom: var(--space-4);
}
h1 { font-size: var(--font-size-5xl); }
h2 { font-size: var(--font-size-4xl); }
h3 { font-size: var(--font-size-3xl); }
h4 { font-size: var(--font-size-2xl); }
h5 { font-size: var(--font-size-xl); }
h6 { font-size: var(--font-size-lg); }

p { margin-bottom: var(--space-4); color: var(--text-secondary); }

/* ── Utilities ── */
.fs-xs { font-size: var(--font-size-xs) !important; }
.fs-sm { font-size: var(--font-size-sm) !important; }
.fs-base { font-size: var(--font-size-base) !important; }
.font-heading { font-family: var(--font-heading) !important; }
.font-body { font-family: var(--font-body) !important; }

/* Background utilities */
.bg-gray-50 { background-color: var(--surface-2) !important; }
.bg-card     { background-color: var(--bg-card) !important; }
.bg-body-custom { background-color: var(--bg-body) !important; }

/* Max-width reading */
.max-w-reading { max-width: var(--reading-width); }

/* Text truncate multi-line */
.text-truncate-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.text-truncate-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Outline button */
.btn-outline-go {
    background: transparent;
    color: var(--primary) !important;
    border: 1.5px solid var(--primary);
    padding: var(--space-2) var(--space-5);
    border-radius: var(--radius-full);
    font-weight: 600;
    font-size: var(--font-size-sm);
    transition: all var(--transition);
    cursor: pointer;
    display: inline-flex; align-items: center; gap: var(--space-2);
    text-decoration: none;
}
.btn-outline-go:hover {
    background: var(--primary);
    color: #fff !important;
    transform: translateY(-1px);
}

/* Section padding */
.section-padding { padding: var(--space-16) 0; }
.text-primary-color { color: var(--primary) !important; }
.text-primary-400 { color: var(--primary-400) !important; }
.font-heading { font-family: var(--font-heading) !important; }
.font-body { font-family: var(--font-body) !important; }
.section-padding { padding: var(--space-16) 0; }
.text-primary-color { color: var(--primary) !important; }
.text-primary-400 { color: var(--primary-400) !important; }

/* Reading Progress */
.reading-progress {
    position: fixed; top: 0; left: 0;
    width: 0%; height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--primary-400));
    z-index: var(--z-toast);
    transition: width 100ms linear;
}

/* ════════════════════════════════
   NAVBAR
   ════════════════════════════════ */
.go-navbar {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: var(--navbar-height);
    background: var(--bg-navbar);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color);
    z-index: var(--z-fixed);
    transition: all var(--transition);
}

.go-navbar.scrolled {
    box-shadow: var(--shadow-md);
}

.go-navbar .navbar-brand {
    display: flex; align-items: center; gap: var(--space-3);
    font-family: var(--font-heading); font-weight: 700;
    color: var(--text-primary) !important; text-decoration: none;
}

.go-navbar .navbar-brand img { height: 38px; width: auto; }

.go-navbar .navbar-brand .brand-text {
    display: flex; flex-direction: column; line-height: 1.1;
}

.go-navbar .navbar-brand .brand-name {
    font-size: 1.1rem; font-weight: 800;
    color: var(--text-primary); letter-spacing: -0.01em;
}

.go-navbar .navbar-brand .brand-tagline {
    font-size: 0.6rem; font-weight: 400;
    color: var(--text-muted); font-family: var(--font-body);
    letter-spacing: 0.12em; text-transform: uppercase;
}

.go-navbar .nav-link {
    font-size: var(--font-size-sm); font-weight: 500;
    color: var(--text-secondary) !important;
    padding: var(--space-2) var(--space-3) !important;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
}

.go-navbar .nav-link:hover,
.go-navbar .nav-link.active {
    color: var(--primary) !important;
    background: var(--primary-50);
}

.navbar-actions { display: flex; align-items: center; gap: var(--space-2); }

.btn-nav-icon {
    width: 36px; height: 36px;
    display: flex; align-items: center; justify-content: center;
    border-radius: var(--radius); border: none;
    background: transparent; color: var(--text-muted);
    cursor: pointer; transition: all var(--transition-fast); font-size: 1rem;
}
.btn-nav-icon:hover { background: var(--surface-3); color: var(--primary); }

/* Theme Toggle */
.theme-toggle {
    position: relative; width: 36px; height: 36px;
    border-radius: var(--radius); border: none;
    background: var(--surface-3); cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    color: var(--text-muted); font-size: 1rem;
    transition: all var(--transition-fast);
}
.theme-toggle:hover { color: var(--primary); }

/* Light mode: show moon icon (to switch to dark) */
.theme-toggle .bi-moon-fill { display: inline; }
.theme-toggle .bi-sun-fill  { display: none; }

/* Dark mode: show sun icon (to switch to light) */
body.dark-mode .theme-toggle .bi-moon-fill { display: none; }
body.dark-mode .theme-toggle .bi-sun-fill  { display: inline; }

/* Primary Button */
.btn-primary-go {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: #fff !important; border: none;
    padding: var(--space-2) var(--space-6);
    border-radius: var(--radius-full);
    font-weight: 600; font-size: var(--font-size-sm);
    transition: all var(--transition);
    box-shadow: 0 2px 8px rgba(37,99,235,0.3);
    cursor: pointer; display: inline-flex; align-items: center; gap: var(--space-2);
}
.btn-primary-go:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(37,99,235,0.4);
    color: #fff !important;
}

/* User Dropdown Trigger */
.user-pill {
    display: flex; align-items: center; gap: var(--space-2);
    padding: 6px 12px 6px 6px;
    background: var(--surface-3);
    border-radius: var(--radius-full);
    border: 1px solid var(--border-color);
    cursor: pointer; text-decoration: none;
    transition: all var(--transition-fast);
}
.user-pill:hover { background: var(--primary-50); border-color: var(--primary-200); }

.user-pill .avatar {
    width: 26px; height: 26px;
    border-radius: 50%; background: var(--primary);
    color: #fff; font-size: 11px; font-weight: 700;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.user-pill .name { font-size: var(--font-size-sm); font-weight: 600; color: var(--text-primary); }

/* Dropdown Menu */
.dropdown-menu {
    background: var(--bg-card) !important;
    border: 1px solid var(--border-color) !important;
    box-shadow: var(--shadow-lg) !important;
    border-radius: var(--radius-lg) !important;
}
.dropdown-item { color: var(--text-secondary) !important; font-size: var(--font-size-sm); }
.dropdown-item:hover { background: var(--surface-3) !important; color: var(--primary) !important; }

/* Main content offset */
.main-content { padding-top: var(--navbar-height); }

/* ════════════════════════════════
   SEARCH MODAL
   ════════════════════════════════ */
.search-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.4);
    backdrop-filter: blur(8px);
    z-index: var(--z-modal-bg);
    opacity: 0; visibility: hidden;
    transition: all var(--transition);
}
.search-overlay.active { opacity: 1; visibility: visible; }

.search-modal {
    position: fixed; top: 15%; left: 50%;
    transform: translateX(-50%) translateY(-20px);
    width: 90%; max-width: 600px;
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    z-index: var(--z-modal);
    opacity: 0; visibility: hidden;
    transition: all var(--transition);
    overflow: hidden;
    border: 1px solid var(--border-color);
}
.search-modal.active {
    opacity: 1; visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.search-input-wrap {
    display: flex; align-items: center;
    padding: var(--space-4) var(--space-5);
    border-bottom: 1px solid var(--border-color);
    gap: var(--space-3);
}
.search-input-wrap i { font-size: 1.2rem; color: var(--text-muted); }
.search-input {
    flex: 1; border: none; outline: none;
    font-size: var(--font-size-lg); font-family: var(--font-body);
    color: var(--text-primary); background: transparent;
}
.search-input::placeholder { color: var(--text-muted); }
.search-kbd {
    display: inline-flex; align-items: center;
    padding: 2px 8px; font-size: var(--font-size-xs);
    background: var(--surface-3); border: 1px solid var(--border-color);
    border-radius: var(--radius-sm); color: var(--text-muted);
}
.search-suggestions { padding: var(--space-4) var(--space-5); }
.search-suggestion-item {
    display: flex; align-items: center; gap: var(--space-3);
    padding: var(--space-3) var(--space-3);
    border-radius: var(--radius-sm); cursor: pointer;
    transition: background var(--transition-fast);
    color: var(--text-secondary); font-size: var(--font-size-sm); font-weight: 500;
}
.search-suggestion-item:hover { background: var(--surface-3); }

/* ════════════════════════════════
   HERO SECTION
   ════════════════════════════════ */
.hero-section {
    background: var(--bg-hero);
    min-height: 88vh;
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
}

/* Subtle mesh gradient background */
.hero-section::before {
    content: '';
    position: absolute; inset: 0;
    background:
        radial-gradient(ellipse at 20% 50%, rgba(37,99,235,0.18) 0%, transparent 55%),
        radial-gradient(ellipse at 80% 20%, rgba(59,130,246,0.12) 0%, transparent 50%);
    z-index: 0;
}

.hero-section .container { position: relative; z-index: 1; }

.hero-badge {
    display: inline-flex; align-items: center; gap: var(--space-2);
    padding: 6px 14px;
    background: rgba(59,130,246,0.15);
    border: 1px solid rgba(59,130,246,0.3);
    border-radius: var(--radius-full);
    font-size: 11px; font-weight: 600;
    text-transform: uppercase; letter-spacing: 0.1em;
    color: var(--primary-300);
    margin-bottom: var(--space-6);
}

.hero-section h1 {
    font-size: clamp(2.4rem, 5vw, 3.8rem);
    font-weight: 800; color: #fff;
    line-height: 1.15; margin-bottom: var(--space-5);
    letter-spacing: -0.02em;
}

.hero-section h1 .accent { color: var(--primary-400); }

.hero-section p.lead {
    font-size: 1.1rem; color: #94a3b8;
    max-width: 500px; line-height: 1.75;
    margin-bottom: var(--space-8);
}

/* Hero Subscribe Form */
.hero-form {
    display: flex; gap: var(--space-3);
    max-width: 480px; margin-bottom: var(--space-8);
    flex-wrap: wrap;
}
.hero-form input[type="email"] {
    flex: 1; min-width: 200px;
    padding: 12px 20px;
    border: 1.5px solid rgba(255,255,255,0.15);
    border-radius: var(--radius-full);
    background: rgba(255,255,255,0.08);
    color: #fff; font-size: var(--font-size-sm);
    font-family: var(--font-body);
    outline: none; transition: border-color var(--transition-fast);
}
.hero-form input[type="email"]::placeholder { color: #64748b; }
.hero-form input[type="email"]:focus { border-color: var(--primary-400); }
.hero-form button {
    padding: 12px 28px;
    background: var(--primary);
    color: #fff; border: none;
    border-radius: var(--radius-full);
    font-weight: 600; font-size: var(--font-size-sm);
    cursor: pointer; white-space: nowrap;
    transition: all var(--transition);
}
.hero-form button:hover { background: var(--primary-dark); transform: translateY(-1px); }

/* Avatars row */
.reader-avatars { display: flex; align-items: center; gap: var(--space-3); }
.reader-avatars .avatars { display: flex; }
.reader-avatars .avatars img {
    width: 36px; height: 36px;
    border-radius: 50%;
    border: 2px solid var(--bg-hero);
    margin-right: -10px;
    object-fit: cover;
}
.reader-avatars .avatars img:last-child { margin-right: 0; }
.reader-text { font-size: var(--font-size-sm); }
.reader-text strong { color: #e2e8f0; display: block; }
.reader-text span { color: #64748b; font-size: var(--font-size-xs); }

/* Editor's Pick card */
.editors-pick-card {
    border-radius: var(--radius-xl);
    overflow: hidden;
    position: relative;
    min-height: 460px;
    cursor: pointer;
    display: block;
    text-decoration: none;
}
.editors-pick-card img {
    width: 100%; height: 100%;
    object-fit: cover; min-height: 460px;
    transition: transform var(--transition-slow);
    filter: brightness(0.75);
}
.editors-pick-card:hover img { transform: scale(1.04); }
.editors-pick-card .ep-badge {
    position: absolute; top: 16px; left: 16px;
    background: var(--primary); color: #fff;
    padding: 4px 12px; border-radius: var(--radius-full);
    font-size: 11px; font-weight: 700; letter-spacing: 0.5px;
    text-transform: uppercase; z-index: 2;
}
.editors-pick-card .ep-content {
    position: absolute; bottom: 0; left: 0; right: 0;
    padding: 28px;
    background: linear-gradient(to top, rgba(0,0,0,0.90) 0%, transparent 100%);
    z-index: 2;
}
.editors-pick-card .ep-cat {
    display: inline-block; padding: 3px 10px;
    background: rgba(255,255,255,0.15);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: var(--radius-full);
    font-size: 11px; font-weight: 600; color: #e2e8f0;
    text-transform: uppercase; letter-spacing: 0.5px;
    margin-bottom: 10px;
}
.editors-pick-card .ep-title {
    font-family: var(--font-heading); font-size: 1.5rem;
    font-weight: 700; color: #fff; line-height: 1.3;
    margin-bottom: 10px;
}
.editors-pick-card .ep-meta {
    display: flex; align-items: center; justify-content: space-between;
    color: rgba(255,255,255,0.6); font-size: var(--font-size-xs);
}

/* ════════════════════════════════
   FEATURES BAR
   ════════════════════════════════ */
.features-bar {
    background: var(--surface-1);
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
}
.feature-item {
    display: flex; align-items: center; gap: var(--space-3);
    padding: var(--space-5) var(--space-4);
}
.feature-item .icon {
    width: 42px; height: 42px;
    background: var(--primary-50); color: var(--primary);
    border-radius: var(--radius); display: flex;
    align-items: center; justify-content: center;
    font-size: 1.1rem; flex-shrink: 0;
}
.feature-item h6 { margin: 0 0 2px; font-size: var(--font-size-sm); font-family: var(--font-body); font-weight: 700; }
.feature-item p { margin: 0; font-size: 12px; color: var(--text-muted); line-height: 1.4; }

/* ════════════════════════════════
   SECTION HEADERS
   ════════════════════════════════ */
.section-label {
    display: block; font-size: 11px; font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.12em;
    color: var(--primary); margin-bottom: 6px;
}
.section-heading {
    font-family: var(--font-heading);
    font-size: clamp(1.6rem, 3vw, 2.2rem);
    font-weight: 800; color: var(--text-primary);
    margin: 0; line-height: 1.2;
}
.section-link-all {
    font-size: var(--font-size-sm); font-weight: 600;
    color: var(--primary); display: flex; align-items: center; gap: 4px;
    transition: gap var(--transition-fast);
}
.section-link-all:hover { gap: 8px; color: var(--primary-dark); }

/* Legacy section-header/title for compatibility */
.section-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: var(--space-8); flex-wrap: wrap; gap: var(--space-4);
}
.section-title {
    font-size: var(--font-size-3xl); font-weight: 800;
    position: relative; padding-left: var(--space-5); color: var(--text-primary);
}
.section-title::before {
    content: ''; position: absolute; left: 0; top: 50%;
    transform: translateY(-50%); width: 4px; height: 70%;
    background: linear-gradient(180deg, var(--primary), var(--primary-400));
    border-radius: 2px;
}
.section-link {
    font-size: var(--font-size-sm); font-weight: 600;
    color: var(--primary); display: flex; align-items: center; gap: 4px;
}
.section-link:hover { gap: 8px; }

/* ════════════════════════════════
   CATEGORY PILLS
   ════════════════════════════════ */
.cat-pill {
    display: flex; flex-direction: column; align-items: center;
    justify-content: center; text-align: center;
    padding: var(--space-5) var(--space-4);
    background: var(--surface-1);
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-xl);
    text-decoration: none;
    transition: all var(--transition);
    height: 100%;
}
.cat-pill:hover {
    border-color: var(--primary);
    background: var(--primary-50);
    transform: translateY(-3px);
    box-shadow: var(--shadow);
}
.cat-pill .cat-icon {
    width: 52px; height: 52px;
    background: var(--primary-50);
    color: var(--primary); border-radius: var(--radius-lg);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.4rem; margin-bottom: var(--space-3);
    transition: background var(--transition-fast);
}
.cat-pill:hover .cat-icon { background: var(--primary); color: #fff; }
.cat-pill .cat-name { font-size: var(--font-size-sm); font-weight: 700; color: var(--text-primary); margin-bottom: 2px; }
.cat-pill .cat-count { font-size: 11px; color: var(--text-muted); }

/* ════════════════════════════════
   BLOG CARD
   ════════════════════════════════ */
.blog-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid var(--border-color);
    transition: all var(--transition);
    height: 100%;
    display: flex;
    flex-direction: column;
}
.blog-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary-200);
}

.blog-card .card-img-wrap {
    position: relative; overflow: hidden; aspect-ratio: 16/10;
    background: var(--surface-3);
}
.blog-card .card-img-wrap img {
    width: 100%; height: 100%; object-fit: cover;
    transition: transform var(--transition-slow);
}
.blog-card:hover .card-img-wrap img { transform: scale(1.05); }

.blog-card .card-category {
    position: absolute; top: 12px; left: 12px;
    padding: 4px 10px;
    background: var(--primary); color: #fff;
    font-size: 10px; font-weight: 700;
    border-radius: var(--radius-full);
    text-transform: uppercase; letter-spacing: 0.05em; z-index: 2;
}

.blog-card .card-bookmark {
    position: absolute; top: 12px; right: 12px;
    width: 30px; height: 30px;
    display: flex; align-items: center; justify-content: center;
    background: rgba(255,255,255,0.92);
    backdrop-filter: blur(4px);
    border-radius: 50%; border: none;
    color: var(--text-muted);
    cursor: pointer; transition: all var(--transition-fast);
    opacity: 0; font-size: 14px;
}
.blog-card:hover .card-bookmark { opacity: 1; }
.blog-card .card-bookmark:hover { background: var(--primary); color: #fff; }

.blog-card .card-body {
    padding: var(--space-5);
    flex: 1; display: flex; flex-direction: column;
}

.blog-card .card-title {
    font-family: var(--font-heading);
    font-size: var(--font-size-xl); font-weight: 700;
    color: var(--text-primary); line-height: 1.35;
    margin-bottom: var(--space-3);
    display: -webkit-box; -webkit-line-clamp: 2;
    -webkit-box-orient: vertical; overflow: hidden;
}
.blog-card .card-title a { color: inherit; }
.blog-card .card-title a:hover { color: var(--primary); }

.blog-card .card-excerpt {
    font-size: var(--font-size-sm); color: var(--text-muted);
    line-height: 1.6; margin-bottom: var(--space-4);
    display: -webkit-box; -webkit-line-clamp: 3;
    -webkit-box-orient: vertical; overflow: hidden; flex: 1;
}

.blog-card .card-footer-meta {
    display: flex; align-items: center;
    justify-content: space-between;
    padding-top: var(--space-4);
    border-top: 1px solid var(--border-light);
    margin-top: auto;
}

.blog-card .card-author { display: flex; align-items: center; gap: var(--space-2); }
.blog-card .card-author img { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; }
.blog-card .card-author-name { font-size: 12px; font-weight: 600; color: var(--text-primary); }
.blog-card .card-date { font-size: 11px; color: var(--text-muted); }
.blog-card .card-stats { display: flex; gap: var(--space-3); font-size: 12px; color: var(--text-muted); }
.blog-card .card-stats span { display: flex; align-items: center; gap: 3px; }

/* Mini card */
.blog-card.mini {
    flex-direction: row; align-items: center;
    padding: var(--space-3); gap: var(--space-3);
    border-radius: var(--radius);
}
.blog-card.mini .card-img-wrap {
    width: 80px; min-width: 80px; height: 80px;
    aspect-ratio: 1; border-radius: var(--radius-sm);
}
.blog-card.mini .card-body { padding: 0; }
.blog-card.mini .card-title { font-size: var(--font-size-sm); -webkit-line-clamp: 2; margin-bottom: 4px; }

/* ════════════════════════════════
   NEWSLETTER SECTION
   ════════════════════════════════ */
.newsletter-box {
    background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 100%);
    border-radius: var(--radius-xl);
    padding: var(--space-12) var(--space-8);
    position: relative; overflow: hidden;
}
.newsletter-box::after {
    content: '';
    position: absolute; top: -80px; right: -60px;
    width: 280px; height: 280px;
    background: rgba(255,255,255,0.05);
    border-radius: 50%;
}
.newsletter-box h2 { color: #fff; font-size: 2rem; margin-bottom: var(--space-3); }
.newsletter-box p { color: rgba(255,255,255,0.75); margin-bottom: 0; font-size: var(--font-size-sm); }

.newsletter-form {
    display: flex; gap: var(--space-3);
    max-width: 480px; flex-wrap: wrap;
}
.newsletter-form input {
    flex: 1; min-width: 200px;
    padding: 12px 18px;
    border: 1.5px solid rgba(255,255,255,0.25);
    border-radius: var(--radius-full);
    background: rgba(255,255,255,0.12);
    color: #fff; font-size: var(--font-size-sm);
    font-family: var(--font-body); outline: none;
}
.newsletter-form input::placeholder { color: rgba(255,255,255,0.55); }
.newsletter-form input:focus { border-color: rgba(255,255,255,0.5); }
.newsletter-form button {
    padding: 12px 28px; background: #fff;
    color: var(--primary); border: none;
    border-radius: var(--radius-full);
    font-weight: 700; font-size: var(--font-size-sm);
    cursor: pointer; white-space: nowrap;
    transition: all var(--transition);
}
.newsletter-form button:hover { transform: translateY(-1px); box-shadow: 0 4px 16px rgba(0,0,0,0.15); }

/* ════════════════════════════════
   SIDEBAR WIDGETS
   ════════════════════════════════ */
.sidebar-widget {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: var(--space-6);
    border: 1px solid var(--border-color);
    margin-bottom: var(--space-6);
}
.sidebar-widget .widget-title {
    font-family: var(--font-body);
    font-size: var(--font-size-base); font-weight: 700;
    margin-bottom: var(--space-5);
    padding-bottom: var(--space-3);
    border-bottom: 2px solid var(--primary);
    color: var(--text-primary); display: inline-block;
}
.sidebar-widget .widget-search { position: relative; }
.sidebar-widget .widget-search input {
    width: 100%; padding: var(--space-3) var(--space-4); padding-right: 44px;
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius); font-family: var(--font-body);
    font-size: var(--font-size-sm); color: var(--text-primary);
    background: var(--bg-body); outline: none; transition: all var(--transition-fast);
}
.sidebar-widget .widget-search input:focus { border-color: var(--primary); }
.sidebar-widget .widget-search button {
    position: absolute; right: 8px; top: 50%;
    transform: translateY(-50%); background: none; border: none;
    color: var(--text-muted); cursor: pointer; padding: var(--space-2);
}
.sidebar-widget .category-list { list-style: none; }
.sidebar-widget .category-list li {
    display: flex; justify-content: space-between; align-items: center;
    padding: var(--space-3) 0; border-bottom: 1px solid var(--border-light);
}
.sidebar-widget .category-list li:last-child { border-bottom: none; }
.sidebar-widget .category-list li a {
    color: var(--text-secondary); font-size: var(--font-size-sm);
    font-weight: 500; transition: color var(--transition-fast);
}
.sidebar-widget .category-list li a:hover { color: var(--primary); }
.sidebar-widget .category-list li .count {
    font-size: 11px; color: var(--text-muted);
    background: var(--surface-3); padding: 2px 8px;
    border-radius: var(--radius-full);
}
.tags-cloud { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.tag-pill {
    display: inline-flex; align-items: center;
    padding: 4px 12px; background: var(--surface-3);
    color: var(--text-secondary); font-size: 12px; font-weight: 500;
    border-radius: var(--radius-full); transition: all var(--transition-fast);
    border: 1px solid var(--border-color);
}
.tag-pill:hover { background: var(--primary-50); color: var(--primary); border-color: var(--primary-200); }

/* ════════════════════════════════
   FOOTER
   ════════════════════════════════ */
.go-footer {
    background: #0f172a;
    padding: var(--space-16) 0 0;
    color: #94a3b8;
}
.go-footer h5 { color: #f1f5f9; font-family: var(--font-body); font-size: var(--font-size-base); font-weight: 700; margin-bottom: var(--space-4); }
.go-footer p { color: #94a3b8; font-size: var(--font-size-sm); line-height: 1.7; }
.go-footer a { color: #64748b; font-size: var(--font-size-sm); transition: color var(--transition-fast); }
.go-footer a:hover { color: #f1f5f9; }
.footer-brand { display: flex; align-items: center; gap: var(--space-3); margin-bottom: var(--space-4); }
.footer-brand img { height: 34px; }
.footer-brand span { font-family: var(--font-heading); font-weight: 700; font-size: var(--font-size-lg); color: #f1f5f9; }
.footer-links { list-style: none; }
.footer-links li { margin-bottom: var(--space-2); }
.footer-links a { display: flex; align-items: center; gap: var(--space-2); }
.footer-links a:hover { color: #f1f5f9; padding-left: 4px; }
.footer-social { display: flex; gap: var(--space-3); margin-top: var(--space-4); }
.footer-social a {
    width: 36px; height: 36px; display: flex; align-items: center; justify-content: center;
    border-radius: 50%; background: rgba(255,255,255,0.07); color: #64748b;
    transition: all var(--transition-fast);
}
.footer-social a:hover { background: var(--primary); color: #fff; transform: translateY(-2px); }
.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.07);
    padding: var(--space-5) 0; margin-top: var(--space-10);
    display: flex; justify-content: space-between;
    align-items: center; flex-wrap: wrap; gap: var(--space-4);
    font-size: 12px; color: #475569;
}
.footer-bottom-links { display: flex; gap: var(--space-4); }
.footer-bottom-links a { color: #475569; font-size: 12px; }
.footer-bottom-links a:hover { color: #94a3b8; }

/* ════════════════════════════════
   ARTICLE / SINGLE POST
   ════════════════════════════════ */
.article-header {
    text-align: center; padding: var(--space-12) 0 var(--space-8);
    max-width: var(--reading-width); margin: 0 auto;
}
.article-header .article-category {
    display: inline-block; padding: 4px 14px;
    background: var(--primary-50); color: var(--primary);
    font-size: 11px; font-weight: 600; border-radius: var(--radius-full);
    text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: var(--space-4);
}
.article-header h1 { font-size: clamp(1.8rem, 4vw, 2.8rem); line-height: 1.2; margin-bottom: var(--space-4); }
.article-meta {
    display: flex; align-items: center; justify-content: center;
    gap: var(--space-4); font-size: var(--font-size-sm); color: var(--text-muted); flex-wrap: wrap;
}
.article-meta img { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; }
.article-meta .meta-item { display: flex; align-items: center; gap: var(--space-2); }
.article-featured-img { border-radius: var(--radius-xl); overflow: hidden; margin-bottom: var(--space-10); aspect-ratio: 21/9; }
.article-featured-img img { width: 100%; height: 100%; object-fit: cover; }

.article-body {
    max-width: var(--reading-width); margin: 0 auto;
    font-size: var(--font-size-lg); line-height: 1.85; color: var(--text-secondary);
}
.article-body h2 { margin-top: var(--space-10); margin-bottom: var(--space-4); font-size: var(--font-size-3xl); }
.article-body h3 { margin-top: var(--space-8); margin-bottom: var(--space-3); font-size: var(--font-size-2xl); }
.article-body p { margin-bottom: var(--space-6); }
.article-body blockquote {
    border-left: 4px solid var(--primary); padding: var(--space-4) var(--space-6);
    margin: var(--space-8) 0; background: var(--primary-50);
    border-radius: 0 var(--radius) var(--radius) 0;
    font-style: italic; color: var(--primary-dark);
}
.article-body pre {
    background: #0f172a; color: #e2e8f0;
    padding: var(--space-6); border-radius: var(--radius);
    overflow-x: auto; font-family: var(--font-mono);
    font-size: var(--font-size-sm); margin: var(--space-8) 0;
}
.article-body code {
    font-family: var(--font-mono); background: var(--surface-3);
    padding: 2px 6px; border-radius: 4px; font-size: 0.9em; color: var(--danger);
}
.article-body pre code { background: none; padding: 0; color: inherit; }

.article-actions {
    display: flex; align-items: center; justify-content: center;
    gap: var(--space-4); padding: var(--space-8) 0;
    border-top: 1px solid var(--border-color); border-bottom: 1px solid var(--border-color);
    margin: var(--space-8) auto; max-width: var(--reading-width);
}
.action-btn {
    display: flex; align-items: center; gap: var(--space-2);
    padding: var(--space-2) var(--space-4);
    border: 1.5px solid var(--border-color); border-radius: var(--radius-full);
    background: transparent; color: var(--text-secondary);
    cursor: pointer; font-size: var(--font-size-sm); font-weight: 500;
    font-family: var(--font-body); transition: all var(--transition-fast);
}
.action-btn:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-50); }
.action-btn.liked { border-color: #dc2626; color: #dc2626; background: #fef2f2; }
.action-btn.bookmarked { border-color: #d97706; color: #d97706; background: #fffbeb; }

/* Author Bio */
.author-bio-card {
    display: flex; gap: var(--space-6); padding: var(--space-8);
    background: var(--surface-2); border-radius: var(--radius-lg);
    margin: var(--space-10) auto; max-width: var(--reading-width);
    align-items: flex-start; border: 1px solid var(--border-color);
}
.author-bio-card img { width: 80px; height: 80px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.author-bio-card h4 { font-family: var(--font-body); margin-bottom: var(--space-2); }
.author-bio-card p { font-size: var(--font-size-sm); margin-bottom: var(--space-3); }

/* Comments */
.comment-card {
    display: flex; gap: var(--space-4); padding: var(--space-5);
    margin-bottom: var(--space-4); border-radius: var(--radius);
    background: var(--bg-card); border: 1px solid var(--border-light);
}
.comment-card.reply { margin-left: var(--space-12); background: var(--surface-2); }
.comment-card img { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.comment-author { font-weight: 600; font-size: var(--font-size-sm); color: var(--text-primary); }
.comment-date { font-size: 11px; color: var(--text-muted); }
.comment-text { font-size: var(--font-size-sm); color: var(--text-secondary); line-height: 1.6; margin-bottom: var(--space-2); }
.comment-form textarea {
    width: 100%; min-height: 120px; padding: var(--space-4);
    border: 1.5px solid var(--border-color); border-radius: var(--radius);
    font-family: var(--font-body); font-size: var(--font-size-sm);
    color: var(--text-primary); background: var(--bg-card);
    resize: vertical; outline: none; transition: all var(--transition-fast);
}
.comment-form textarea:focus { border-color: var(--primary); }

/* Pagination */
.pagination-wrap { display: flex; justify-content: center; gap: var(--space-2); padding: var(--space-8) 0; }
.page-btn {
    width: 40px; height: 40px; display: flex; align-items: center; justify-content: center;
    border: 1.5px solid var(--border-color); border-radius: var(--radius-sm);
    background: var(--bg-card); color: var(--text-secondary);
    font-weight: 500; font-size: var(--font-size-sm); cursor: pointer;
    transition: all var(--transition-fast); text-decoration: none;
}
.page-btn:hover, .page-btn.active {
    background: var(--primary); color: #fff; border-color: var(--primary);
}

/* Back to top */
.back-to-top {
    position: fixed; bottom: var(--space-6); right: var(--space-6);
    width: 44px; height: 44px; display: flex; align-items: center; justify-content: center;
    background: var(--primary); color: #fff; border: none; border-radius: 50%;
    cursor: pointer; box-shadow: var(--shadow-md);
    opacity: 0; visibility: hidden; transform: translateY(10px);
    transition: all var(--transition); z-index: var(--z-sticky);
}
.back-to-top.visible { opacity: 1; visibility: visible; transform: translateY(0); }
.back-to-top:hover { background: var(--primary-dark); transform: translateY(-2px); }

/* Toast */
.toast-container {
    position: fixed; top: calc(var(--navbar-height) + 16px); right: 16px;
    z-index: var(--z-toast); display: flex; flex-direction: column; gap: var(--space-3);
}
.go-toast {
    display: flex; align-items: center; gap: var(--space-3);
    padding: var(--space-3) var(--space-5);
    background: var(--bg-card); color: var(--text-primary);
    border-radius: var(--radius); box-shadow: var(--shadow-lg);
    border-left: 4px solid var(--primary); min-width: 300px;
    transform: translateX(120%); transition: transform 350ms cubic-bezier(0.34,1.56,0.64,1);
}
.go-toast.show { transform: translateX(0); }
.go-toast.success { border-left-color: #16a34a; }
.go-toast.warning { border-left-color: #d97706; }
.go-toast.error   { border-left-color: #dc2626; }

/* ════════════════════════════════
   ABOUT / CONTACT / AUTH PAGES
   ════════════════════════════════ */
.about-hero {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary));
    padding: var(--space-24) 0 var(--space-16); color: #fff; text-align: center;
}
.about-hero h1 { color: #fff; }
.about-hero p { color: rgba(255,255,255,0.8); max-width: 600px; margin: 0 auto; }

.stat-counter { text-align: center; padding: var(--space-8) var(--space-4); }
.stat-counter .count { font-family: var(--font-heading); font-size: var(--font-size-5xl); font-weight: 800; color: var(--primary); line-height: 1; margin-bottom: var(--space-2); }
.stat-counter .label { font-size: var(--font-size-sm); color: var(--text-muted); font-weight: 500; text-transform: uppercase; letter-spacing: 0.05em; }

.team-card, .contact-card {
    text-align: center; padding: var(--space-6);
    border-radius: var(--radius-lg); background: var(--bg-card);
    border: 1px solid var(--border-color); transition: all var(--transition);
}
.team-card:hover, .contact-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.team-card img { width: 100px; height: 100px; border-radius: 50%; object-fit: cover; margin: 0 auto var(--space-4); border: 3px solid var(--primary-100); }
.team-card h5 { font-family: var(--font-body); margin-bottom: 4px; }
.team-card .role { font-size: var(--font-size-sm); color: var(--primary); font-weight: 500; }
.contact-card .icon { width: 56px; height: 56px; display: flex; align-items: center; justify-content: center; background: var(--primary-50); color: var(--primary); border-radius: 50%; font-size: 1.3rem; margin: 0 auto var(--space-4); }

.contact-form .form-control {
    background: var(--bg-body); color: var(--text-primary);
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius); font-family: var(--font-body);
    font-size: var(--font-size-sm); transition: all var(--transition-fast);
}
.contact-form .form-control:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-100); }

/* ════════════════════════════════
   SKELETON LOADING
   ════════════════════════════════ */
.skeleton {
    background: linear-gradient(90deg, var(--surface-3) 25%, var(--border-color) 50%, var(--surface-3) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s ease-in-out infinite;
    border-radius: var(--radius-sm);
}
@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}
.skeleton-text { height: 14px; margin-bottom: 8px; }

/* ════════════════════════════════
   DARK MODE COMPONENT FIXES
   ════════════════════════════════ */
body.dark-mode .search-modal { background: var(--bg-card); border-color: var(--border-color); }
body.dark-mode .search-input { color: var(--text-primary); }
body.dark-mode .dropdown-menu { background: var(--bg-card) !important; border-color: var(--border-color) !important; }
body.dark-mode .dropdown-item { color: var(--text-secondary) !important; }
body.dark-mode .dropdown-item:hover { background: var(--surface-3) !important; color: var(--primary-400) !important; }
body.dark-mode .offcanvas { background: var(--bg-card) !important; color: var(--text-primary); }
body.dark-mode .list-group-item { background: transparent; color: var(--text-secondary); border-color: var(--border-light); }
body.dark-mode .list-group-item:hover { background: var(--surface-3); color: var(--text-primary); }
body.dark-mode .blog-card .card-bookmark { background: rgba(30,41,59,0.9); color: var(--text-secondary); }
body.dark-mode .contact-form .form-control { background: var(--bg-body); color: var(--text-primary); border-color: var(--border-color); }
body.dark-mode .article-body blockquote { background: rgba(37,99,235,0.1); color: var(--primary-300); }
body.dark-mode .cat-pill { background: var(--bg-card); border-color: var(--border-color); }
body.dark-mode .cat-pill:hover { background: rgba(37,99,235,0.15); border-color: var(--primary-400); }
body.dark-mode .cat-pill .cat-icon { background: rgba(37,99,235,0.15); }
body.dark-mode .features-bar { background: var(--surface-1); border-color: var(--border-color); }
body.dark-mode .feature-item .icon { background: rgba(37,99,235,0.15); }
body.dark-mode .text-body, body.dark-mode .text-dark { color: var(--text-primary) !important; }
body.dark-mode .text-secondary { color: var(--text-secondary) !important; }
body.dark-mode .text-muted { color: var(--text-muted) !important; }
body.dark-mode .bg-white { background-color: var(--bg-card) !important; }
body.dark-mode .bg-light { background-color: var(--surface-2) !important; }
body.dark-mode .border-light { border-color: var(--border-color) !important; }
body.dark-mode .btn-light { background: var(--surface-3) !important; color: var(--text-primary) !important; border-color: var(--border-color) !important; }
body.dark-mode .comment-form textarea { background: var(--bg-card); border-color: var(--border-color); color: var(--text-primary); }
body.dark-mode .hero-form input[type="email"] { background: rgba(255,255,255,0.08); border-color: rgba(255,255,255,0.12); color: #fff; }
body.dark-mode .search-suggestion-item { color: var(--text-secondary); }
body.dark-mode .go-navbar.scrolled { background: rgba(15,23,42,0.98); }
body.dark-mode .user-pill { background: var(--surface-3); border-color: var(--border-color); }
body.dark-mode .user-pill .name { color: var(--text-primary); }

/* ════════════════════════════════
   RESPONSIVE
   ════════════════════════════════ */
@media (max-width: 991.98px) {
    .hero-section { min-height: auto; padding: 60px 0; }
    .editors-pick-card { min-height: 360px; }
    .editors-pick-card img { min-height: 360px; }
    .newsletter-box { padding: var(--space-8) var(--space-5); }
    .author-bio-card { flex-direction: column; }
}
@media (max-width: 767.98px) {
    h1 { font-size: 2.2rem; }
    h2 { font-size: 1.8rem; }
    .hero-form { flex-direction: column; }
    .hero-form input[type="email"], .hero-form button { width: 100%; }
    .newsletter-form { flex-direction: column; }
    .footer-bottom { flex-direction: column; text-align: center; }
    .hero-section h1 { font-size: 2rem; }
}
@media (max-width: 575.98px) {
    .section-padding { padding: var(--space-10) 0; }
}

/* ════════════════════════════════
   BOOTSTRAP COMPONENT OVERRIDES
   (Theme-aware)
   ════════════════════════════════ */

/* Pagination */
.pagination .page-link {
    background: var(--bg-card);
    color: var(--text-secondary);
    border-color: var(--border-color);
    font-family: var(--font-body);
    font-size: var(--font-size-sm);
}
.pagination .page-link:hover {
    background: var(--primary-50);
    color: var(--primary);
    border-color: var(--primary-200);
}
.pagination .page-item.active .page-link {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}
.pagination .page-item.disabled .page-link {
    background: var(--surface-2);
    color: var(--text-muted);
    border-color: var(--border-color);
}

/* Breadcrumb */
.breadcrumb { background: transparent; padding: 0; }
.breadcrumb-item a { color: var(--text-muted); }
.breadcrumb-item a:hover { color: var(--primary); }
.breadcrumb-item.active { color: var(--text-secondary); }
.breadcrumb-item + .breadcrumb-item::before { color: var(--border-color); }

/* Forms (Bootstrap) */
.form-control, .form-select {
    background-color: var(--bg-card);
    color: var(--text-primary);
    border-color: var(--border-color);
    font-family: var(--font-body);
}
.form-control:focus, .form-select:focus {
    background-color: var(--bg-card);
    color: var(--text-primary);
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-100);
}
.form-control::placeholder { color: var(--text-muted); }
.form-label {
    color: var(--text-secondary);
    font-size: var(--font-size-sm);
    font-weight: 600;
}

/* Badges */
.badge.bg-primary { background: var(--primary) !important; }
.badge.bg-success { background: var(--success) !important; }
.badge.bg-warning { background: var(--warning) !important; }
.badge.bg-danger  { background: var(--danger)  !important; }

/* Offcanvas */
.offcanvas {
    background: var(--bg-card) !important;
    color: var(--text-primary);
    border-color: var(--border-color) !important;
}
.offcanvas-header { border-bottom: 1px solid var(--border-color); }
.offcanvas .offcanvas-title { color: var(--primary); }
.offcanvas .list-group-item {
    background: transparent;
    color: var(--text-secondary);
    border-color: var(--border-light);
    font-weight: 500;
}
.offcanvas .list-group-item:hover, .offcanvas .list-group-item:focus {
    background: var(--surface-3);
    color: var(--primary);
}
.btn-close { filter: var(--text-primary) === '#0f172a' ? none : invert(1); }

/* Dropdown */
.dropdown-menu {
    background: var(--bg-card) !important;
    border-color: var(--border-color) !important;
    box-shadow: var(--shadow-lg) !important;
    border-radius: var(--radius-lg) !important;
}
.dropdown-item { color: var(--text-secondary) !important; font-size: var(--font-size-sm); }
.dropdown-item:hover, .dropdown-item:focus { background: var(--surface-3) !important; color: var(--primary) !important; }
.dropdown-divider { border-color: var(--border-color) !important; }

/* Alerts */
.alert {
    border-radius: var(--radius-lg);
    border: none;
    font-size: var(--font-size-sm);
}

/* Flash Messages */
.alert-success { background: #f0fdf4; color: #16a34a; }
.alert-danger   { background: #fef2f2; color: #dc2626; }
.alert-warning  { background: #fffbeb; color: #d97706; }
.alert-info     { background: #f0f9ff; color: #0891b2; }

body.dark-mode .alert-success { background: rgba(22,163,74,0.15); color: #4ade80; }
body.dark-mode .alert-danger  { background: rgba(220,38,38,0.15); color: #f87171; }
body.dark-mode .alert-warning { background: rgba(217,119,6,0.15); color: #fbbf24; }
body.dark-mode .alert-info    { background: rgba(8,145,178,0.15); color: #38bdf8; }

/* Bootstrap button overrides */
.btn-primary {
    background: var(--primary);
    border-color: var(--primary);
    font-family: var(--font-body);
}
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); }
.btn-outline-secondary {
    border-color: var(--border-color);
    color: var(--text-secondary);
    background: var(--bg-card);
    font-family: var(--font-body);
}
.btn-outline-secondary:hover { background: var(--surface-3); color: var(--text-primary); border-color: var(--border-color); }
.btn-sm { font-size: var(--font-size-sm); }

/* Fix border-* utilities in dark mode */
body.dark-mode .border        { border-color: var(--border-color) !important; }
body.dark-mode .border-bottom { border-bottom-color: var(--border-color) !important; }
body.dark-mode .border-top    { border-top-color: var(--border-color) !important; }
body.dark-mode .border-secondary { border-color: var(--border-color) !important; }

/* Pagination in dark mode */
body.dark-mode .pagination .page-link {
    background: var(--bg-card);
    color: var(--text-secondary);
    border-color: var(--border-color);
}
body.dark-mode .pagination .page-link:hover {
    background: rgba(37,99,235,0.15);
    color: var(--primary-400);
}
body.dark-mode .pagination .page-item.active .page-link {
    background: var(--primary);
    border-color: var(--primary);
}
body.dark-mode .pagination .page-item.disabled .page-link {
    background: var(--surface-2);
    color: var(--text-muted);
}

/* Form controls in dark mode */
body.dark-mode .form-control,
body.dark-mode .form-select {
    background-color: var(--bg-card) !important;
    color: var(--text-primary) !important;
    border-color: var(--border-color) !important;
}
body.dark-mode .form-control:focus,
body.dark-mode .form-select:focus {
    background-color: var(--bg-card) !important;
    border-color: var(--primary-400) !important;
    box-shadow: 0 0 0 3px rgba(59,130,246,0.2) !important;
}
body.dark-mode .form-control::placeholder { color: var(--text-muted) !important; }
body.dark-mode .form-label { color: var(--text-secondary); }

