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

/* ==========================================================================
   GardenGuard AI Böngésző – Komplett Design Rendszer
   Szín: Dark Forest / Emerald | Tipográfia: Outfit + Inter
   ========================================================================== */

/* ==========================================================================
   1. CSS Változók & Reset
   ========================================================================== */
:root {
  --bg-canvas: #0B0F0D;
  --bg-surface-1: #131A16;
  --bg-surface-2: #1C2620;
  --border-subtle: #28362D;
  --brand-primary: #22C55E;
  --brand-primary-glow: rgba(34, 197, 94, 0.15);
  --brand-sage: #7A9A8B;
  --accent-alert: #EAB308;
  --accent-danger: #EF4444;
  --text-primary: #ECFDF5;
  --text-secondary: #9CA3AF;
  --glass-bg: rgba(19, 26, 22, 0.75);
  --glass-border: rgba(255, 255, 255, 0.08);
  --font-headline: 'Outfit', sans-serif;
  --font-body: 'Inter', sans-serif;
  --header-height: 64px;
  --ticker-height: 40px;
  --category-height: 56px;
}

:root[data-theme="light"] {
  --bg-canvas: #F8FAFC;
  --bg-surface-1: #FFFFFF;
  --bg-surface-2: #F1F5F9;
  --border-subtle: #E2E8F0;
  --brand-primary: #16A34A;
  --brand-primary-glow: rgba(22, 163, 74, 0.15);
  --brand-sage: #64748B;
  --accent-alert: #D97706;
  --accent-danger: #DC2626;
  --text-primary: #0F172A;
  --text-secondary: #475569;
  --glass-bg: rgba(255, 255, 255, 0.85);
  --glass-border: rgba(0, 0, 0, 0.08);
}

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

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

body {
  background: var(--bg-canvas);
  color: var(--text-primary);
  font-family: var(--font-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { cursor: pointer; border: none; background: none; font-family: inherit; color: inherit; }
ul, ol { list-style: none; }

/* ==========================================================================
   2. Header
   ========================================================================== */
.header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: var(--header-height);
  background: var(--glass-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--glass-border);
  z-index: 100;
}

.header-inner {
  max-width: 1480px;
  margin: 0 auto;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  gap: 24px;
}

.header-left { display: flex; align-items: center; }
.header-center { flex: 1; max-width: 480px; }
.header-right { display: flex; align-items: center; gap: 16px; }

.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
}

.logo-icon { font-size: 1.75rem; }

.logo-text {
  font-family: var(--font-headline);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text-primary);
}

.logo-accent {
  background: linear-gradient(135deg, var(--brand-primary), #10B981);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.logo-badge {
  font-family: var(--font-headline);
  font-size: 0.65rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--brand-primary), #10B981);
  color: #fff;
  padding: 2px 6px;
  border-radius: 4px;
  letter-spacing: 0.5px;
}

/* Search */
.search-container {
  position: relative;
  width: 100%;
}

.search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--text-secondary);
  pointer-events: none;
}

.search-input {
  width: 100%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--glass-border);
  border-radius: 9999px;
  padding: 9px 60px 9px 40px;
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 0.875rem;
  transition: all 0.3s ease;
  outline: none;
}

.search-input::placeholder { color: var(--text-secondary); opacity: 0.7; }

.search-input:focus {
  border-color: var(--brand-primary);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 0 3px var(--brand-primary-glow);
}

.search-kbd {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.7rem;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(255,255,255,0.08);
  border: 1px solid var(--glass-border);
  color: var(--text-secondary);
  font-family: var(--font-body);
}

/* AI Status in header */
.ai-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.ai-dot {
  width: 8px;
  height: 8px;
  background: var(--brand-primary);
  border-radius: 50%;
  animation: glowPulse 2s infinite;
  display: inline-block;
}

.ai-status-text { white-space: nowrap; }

.header-btn {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: var(--text-secondary);
  transition: all 0.2s ease;
}

.header-btn svg { width: 18px; height: 18px; }

.header-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
}

.header-nav-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 9999px;
  background: rgba(34, 197, 94, 0.1);
  border: 1px solid rgba(34, 197, 94, 0.2);
  color: var(--brand-primary);
  font-family: var(--font-headline);
  font-size: 0.82rem;
  font-weight: 600;
  transition: all 0.3s ease;
  white-space: nowrap;
}

.header-nav-btn:hover {
  background: rgba(34, 197, 94, 0.2);
  border-color: var(--brand-primary);
  box-shadow: 0 0 16px var(--brand-primary-glow);
  transform: translateY(-1px);
}

.header-nav-text {
  font-size: 0.8rem;
}

/* ==========================================================================
   3. Live Ticker
   ========================================================================== */
.ticker-bar {
  position: fixed;
  top: var(--header-height);
  left: 0;
  width: 100%;
  height: var(--ticker-height);
  background: rgba(0, 0, 0, 0.7);
  border-bottom: 1px solid var(--border-subtle);
  z-index: 90;
  display: flex;
  align-items: center;
  overflow: hidden;
}

.ticker-label {
  background: var(--accent-danger);
  color: #fff;
  font-family: var(--font-headline);
  font-weight: 700;
  font-size: 0.7rem;
  padding: 0 14px;
  height: 100%;
  display: flex;
  align-items: center;
  gap: 6px;
  z-index: 2;
  text-transform: uppercase;
  letter-spacing: 1px;
  white-space: nowrap;
  flex-shrink: 0;
}

.ticker-dot {
  width: 6px;
  height: 6px;
  background: #fff;
  border-radius: 50%;
  animation: pulse 1.5s infinite;
}

.ticker-track {
  flex: 1;
  overflow: hidden;
  position: relative;
}

.ticker-content {
  display: flex;
  white-space: nowrap;
  animation: tickerScroll 40s linear infinite;
}

.ticker-item {
  display: inline-flex;
  align-items: center;
  padding: 0 32px;
  font-size: 0.82rem;
  color: var(--text-secondary);
  white-space: nowrap;
}

.ticker-item.alert { color: var(--accent-alert); }
.ticker-item.danger { color: var(--accent-danger); font-weight: 600; }

/* ==========================================================================
   4. Category Filter Bar
   ========================================================================== */
.category-bar {
  position: sticky;
  top: calc(var(--header-height) + var(--ticker-height));
  width: 100%;
  height: var(--category-height);
  background: var(--bg-canvas);
  border-bottom: 1px solid var(--border-subtle);
  z-index: 80;
  overflow: hidden;
}

.category-bar-inner {
  max-width: 1480px;
  margin: 0 auto;
  height: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 24px;
  overflow-x: auto;
  scrollbar-width: none; /* Firefox */
  cursor: grab;
}

.category-bar-inner:active {
  cursor: grabbing;
}

.category-bar-inner::-webkit-scrollbar { display: none; }

.category-pill {
  white-space: nowrap;
  padding: 7px 16px;
  border-radius: 9999px;
  background: var(--bg-surface-1);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: 0.82rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  flex-shrink: 0;
}

.category-pill:hover {
  background: var(--bg-surface-2);
  color: var(--text-primary);
  transform: translateY(-1px);
}

.category-pill.active {
  background: rgba(34, 197, 94, 0.12);
  border-color: var(--brand-primary);
  color: var(--brand-primary);
  box-shadow: 0 0 14px var(--brand-primary-glow);
}

.pill-emoji { font-size: 1rem; }
.pill-count {
  font-size: 0.7rem;
  background: rgba(255,255,255,0.08);
  padding: 1px 6px;
  border-radius: 9999px;
  min-width: 20px;
  text-align: center;
}

.category-pill.active .pill-count {
  background: rgba(34, 197, 94, 0.2);
}

/* ==========================================================================
   5. New Articles Notification Pill
   ========================================================================== */
.new-articles-pill {
  position: fixed;
  top: calc(var(--header-height) + var(--ticker-height) + var(--category-height) + 16px);
  left: 50%;
  transform: translateX(-50%) translateY(-80px);
  background: var(--brand-primary);
  color: #fff;
  padding: 8px 20px;
  border-radius: 9999px;
  font-family: var(--font-headline);
  font-size: 0.85rem;
  font-weight: 600;
  box-shadow: 0 4px 20px rgba(34, 197, 94, 0.5);
  z-index: 85;
  cursor: pointer;
  transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  display: flex;
  align-items: center;
  gap: 8px;
}

.new-articles-pill.show {
  transform: translateX(-50%) translateY(0);
}

.new-articles-pill:hover {
  background: #16a34a;
}

/* ==========================================================================
   6. Main Content Layout
   ========================================================================== */
.main-content {
  margin-top: calc(var(--header-height) + var(--ticker-height) + var(--category-height));
  padding: 32px 24px;
}

.content-grid {
  max-width: 1440px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 400px;
  gap: 40px;
}

.main-column {
  display: flex;
  flex-direction: column;
  gap: 32px;
}

/* ==========================================================================
   7. Featured / Hero Card
   ========================================================================== */
.featured-card { width: 100%; }

.hero-card {
  position: relative;
  width: 100%;
  min-height: 480px;
  border-radius: 16px;
  overflow: hidden;
  display: flex;
  align-items: flex-end;
  border: 1px solid var(--glass-border);
  transition: all 0.4s ease;
  cursor: pointer;
}

.hero-card:hover {
  border-color: var(--brand-primary);
  box-shadow: 0 0 30px var(--brand-primary-glow);
}

.hero-img {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.7s cubic-bezier(0.4, 0, 0.2, 1);
}

.hero-card:hover .hero-img { transform: scale(1.05); }

.hero-overlay {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: linear-gradient(to top, rgba(11, 15, 13, 0.95) 0%, rgba(11, 15, 13, 0.4) 50%, transparent 100%);
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 10;
  padding: 40px;
  width: 100%;
}

.hero-badges {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.hero-title {
  font-family: var(--font-headline);
  font-size: 2.2rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.2;
  margin-bottom: 12px;
  text-shadow: 0 2px 8px rgba(0,0,0,0.5);
}

.hero-summary {
  font-size: 1rem;
  color: var(--text-secondary);
  margin-bottom: 16px;
  max-width: 600px;
}

.hero-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  color: var(--text-secondary);
  font-size: 0.82rem;
  flex-wrap: wrap;
}

.hero-confidence {
  color: var(--brand-primary);
  font-weight: 600;
}

/* ==========================================================================
   8. News Cards Grid
   ========================================================================== */
.news-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

.news-card {
  background: var(--bg-surface-1);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  position: relative;
}

.news-card:hover {
  transform: translateY(-6px);
  background: var(--bg-surface-2);
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.4), 0 0 20px var(--brand-primary-glow);
}

.news-card-img-wrap {
  width: 100%;
  aspect-ratio: 16 / 9;
  position: relative;
  overflow: hidden;
}

.news-card-img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.news-card:hover .news-card-img { transform: scale(1.08); }

.news-card-category {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 2;
}

.news-card-live {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
}

.news-card-content {
  padding: 20px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.news-card-title {
  font-family: var(--font-headline);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 10px;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.news-card-summary {
  font-size: 0.82rem;
  color: var(--text-secondary);
  margin-bottom: 16px;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex-grow: 1;
}

.ai-sparkle { margin-right: 4px; }

.news-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 14px;
  border-top: 1px solid var(--border-subtle);
  font-size: 0.72rem;
  color: var(--text-secondary);
}

.news-card-meta {
  display: flex;
  gap: 12px;
}

/* ==========================================================================
   9. Badges & Category Colors
   ========================================================================== */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 9999px;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  gap: 4px;
}

.badge-ai {
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.15), rgba(16, 185, 129, 0.15));
  color: var(--brand-primary);
  border: 1px solid rgba(34, 197, 94, 0.25);
}

.badge-live {
  background: rgba(239, 68, 68, 0.12);
  color: var(--accent-danger);
  border: 1px solid rgba(239, 68, 68, 0.25);
}

.badge-live::before {
  content: '';
  width: 6px; height: 6px;
  background: var(--accent-danger);
  border-radius: 50%;
  animation: pulse 1.5s infinite;
}

.badge-kiemelt {
  background: rgba(255, 255, 255, 0.9);
  color: #111;
  font-weight: 700;
}

.cat-kerteszkedes { background: rgba(34, 197, 94, 0.15); color: #4ade80; border: 1px solid rgba(74, 222, 128, 0.25); }
.cat-mezogazdasag { background: rgba(234, 179, 8, 0.15); color: #facc15; border: 1px solid rgba(250, 204, 21, 0.25); }
.cat-novenyyedelem { background: rgba(239, 68, 68, 0.15); color: #f87171; border: 1px solid rgba(248, 113, 113, 0.25); }
.cat-idojaras { background: rgba(59, 130, 246, 0.15); color: #60a5fa; border: 1px solid rgba(96, 165, 250, 0.25); }
.cat-technologia { background: rgba(139, 92, 246, 0.15); color: #a78bfa; border: 1px solid rgba(167, 139, 250, 0.25); }
.cat-piac { background: rgba(245, 158, 11, 0.15); color: #fbbf24; border: 1px solid rgba(251, 191, 36, 0.25); }
.cat-fenntarthatosag { background: rgba(20, 184, 166, 0.15); color: #2dd4bf; border: 1px solid rgba(45, 212, 191, 0.25); }
.cat-tippek { background: rgba(236, 72, 153, 0.15); color: #f472b6; border: 1px solid rgba(244, 114, 182, 0.25); }

/* ==========================================================================
   10. Sidebar
   ========================================================================== */
.sidebar {
  position: sticky;
  top: 180px;
  display: flex;
  flex-direction: column;
  gap: 28px;
  height: fit-content;
  max-height: calc(100vh - 200px);
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 8px;
  padding-bottom: 24px;
}

.sidebar::-webkit-scrollbar { width: 6px; }
.sidebar::-webkit-scrollbar-track { background: transparent; }
.sidebar::-webkit-scrollbar-thumb { background: var(--border-subtle); border-radius: 4px; }
.sidebar::-webkit-scrollbar-thumb:hover { background: var(--brand-sage); }

.sidebar-widget {
  background: var(--bg-surface-1);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  overflow: hidden;
}

.widget-accent-bar {
  height: 3px;
  background: linear-gradient(90deg, #3B82F6, #8B5CF6, #EC4899);
}

.widget-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.widget-header h3 {
  font-family: var(--font-headline);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-primary);
}

.widget-location, .widget-month {
  font-size: 0.78rem;
  color: var(--brand-sage);
  font-weight: 500;
}

/* Weather */
.weather-main-display {
  padding: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.weather-temp-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
}

.weather-temp {
  font-family: var(--font-headline);
  font-size: 2.8rem;
  font-weight: 700;
  line-height: 1;
}

.weather-icon { font-size: 2.2rem; }

.weather-details {
  font-size: 0.8rem;
  color: var(--text-secondary);
  display: flex;
  flex-direction: column;
  gap: 4px;
  text-align: right;
}

.weather-advice-text {
  padding: 12px 20px 16px;
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.5;
  border-top: 1px solid var(--border-subtle);
}

.weather-advice-text strong { color: var(--text-primary); }

/* Seasonal Calendar */
.seasonal-list {
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.calendar-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-subtle);
}

.calendar-item:last-child { border-bottom: none; padding-bottom: 0; }

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

.cal-icon.harvest { background: rgba(245, 158, 11, 0.1); }
.cal-icon.plant { background: rgba(34, 197, 94, 0.1); }
.cal-icon.care { background: rgba(59, 130, 246, 0.1); }

.cal-text h4 { font-size: 0.85rem; font-weight: 500; color: var(--text-primary); }
.cal-text p { font-size: 0.72rem; color: var(--text-secondary); margin-top: 2px; }

/* Popular Articles */
.popular-list {
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.popular-item {
  display: flex;
  gap: 12px;
  align-items: center;
  cursor: pointer;
  padding: 8px;
  margin: -8px;
  border-radius: 10px;
  transition: background 0.2s;
}

.popular-item:hover { background: var(--bg-surface-2); }

.pop-num {
  font-family: var(--font-headline);
  font-size: 1.4rem;
  font-weight: 800;
  color: rgba(255, 255, 255, 0.08);
  width: 24px;
  text-align: center;
  flex-shrink: 0;
}

.pop-thumb {
  width: 48px; height: 48px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
}

.pop-info { flex: 1; min-width: 0; }

.pop-info h4 {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-primary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.3;
}

.pop-views {
  font-size: 0.7rem;
  color: var(--text-secondary);
  margin-top: 4px;
}

/* AI Status Widget */
.ai-widget {
  background: linear-gradient(180deg, var(--bg-surface-1) 0%, rgba(34, 197, 94, 0.04) 100%);
}

.ai-stats-grid {
  padding: 20px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  text-align: center;
}

.ai-stat-value {
  font-family: var(--font-headline);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text-primary);
  display: block;
}

.ai-stat-label {
  font-size: 0.68rem;
  color: var(--text-secondary);
  display: block;
  margin-top: 2px;
}

.ai-generate-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: calc(100% - 40px);
  margin: 0 20px 20px;
  padding: 11px;
  border-radius: 10px;
  background: var(--brand-primary);
  color: #fff;
  font-family: var(--font-headline);
  font-weight: 600;
  font-size: 0.85rem;
  transition: all 0.25s ease;
}

.ai-generate-btn:hover {
  background: #16a34a;
  box-shadow: 0 6px 20px rgba(34, 197, 94, 0.35);
  transform: translateY(-1px);
}

/* ==========================================================================
   11. Article Modal
   ========================================================================== */
.modal-overlay {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
  z-index: 999;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 40px 20px;
  overflow-y: auto;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

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

.modal-container {
  width: 100%;
  max-width: 800px;
  position: relative;
}

.modal-close {
  position: fixed;
  top: 20px;
  right: 20px;
  width: 44px; height: 44px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1001;
  transition: all 0.2s;
}

.modal-close svg { width: 20px; height: 20px; }

.modal-close:hover {
  background: var(--accent-danger);
  transform: scale(1.1);
}

.modal-content {
  background: var(--bg-canvas);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.6);
  transform: translateY(24px);
  transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

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

.modal-hero {
  width: 100%;
  height: 300px;
  object-fit: cover;
}

.modal-body { padding: 36px 40px 40px; }

.modal-title {
  font-family: var(--font-headline);
  font-size: 1.9rem;
  font-weight: 700;
  line-height: 1.25;
  margin-bottom: 20px;
}

.modal-ai-summary {
  background: rgba(34, 197, 94, 0.06);
  border-left: 4px solid var(--brand-primary);
  padding: 20px;
  border-radius: 0 12px 12px 0;
  margin-bottom: 28px;
}

.modal-ai-summary h3 {
  font-family: var(--font-headline);
  font-size: 1rem;
  color: var(--brand-primary);
  margin-bottom: 10px;
}

.modal-text {
  font-size: 0.95rem;
  line-height: 1.8;
  color: var(--text-primary);
}

.modal-text p { margin-bottom: 16px; }
.modal-text p:last-child { margin-bottom: 0; }

.modal-citations {
  margin-top: 32px;
  padding-top: 20px;
  border-top: 1px solid var(--border-subtle);
}

.modal-citations h4 {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

/* ==========================================================================
   12. Loading States / Skeleton
   ========================================================================== */
.skeleton {
  background: var(--bg-surface-2);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  position: relative;
  overflow: hidden;
}

.skeleton::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: linear-gradient(90deg, rgba(255,255,255,0) 0%, rgba(255,255,255,0.04) 50%, rgba(255,255,255,0) 100%);
  animation: shimmer 1.5s infinite;
}

/* ==========================================================================
   13. Load More
   ========================================================================== */
.load-more-container { text-align: center; padding: 16px 0; }

.load-more-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 28px;
  border-radius: 10px;
  background: var(--bg-surface-1);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-family: var(--font-headline);
  font-weight: 600;
  font-size: 0.9rem;
  transition: all 0.3s ease;
}

.load-more-btn:hover {
  background: var(--bg-surface-2);
  border-color: var(--brand-primary);
  color: var(--brand-primary);
  box-shadow: 0 0 16px var(--brand-primary-glow);
}

/* ==========================================================================
   14. FAB (Floating Action Button)
   ========================================================================== */
.fab {
  position: fixed;
  bottom: 32px;
  right: 32px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 22px;
  border-radius: 9999px;
  background: linear-gradient(135deg, var(--brand-primary), #10B981);
  color: #fff;
  font-family: var(--font-headline);
  font-weight: 600;
  font-size: 0.85rem;
  box-shadow: 0 8px 30px rgba(34, 197, 94, 0.4);
  z-index: 90;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  animation: float 5s ease-in-out infinite;
}

.fab svg { width: 20px; height: 20px; }

.fab:hover {
  transform: scale(1.08);
  box-shadow: 0 12px 40px rgba(34, 197, 94, 0.6);
}

/* ==========================================================================
   15. Footer
   ========================================================================== */
.footer {
  background: var(--bg-surface-1);
  border-top: 1px solid var(--border-subtle);
  padding: 56px 24px 28px;
  margin-top: 64px;
}

.footer-inner { max-width: 1440px; margin: 0 auto; }

.footer-grid {
  display: grid;
  grid-template-columns: 1.8fr 1fr 1fr 1.4fr;
  gap: 40px;
  margin-bottom: 40px;
}

.footer-section .logo { margin-bottom: 16px; }

.footer-desc {
  color: var(--text-secondary);
  font-size: 0.85rem;
  max-width: 320px;
  line-height: 1.6;
}

.footer-section h4 {
  font-family: var(--font-headline);
  color: var(--text-primary);
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 16px;
}

.footer-section ul {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer-section a {
  color: var(--text-secondary);
  font-size: 0.85rem;
  transition: color 0.2s;
}

.footer-section a:hover { color: var(--brand-primary); }

.footer-ai-notice {
  color: var(--text-secondary);
  font-size: 0.82rem;
  line-height: 1.6;
  margin-bottom: 16px;
}

.footer-ai-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 8px;
  background: rgba(34, 197, 94, 0.08);
  border: 1px solid rgba(34, 197, 94, 0.2);
  color: var(--brand-primary);
  font-size: 0.78rem;
  font-weight: 600;
}

.footer-bottom {
  padding-top: 24px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--text-secondary);
  font-size: 0.78rem;
}

.footer-disclaimer { opacity: 0.6; }

/* ==========================================================================
   16. Animations
   ========================================================================== */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes pulse {
  0% { opacity: 1; }
  50% { opacity: 0.4; }
  100% { opacity: 1; }
}

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

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

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

@keyframes glowPulse {
  0% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.5); }
  70% { box-shadow: 0 0 0 8px rgba(34, 197, 94, 0); }
  100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}

/* ==========================================================================
   17. Custom Scrollbar
   ========================================================================== */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--bg-canvas); }
::-webkit-scrollbar-thumb { background: var(--border-subtle); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--brand-sage); }

/* ==========================================================================
   18. Utility Classes
   ========================================================================== */
.glass {
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
}

.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); border: 0;
}

/* ==========================================================================
   19. Responsive
   ========================================================================== */
@media (max-width: 1200px) {
  .content-grid { grid-template-columns: 1fr 320px; gap: 24px; }
  .news-grid { gap: 20px; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 992px) {
  .content-grid { grid-template-columns: 1fr; }
  .sidebar { display: none; }
}

@media (max-width: 768px) {
  .header-center { display: none; }
  .news-grid { grid-template-columns: 1fr; }
  .hero-card { min-height: 380px; }
  .hero-title { font-size: 1.6rem; }
  .hero-content { padding: 24px; }
  .modal-body { padding: 24px; }
  .modal-title { font-size: 1.5rem; }
  .footer-grid { grid-template-columns: 1fr; gap: 32px; }
  .footer-bottom { flex-direction: column; gap: 12px; text-align: center; }
  .fab .fab-text { display: none; }
  .fab { padding: 14px; border-radius: 50%; }
}

@media (max-width: 480px) {
  .main-content { padding: 20px 16px; }
  .hero-card { min-height: 300px; }
  .category-bar-inner { padding: 0 16px; }
  .header-inner { padding: 0 16px; }
}

/* ==========================================================================
   Phase 3: Bookmarks, Market Widget, and Header Additions
   ========================================================================== */

/* Bookmark Button in Cards */
.bookmark-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 5;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--glass-bg);
  backdrop-filter: blur(8px);
  border: 1px solid var(--glass-border);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.bookmark-btn:hover {
  transform: scale(1.1);
  color: var(--brand-primary);
}

.bookmark-btn.active {
  color: var(--brand-primary);
  background: var(--brand-primary-glow);
  border-color: var(--brand-primary);
}

/* Market Widget */
.market-widget {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.market-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--border-subtle);
}

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

.market-item-name {
  font-weight: 500;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.market-item-price {
  font-weight: 600;
  font-family: var(--font-headline);
}

.market-trend {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.85rem;
  font-weight: 600;
}

.market-trend.up {
  color: var(--brand-primary);
}

.market-trend.down {
  color: var(--accent-danger);
}

/* Bookmark Modal Panel */
.bookmarks-panel {
  position: fixed;
  top: 0;
  right: -400px;
  width: 100%;
  max-width: 400px;
  height: 100vh;
  background: var(--bg-surface-1);
  border-left: 1px solid var(--border-subtle);
  z-index: 200;
  transition: right 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: -10px 0 30px rgba(0,0,0,0.5);
  display: flex;
  flex-direction: column;
}

.bookmarks-panel.active {
  right: 0;
}

.bookmarks-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.bookmarks-header h2 {
  font-family: var(--font-headline);
  font-size: 1.25rem;
  margin: 0;
}

.bookmarks-close {
  font-size: 1.5rem;
  color: var(--text-secondary);
  transition: color 0.2s;
}

.bookmarks-close:hover {
  color: var(--text-primary);
}

.bookmarks-content {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.bookmark-empty {
  text-align: center;
  color: var(--text-secondary);
  margin-top: 40px;
}

.bookmark-item {
  display: flex;
  gap: 16px;
  padding: 12px;
  border-radius: 12px;
  background: var(--bg-surface-2);
  border: 1px solid var(--border-subtle);
  cursor: pointer;
  transition: all 0.2s;
}

.bookmark-item:hover {
  border-color: var(--brand-primary);
  transform: translateY(-2px);
}

.bookmark-item-img {
  width: 80px;
  height: 80px;
  border-radius: 8px;
  object-fit: cover;
}

.bookmark-item-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.bookmark-item-title {
  font-family: var(--font-headline);
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.bookmark-item-remove {
  align-self: flex-end;
  color: var(--accent-danger);
  font-size: 0.85rem;
  font-weight: 500;
}

.bookmark-item-remove:hover {
  text-decoration: underline;
}


/* ==========================================================================
   Phase 4: Header Icon Buttons, Sidebar Tabs, Auth Overlay
   ========================================================================== */

/* Clean Header Icon Buttons */
.header-icon-btn {
  position: relative;
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  color: var(--text-secondary);
  transition: all 0.25s ease;
  background: transparent;
}

.header-icon-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
}

.header-icon-btn svg { width: 20px; height: 20px; }

.header-icon-badge {
  position: absolute;
  top: 4px;
  right: 4px;
  min-width: 18px;
  height: 18px;
  background: var(--brand-primary);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  border-radius: 9999px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Sidebar Tab System */
.sidebar-tabs {
  background: var(--bg-surface-1);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  overflow: hidden;
}

.sidebar-tab-nav {
  display: flex;
  border-bottom: 1px solid var(--border-subtle);
}

.sidebar-tab-btn {
  flex: 1;
  padding: 14px 8px;
  font-family: var(--font-headline);
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-secondary);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: all 0.25s ease;
  position: relative;
}

.sidebar-tab-btn:hover {
  color: var(--text-primary);
  background: rgba(255,255,255,0.03);
}

.sidebar-tab-btn.active {
  color: var(--brand-primary);
  font-weight: 600;
}

.sidebar-tab-btn.active::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 20%;
  width: 60%;
  height: 2px;
  background: var(--brand-primary);
  border-radius: 2px;
}

.sidebar-tab-content {
  min-height: 200px;
}

.sidebar-tab-panel {
  display: none;
  animation: fadeIn 0.3s ease;
}

.sidebar-tab-panel.active {
  display: block;
}

.sidebar-tab-panel .sidebar-widget {
  border: none;
  border-radius: 0;
}

/* ================================
   AUTH OVERLAY (Login / Register)
   ================================ */
.auth-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(6px);
  z-index: 300;
  display: none;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.3s ease;
}

.auth-overlay.active {
  display: flex;
}

.auth-card {
  position: relative;
  width: 100%;
  max-width: 420px;
  background: var(--bg-surface-1);
  border: 1px solid var(--border-subtle);
  border-radius: 20px;
  padding: 40px 36px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.5);
}

.auth-close {
  position: absolute;
  top: 16px;
  right: 16px;
  font-size: 1.5rem;
  color: var(--text-secondary);
  background: none;
  border: none;
  cursor: pointer;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  transition: all 0.2s;
}

.auth-close:hover {
  background: rgba(255,255,255,0.08);
  color: var(--text-primary);
}

.auth-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-headline);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 32px;
  justify-content: center;
}

.auth-logo span:first-child {
  font-size: 2rem;
}

.auth-logo strong {
  background: linear-gradient(135deg, var(--brand-primary), #10B981);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.auth-form {
  display: none;
}

.auth-form.active {
  display: block;
}

.auth-form h2 {
  font-family: var(--font-headline);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.auth-subtitle {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 28px;
}

.auth-input-group {
  margin-bottom: 18px;
}

.auth-input-group label {
  display: block;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.auth-input-group input {
  width: 100%;
  padding: 12px 16px;
  background: var(--bg-surface-2);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 0.95rem;
  outline: none;
  transition: all 0.25s ease;
}

.auth-input-group input::placeholder {
  color: var(--text-secondary);
  opacity: 0.5;
}

.auth-input-group input:focus {
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 3px var(--brand-primary-glow);
}

.auth-submit-btn {
  width: 100%;
  padding: 13px;
  background: var(--brand-primary);
  color: #fff;
  font-family: var(--font-headline);
  font-size: 0.95rem;
  font-weight: 600;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.25s ease;
  margin-top: 6px;
}

.auth-submit-btn:hover {
  background: #16a34a;
  box-shadow: 0 6px 20px rgba(34, 197, 94, 0.4);
  transform: translateY(-1px);
}

.auth-divider {
  display: flex;
  align-items: center;
  margin: 20px 0;
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border-subtle);
}

.auth-divider span {
  padding: 0 16px;
  font-size: 0.82rem;
  color: var(--text-secondary);
}

.auth-google-btn {
  width: 100%;
  padding: 12px;
  background: var(--bg-surface-2);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.25s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.auth-google-btn:hover {
  background: var(--bg-canvas);
  border-color: var(--text-secondary);
}

.auth-switch {
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-top: 20px;
}

.auth-switch a {
  color: var(--brand-primary);
  font-weight: 600;
  cursor: pointer;
}

.auth-switch a:hover {
  text-decoration: underline;
}

.auth-message {
  text-align: center;
  font-size: 0.85rem;
  margin-top: 16px;
  padding: 10px;
  border-radius: 8px;
  display: none;
}

.auth-message.success {
  display: block;
  background: rgba(34, 197, 94, 0.1);
  color: var(--brand-primary);
  border: 1px solid rgba(34, 197, 94, 0.2);
}

.auth-message.error {
  display: block;
  background: rgba(239, 68, 68, 0.1);
  color: var(--accent-danger);
  border: 1px solid rgba(239, 68, 68, 0.2);
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

