/* ═══════════════════════════════════════════════════════════════════════
   TownReader — Enterprise Premium Design System v2.0
   Full Dark/Light Mode Support | glassmorphism | Micro-animations
   ═══════════════════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Merriweather:ital,wght@0,300;0,400;0,700;1,300&family=Outfit:wght@400;500;600;700;800;900&display=swap');

/* ─── LIGHT THEME TOKENS ─── */
:root {
  --primary:        #4f46e5;
  --primary-hover:  #4338ca;
  --primary-light:  #ede9fe;
  --primary-dark:   #3730a3;
  --secondary:      #06b6d4;
  --accent:         #f59e0b;
  --success:        #10b981;
  --danger:         #ef4444;
  --warning:        #f59e0b;

  --bg-main:        #f1f5f9;
  --bg-surface:     #ffffff;
  --bg-card:        #ffffff;
  --bg-hover:       #f8fafc;
  --border-color:   #e2e8f0;
  --border-light:   #f1f5f9;

  --text-primary:   #0f172a;
  --text-secondary: #374151;
  --text-muted:     #6b7280;
  --text-light:     #9ca3af;

  --glass-bg:        rgba(255,255,255,0.9);
  --glass-border:    rgba(226,232,240,0.8);
  --card-shadow:     0 1px 3px rgba(15,23,42,0.06), 0 4px 16px rgba(15,23,42,0.04);
  --hover-shadow:    0 8px 30px rgba(79,70,229,0.12), 0 4px 12px rgba(15,23,42,0.08);
  --card-shadow-lg:  0 10px 40px rgba(15,23,42,0.08), 0 4px 12px rgba(15,23,42,0.04);

  --font-heading:   'Outfit', sans-serif;
  --font-body:      'Inter', sans-serif;
  --font-article:   'Merriweather', serif;

  --radius-sm:      8px;
  --radius-md:      14px;
  --radius-lg:      20px;
  --radius-xl:      28px;

  --transition:     all 0.25s cubic-bezier(0.4,0,0.2,1);
}

/* ─── DARK THEME TOKENS ─── */
[data-bs-theme="dark"] {
  --bg-main:        #060b18;
  --bg-surface:     #0d1426;
  --bg-card:        #111827;
  --bg-hover:       #1a2540;
  --border-color:   #1e2d47;
  --border-light:   #162035;

  --text-primary:   #f1f5f9;
  --text-secondary: #cbd5e1;
  --text-muted:     #94a3b8;
  --text-light:     #64748b;

  --glass-bg:        rgba(13,20,38,0.95);
  --glass-border:    rgba(30,45,71,0.9);
  --card-shadow:     0 1px 3px rgba(0,0,0,0.4), 0 4px 16px rgba(0,0,0,0.25);
  --hover-shadow:    0 8px 30px rgba(79,70,229,0.25), 0 4px 12px rgba(0,0,0,0.3);
  --card-shadow-lg:  0 10px 40px rgba(0,0,0,0.35), 0 4px 12px rgba(0,0,0,0.25);

  --primary-light:  rgba(79,70,229,0.15);
}

/* ─── BASE RESET & BODY ─── */
*,*::before,*::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background-color: var(--bg-main);
  color: var(--text-primary);
  transition: background-color 0.35s ease, color 0.3s ease;
  line-height: 1.65;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

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

a { transition: var(--transition); }

/* ─── SCROLLBAR ─── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-main); }
::-webkit-scrollbar-thumb { background: var(--border-color); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: var(--primary); }

/* ═══════════════════════════════════════════════════════════════════════
   NAVBAR & HEADER
   ═══════════════════════════════════════════════════════════════════════ */

.glass-navbar {
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--glass-border);
  position: sticky;
  top: 0;
  z-index: 1040;
  transition: var(--transition);
}

.brand-logo {
  font-family: var(--font-heading);
  font-weight: 900;
  font-size: 1.6rem;
  letter-spacing: -0.04em;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--text-primary) !important;
}

.brand-icon {
  background: linear-gradient(135deg, #4f46e5 0%, #06b6d4 100%);
  color: #fff;
  width: 40px; height: 40px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  box-shadow: 0 4px 12px rgba(79,70,229,0.35);
  flex-shrink: 0;
}

/* Category Nav Scrollbar */
.category-nav-bar {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  overflow-x: auto;
  white-space: nowrap;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding: 0.25rem 0;
}
.category-nav-bar::-webkit-scrollbar { display: none; }

.category-nav-link {
  color: var(--text-secondary);
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.83rem;
  text-transform: uppercase;
  letter-spacing: 0.045em;
  padding: 0.4rem 0.85rem;
  border-radius: 99px;
  text-decoration: none;
  transition: var(--transition);
  flex-shrink: 0;
}

.category-nav-link:hover {
  color: var(--primary);
  background: var(--primary-light);
}
.category-nav-link.active {
  color: #fff;
  background: var(--primary);
  box-shadow: 0 2px 8px rgba(79,70,229,0.3);
}

/* ─── Search Dropdown ─── */
#search-results-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0; right: 0;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--hover-shadow);
  z-index: 1050;
  max-height: 440px;
  overflow-y: auto;
  display: none;
}

/* ═══════════════════════════════════════════════════════════════════════
   BREAKING NEWS TICKER
   ═══════════════════════════════════════════════════════════════════════ */

.ticker-bar {
  background: linear-gradient(90deg, #1e1b4b 0%, #312e81 50%, #4338ca 100%);
  color: #fff;
  font-size: 0.83rem;
  font-weight: 500;
  padding: 0.42rem 0;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  overflow: hidden;
}

.ticker-badge {
  background: #ef4444;
  color: #fff;
  font-weight: 800;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 0.22rem 0.55rem;
  border-radius: 6px;
  box-shadow: 0 0 12px rgba(239,68,68,0.6);
  animation: pulse-glow 2s infinite;
  flex-shrink: 0;
}

@keyframes pulse-glow {
  0%   { box-shadow: 0 0 0 0 rgba(239,68,68,0.7); }
  70%  { box-shadow: 0 0 0 8px rgba(239,68,68,0); }
  100% { box-shadow: 0 0 0 0 rgba(239,68,68,0); }
}

.ticker-scroll {
  display: flex;
  gap: 2.5rem;
  animation: ticker-move 30s linear infinite;
  will-change: transform;
}
.ticker-scroll:hover { animation-play-state: paused; }

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

.ticker-item {
  color: #c7d2fe;
  text-decoration: none;
  transition: color 0.2s;
  white-space: nowrap;
}
.ticker-item:hover { color: #fff; }

/* ═══════════════════════════════════════════════════════════════════════
   CARDS
   ═══════════════════════════════════════════════════════════════════════ */

/* Universal card base */
.card {
  background: var(--bg-card) !important;
  border: 1px solid var(--border-color) !important;
  color: var(--text-primary) !important;
  border-radius: var(--radius-md) !important;
  box-shadow: var(--card-shadow) !important;
  transition: var(--transition);
}

/* Hero Main Card */
.hero-main-card {
  position: relative;
  border-radius: var(--radius-xl) !important;
  overflow: hidden;
  min-height: 500px;
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: flex-end;
  box-shadow: var(--card-shadow-lg) !important;
  transition: transform 0.35s ease, box-shadow 0.35s ease;
}
.hero-main-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--hover-shadow) !important;
}
.hero-overlay {
  background: linear-gradient(0deg, rgba(8,14,30,0) 0%, rgba(8,14,30,0.6) 45%, rgba(8,14,30,0.97) 100%);
  padding: 2.2rem;
  width: 100%;
  color: #fff;
}

/* Hero Sub-cards */
.hero-sub-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1rem;
  transition: var(--transition);
  box-shadow: var(--card-shadow);
}
.hero-sub-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--hover-shadow);
  border-color: rgba(79,70,229,0.4);
}
.hero-sub-img {
  width: 100%;
  height: 108px;
  object-fit: cover;
  border-radius: var(--radius-sm);
}

/* Article Cards */
.article-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: var(--transition);
  height: 100%;
  display: flex;
  flex-direction: column;
  box-shadow: var(--card-shadow);
}
.article-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--hover-shadow);
  border-color: rgba(79,70,229,0.35);
}
.article-card-img-wrapper {
  position: relative;
  overflow: hidden;
  height: 210px;
}
.article-card-img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.45s ease;
}
.article-card:hover .article-card-img { transform: scale(1.07); }
.article-card-body {
  padding: 1.35rem;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

/* Stat Card (Dashboard / Analytics) */
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--card-shadow);
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}
.stat-card::before {
  content: '';
  position: absolute;
  top: 0; right: 0;
  width: 90px; height: 90px;
  border-radius: 50%;
  opacity: 0.08;
  transform: translate(25%, -25%);
}
.stat-card.primary::before  { background: var(--primary); }
.stat-card.success::before  { background: var(--success); }
.stat-card.warning::before  { background: var(--warning); }
.stat-card.danger::before   { background: var(--danger);  }
.stat-card:hover { transform: translateY(-3px); box-shadow: var(--hover-shadow); }

/* ═══════════════════════════════════════════════════════════════════════
   BADGES & LABELS
   ═══════════════════════════════════════════════════════════════════════ */

.badge-category {
  font-family: var(--font-heading);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.32em 0.8em;
  border-radius: 99px;
  background: var(--primary-light);
  color: var(--primary);
  display: inline-block;
}

.badge-breaking {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 0.25em 0.7em;
  border-radius: 99px;
  box-shadow: 0 2px 8px rgba(239,68,68,0.4);
  animation: pulse-glow 2s infinite;
}

/* ═══════════════════════════════════════════════════════════════════════
   ARTICLE BODY TYPOGRAPHY
   ═══════════════════════════════════════════════════════════════════════ */

.article-body {
  font-family: var(--font-article);
  font-size: 1.13rem;
  line-height: 1.95;
  color: var(--text-primary);
}
.article-body p { margin-bottom: 1.75rem; }
.article-body h2 {
  font-family: var(--font-heading);
  font-size: 1.8rem;
  font-weight: 800;
  margin-top: 2.8rem;
  margin-bottom: 1.1rem;
  color: var(--text-primary);
  scroll-margin-top: 100px;
}
.article-body h3 {
  font-family: var(--font-heading);
  font-size: 1.4rem;
  font-weight: 700;
  margin-top: 2.2rem;
  margin-bottom: 0.9rem;
  color: var(--text-primary);
  scroll-margin-top: 100px;
}
.article-body blockquote {
  border-left: 4px solid var(--primary);
  padding: 1.2rem 1.5rem;
  background: var(--primary-light);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-style: italic;
  color: var(--text-secondary);
  margin: 2rem 0;
}
.article-body img {
  border-radius: var(--radius-md);
  box-shadow: var(--card-shadow);
}

/* ═══════════════════════════════════════════════════════════════════════
   NEWSLETTER BANNER
   ═══════════════════════════════════════════════════════════════════════ */

.newsletter-card {
  background: linear-gradient(135deg, #4f46e5 0%, #3730a3 55%, #06b6d4 100%);
  border-radius: var(--radius-xl);
  color: #fff;
  padding: 2.4rem;
  position: relative;
  overflow: hidden;
  box-shadow: 0 12px 35px rgba(79,70,229,0.35);
  border: none !important;
}
.newsletter-card::before {
  content: '';
  position: absolute;
  top: -50%; right: -15%;
  width: 280px; height: 280px;
  background: rgba(255,255,255,0.07);
  border-radius: 50%;
  pointer-events: none;
}
.newsletter-card::after {
  content: '';
  position: absolute;
  bottom: -40%; left: -10%;
  width: 200px; height: 200px;
  background: rgba(255,255,255,0.05);
  border-radius: 50%;
  pointer-events: none;
}

/* ═══════════════════════════════════════════════════════════════════════
   TRENDING NUMBERS
   ═══════════════════════════════════════════════════════════════════════ */

.trending-number {
  font-family: var(--font-heading);
  font-weight: 900;
  font-size: 2rem;
  line-height: 1;
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  min-width: 44px;
  flex-shrink: 0;
}

/* ═══════════════════════════════════════════════════════════════════════
   AD BANNER
   ═══════════════════════════════════════════════════════════════════════ */

.ad-banner-box {
  background: var(--bg-card);
  border: 1px dashed var(--border-color);
  border-radius: var(--radius-md);
  padding: 1rem;
  box-shadow: var(--card-shadow);
  text-align: center;
}

/* ═══════════════════════════════════════════════════════════════════════
   DASHBOARD SIDEBAR
   ═══════════════════════════════════════════════════════════════════════ */

.dashboard-nav-item {
  color: var(--text-secondary);
  padding: 0.75rem 1.1rem;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 600;
  font-size: 0.88rem;
  text-decoration: none;
  margin-bottom: 0.25rem;
  transition: var(--transition);
  font-family: var(--font-body);
}
.dashboard-nav-item i { font-size: 1rem; flex-shrink: 0; }
.dashboard-nav-item:hover {
  background: var(--primary-light);
  color: var(--primary);
}
.dashboard-nav-item.active {
  background: var(--primary);
  color: #fff !important;
  box-shadow: 0 4px 14px rgba(79,70,229,0.35);
}

/* ═══════════════════════════════════════════════════════════════════════
   FORM ELEMENTS
   ═══════════════════════════════════════════════════════════════════════ */

.form-control, .form-select {
  background-color: var(--bg-main) !important;
  border-color: var(--border-color) !important;
  color: var(--text-primary) !important;
  border-radius: var(--radius-sm) !important;
  transition: var(--transition);
}
.form-control:focus, .form-select:focus {
  background-color: var(--bg-surface) !important;
  border-color: var(--primary) !important;
  box-shadow: 0 0 0 3px rgba(79,70,229,0.15) !important;
  color: var(--text-primary) !important;
}
.form-control::placeholder { color: var(--text-muted) !important; }

.input-group-text {
  background-color: var(--bg-main) !important;
  border-color: var(--border-color) !important;
  color: var(--text-muted) !important;
}

/* ═══════════════════════════════════════════════════════════════════════
   BUTTONS
   ═══════════════════════════════════════════════════════════════════════ */

.btn { border-radius: var(--radius-sm); font-weight: 600; transition: var(--transition); }
.btn-primary {
  background: var(--primary) !important;
  border-color: var(--primary) !important;
  color: #fff !important;
}
.btn-primary:hover {
  background: var(--primary-hover) !important;
  border-color: var(--primary-hover) !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(79,70,229,0.35) !important;
}
.btn-outline-primary {
  border-color: var(--primary) !important;
  color: var(--primary) !important;
  background: transparent !important;
}
.btn-outline-primary:hover {
  background: var(--primary) !important;
  color: #fff !important;
  transform: translateY(-1px);
}
.btn-gradient-primary {
  background: linear-gradient(135deg, var(--primary), var(--secondary)) !important;
  border: none !important;
  color: #fff !important;
  box-shadow: 0 4px 14px rgba(79,70,229,0.3);
}
.btn-gradient-primary:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(79,70,229,0.45) !important; }

/* ═══════════════════════════════════════════════════════════════════════
   DROPDOWN MENUS
   ═══════════════════════════════════════════════════════════════════════ */

.dropdown-menu {
  background: var(--bg-card) !important;
  border: 1px solid var(--border-color) !important;
  border-radius: var(--radius-md) !important;
  box-shadow: var(--hover-shadow) !important;
  padding: 0.5rem !important;
}
.dropdown-item {
  color: var(--text-secondary) !important;
  border-radius: var(--radius-sm) !important;
  transition: var(--transition);
  font-size: 0.9rem;
}
.dropdown-item:hover, .dropdown-item:focus {
  background: var(--primary-light) !important;
  color: var(--primary) !important;
}
.dropdown-divider { border-color: var(--border-color) !important; }
.dropdown-header { color: var(--text-muted) !important; }

/* ═══════════════════════════════════════════════════════════════════════
   ALERTS
   ═══════════════════════════════════════════════════════════════════════ */

.alert {
  border-radius: var(--radius-md) !important;
  border: 1px solid var(--border-color) !important;
}

/* ═══════════════════════════════════════════════════════════════════════
   FOOTER
   ═══════════════════════════════════════════════════════════════════════ */

.site-footer {
  background: #090d16;
  color: #94a3b8;
  border-top: 1px solid transparent;
  border-image: linear-gradient(90deg, rgba(79, 70, 229, 0.3), rgba(6, 182, 212, 0.4), rgba(129, 140, 248, 0.2)) 1;
  position: relative;
}
[data-bs-theme="light"] .site-footer {
  background: #0b132b;
}

.footer-heading {
  font-family: var(--font-heading);
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.11em;
  color: #cbd5e1;
  margin-bottom: 1.1rem;
}

.footer-link {
  color: #94a3b8;
  text-decoration: none;
  font-size: 0.88rem;
  transition: color 0.2s ease, transform 0.2s ease;
  display: inline-flex;
  align-items: center;
}
.footer-link:hover {
  color: #818cf8 !important;
  transform: translateX(4px);
}

.footer-social-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #94a3b8;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  text-decoration: none;
  transition: all 0.25s ease;
}
.footer-social-btn:hover {
  background: var(--primary);
  color: #fff !important;
  border-color: var(--primary);
  transform: translateY(-3px);
  box-shadow: 0 6px 16px rgba(79, 70, 229, 0.4);
}

.codehind-badge-link {
  text-decoration: none;
  background: rgba(79, 70, 229, 0.12);
  border: 1px solid rgba(129, 140, 248, 0.25);
  padding: 3px 10px;
  border-radius: 20px;
  transition: all 0.25s ease;
  display: inline-flex;
  align-items: center;
}
.codehind-badge-link:hover {
  background: rgba(79, 70, 229, 0.28);
  border-color: #818cf8;
  box-shadow: 0 4px 12px rgba(129, 140, 248, 0.3);
  transform: translateY(-1px);
}

/* ═══════════════════════════════════════════════════════════════════════
   AUTH PAGES
   ═══════════════════════════════════════════════════════════════════════ */

.auth-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  box-shadow: var(--card-shadow-lg);
  padding: 2.5rem;
}

.auth-brand-icon {
  width: 60px; height: 60px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  color: #fff;
  box-shadow: 0 8px 20px rgba(79,70,229,0.4);
  margin: 0 auto 1rem;
}

/* ═══════════════════════════════════════════════════════════════════════
   TABLE
   ═══════════════════════════════════════════════════════════════════════ */

.table {
  color: var(--text-primary) !important;
  border-color: var(--border-color) !important;
}
.table thead th {
  background: var(--bg-main) !important;
  color: var(--text-muted) !important;
  border-color: var(--border-color) !important;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 700;
  padding: 0.85rem 1rem;
}
.table tbody td {
  border-color: var(--border-light) !important;
  color: var(--text-primary) !important;
  vertical-align: middle;
  padding: 0.9rem 1rem;
}
.table tbody tr:hover { background: var(--bg-hover) !important; }
.table-responsive { border-radius: var(--radius-md); overflow: hidden; }

/* ═══════════════════════════════════════════════════════════════════════
   BADGES (Bootstrap override)
   ═══════════════════════════════════════════════════════════════════════ */

.badge { font-weight: 700; letter-spacing: 0.02em; }

/* ═══════════════════════════════════════════════════════════════════════
   PAGINATION
   ═══════════════════════════════════════════════════════════════════════ */

.page-link {
  background: var(--bg-card) !important;
  border-color: var(--border-color) !important;
  color: var(--text-secondary) !important;
  border-radius: var(--radius-sm) !important;
  transition: var(--transition);
}
.page-link:hover { background: var(--primary-light) !important; color: var(--primary) !important; }
.page-item.active .page-link {
  background: var(--primary) !important;
  border-color: var(--primary) !important;
  color: #fff !important;
}

/* ═══════════════════════════════════════════════════════════════════════
   HOVER LIFT UTILITY
   ═══════════════════════════════════════════════════════════════════════ */

.hover-lift {
  transition: var(--transition);
}
.hover-lift:hover {
  transform: translateY(-4px);
  box-shadow: var(--hover-shadow) !important;
}

/* ─── Text Color Utilities ─── */
.text-primary-custom { color: var(--primary) !important; }
.text-body-color    { color: var(--text-primary) !important; }
.text-body-secondary { color: var(--text-secondary) !important; }
.text-body-muted    { color: var(--text-muted) !important; }

/* ─── Skeleton Loading ─── */
.skeleton {
  background: linear-gradient(90deg, var(--border-color) 25%, var(--bg-hover) 50%, var(--border-color) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-sm);
}
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* ─── TOC (Table of Contents) ─── */
.toc-sidebar {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  position: sticky;
  top: 90px;
}
.toc-link {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.88rem;
  display: block;
  padding: 0.35rem 0.6rem;
  border-left: 2px solid transparent;
  transition: var(--transition);
}
.toc-link:hover, .toc-link.active {
  color: var(--primary);
  border-left-color: var(--primary);
  background: var(--primary-light);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

/* ─── Category Color Accent ─── */
.category-accent-bar {
  height: 4px;
  border-radius: 0 0 4px 4px;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
}

/* ─── Progress Bar (SEO Score) ─── */
.seo-progress {
  height: 8px;
  border-radius: 99px;
  background: var(--border-color);
  overflow: hidden;
}
.seo-progress-fill {
  height: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  transition: width 0.8s ease;
}

/* ─── Reading Progress Bar ─── */
#reading-progress-bar {
  position: fixed;
  top: 0; left: 0;
  height: 3px;
  width: 0%;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  z-index: 9999;
  transition: width 0.1s ease;
}

/* ─── Dark Mode Theme Toggle Button ─── */
#theme-toggle-btn {
  background: var(--bg-card) !important;
  border-color: var(--border-color) !important;
  color: var(--text-secondary) !important;
  width: 38px; height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: var(--transition);
}
#theme-toggle-btn:hover {
  border-color: var(--primary) !important;
  color: var(--primary) !important;
  background: var(--primary-light) !important;
}

/* ─── Body BG Overlay for dark ─── */
[data-bs-theme="dark"] body { background-color: var(--bg-main); }

/* ─── Bootstrap bg-body-tertiary override ─── */
.bg-body-tertiary {
  background-color: var(--bg-main) !important;
}

/* ─── Force link colors ─── */
.text-dark {
  color: var(--text-primary) !important;
}
a.text-dark, a.text-dark:hover {
  color: var(--text-primary) !important;
}
a.text-dark:hover { color: var(--primary) !important; }

/* ─── Responsive ─── */
@media (max-width: 768px) {
  .hero-main-card { min-height: 320px; }
  .article-card-img-wrapper { height: 180px; }
  .auth-card { padding: 1.5rem; border-radius: var(--radius-lg); }
  .newsletter-card { padding: 1.5rem; }
}

@media (max-width: 576px) {
  .brand-logo { font-size: 1.3rem; }
  .brand-icon { width: 34px; height: 34px; font-size: 1rem; border-radius: 10px; }
}

/* ═══════════════════════════════════════════════════════════════════════
   MODERN FLOATING TOAST POPUP NOTIFICATIONS
   ═══════════════════════════════════════════════════════════════════════ */
.tr-toast-container {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 1095;
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 400px;
  width: calc(100vw - 32px);
  pointer-events: none;
}

.tr-toast {
  pointer-events: auto;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 16px 18px;
  border-radius: var(--radius-lg);
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.18);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  transform: translateX(120%);
  transition: transform 0.38s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.35s ease, margin 0.3s ease;
  opacity: 0;
  position: relative;
  overflow: hidden;
}

.tr-toast.show {
  transform: translateX(0);
  opacity: 1;
}

.tr-toast.hide {
  transform: translateX(120%);
  opacity: 0;
}

.tr-toast-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  flex-shrink: 0;
}

.tr-toast-success .tr-toast-icon { background: rgba(16, 185, 129, 0.15); color: #10b981; }
.tr-toast-error .tr-toast-icon { background: rgba(239, 68, 68, 0.15); color: #ef4444; }
.tr-toast-warning .tr-toast-icon { background: rgba(245, 158, 11, 0.15); color: #f59e0b; }
.tr-toast-info .tr-toast-icon { background: var(--primary-light); color: var(--primary); }

.tr-toast-content {
  flex-grow: 1;
  padding-right: 8px;
}

.tr-toast-title {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text-primary);
  margin-bottom: 2px;
  line-height: 1.3;
}

.tr-toast-message {
  font-family: var(--font-body);
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin: 0;
  line-height: 1.45;
}

.tr-toast-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.1rem;
  cursor: pointer;
  padding: 0;
  line-height: 1;
  transition: color 0.2s ease, transform 0.2s ease;
}

.tr-toast-close:hover {
  color: var(--text-primary);
  transform: scale(1.15);
}

.tr-toast-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 3px;
  width: 100%;
  background: rgba(79, 70, 229, 0.2);
}

.tr-toast-progress-bar {
  height: 100%;
  width: 100%;
  transform-origin: left;
}

.tr-toast-success .tr-toast-progress-bar { background: #10b981; }
.tr-toast-error .tr-toast-progress-bar { background: #ef4444; }
.tr-toast-warning .tr-toast-progress-bar { background: #f59e0b; }
.tr-toast-info .tr-toast-progress-bar { background: var(--primary); }

