@import url('https://fonts.googleapis.com/css2?family=Barlow+Condensed:ital,wght@0,300;0,400;0,600;0,700;0,800;0,900;1,700&family=Barlow:wght@300;400;500;600;700&family=Source+Serif+4:ital,opsz,wght@0,8..60,400;0,8..60,600;1,8..60,400&display=swap');

@tailwind base;
@tailwind components;
@tailwind utilities;

/* ═══════════════════════════════════════
   DESIGN TOKENS — DARK MODE (DEFAULT)
═══════════════════════════════════════ */
:root, [data-theme="dark"] {
  --brand-red:      #FF1E1E;
  --brand-orange:   #FF6A00;
  --brand-yellow:   #FFC107;

  --bg-page:        #0A0F1C;
  --bg-primary:     #0D1B2A;
  --bg-card:        #111827;
  --bg-card-hover:  #162030;
  --bg-elevated:    #1A2744;
  --bg-input:       #0F1F30;

  --text-primary:   #F5F5F5;
  --text-secondary: rgba(245,245,245,0.62);
  --text-muted:     rgba(245,245,245,0.36);

  --border-subtle:  rgba(255,255,255,0.07);
  --border-medium:  rgba(255,255,255,0.13);
  --border-strong:  rgba(255,255,255,0.24);
  --border-accent:  rgba(255,106,0,0.35);

  --nav-bg:         rgba(10,15,28,0.97);
  --nav-height:     64px;

  --shadow-card:    0 4px 24px rgba(0,0,0,0.45);
  --shadow-hover:   0 8px 40px rgba(0,0,0,0.6), 0 0 0 1px rgba(255,106,0,0.18);

  color-scheme: dark;
}

/* ═══════════════════════════════════════
   LIGHT MODE
═══════════════════════════════════════ */
[data-theme="light"] {
  --bg-page:        #EEF1F6;
  --bg-primary:     #FFFFFF;
  --bg-card:        #FFFFFF;
  --bg-card-hover:  #F7F9FC;
  --bg-elevated:    #E8EDF5;
  --bg-input:       #F2F4F8;

  --text-primary:   #060E1A;
  --text-secondary: rgba(6,14,26,0.6);
  --text-muted:     rgba(6,14,26,0.38);

  --border-subtle:  rgba(0,0,0,0.07);
  --border-medium:  rgba(0,0,0,0.12);
  --border-strong:  rgba(0,0,0,0.22);
  --border-accent:  rgba(255,106,0,0.28);

  --nav-bg:         rgba(255,255,255,0.97);
  --shadow-card:    0 2px 14px rgba(0,0,0,0.08);
  --shadow-hover:   0 6px 28px rgba(0,0,0,0.14), 0 0 0 1px rgba(255,106,0,0.14);

  color-scheme: light;
}

/* ═══════════════════════════════════════
   RESET & BASE
═══════════════════════════════════════ */
*,*::before,*::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; font-size: 16px; }
body {
  font-family: 'Barlow', system-ui, sans-serif;
  background: var(--bg-page);
  color: var(--text-primary);
  min-height: 100vh;
  transition: background-color 0.25s ease, color 0.2s ease;
  line-height: 1.6;
}
#__next { min-height: 100vh; }
a { color: inherit; text-decoration: none; }
button { cursor: pointer; font-family: inherit; }
img { display: block; max-width: 100%; }

/* ═══════════════════════════════════════
   TYPOGRAPHY
═══════════════════════════════════════ */
.font-display  { font-family: 'Barlow Condensed', Impact, sans-serif; }
.font-body     { font-family: 'Barlow', system-ui, sans-serif; }
.font-serif    { font-family: 'Source Serif 4', Georgia, serif; }

/* ═══════════════════════════════════════
   HEADER
═══════════════════════════════════════ */
.site-header { position: -webkit-sticky; position: sticky; top: 0; z-index: 200; width: 100%; }

.header-main {
  background: var(--nav-bg);
  border-bottom: 1px solid var(--border-subtle);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  height: var(--nav-height);
  display: flex; align-items: center;
  padding: 0 20px; gap: 16px;
}

/* ═══════════════════════════════════════
   TICKER
═══════════════════════════════════════ */
.ticker-bar {
  background: var(--brand-red);
  height: 38px; display: flex; align-items: center; overflow: hidden;
}
.ticker-label {
  flex-shrink: 0; background: #1A0505;
  color: var(--brand-yellow);
  font-family: 'Barlow Condensed', sans-serif; font-weight: 800;
  font-size: 11px; letter-spacing: 2.5px; text-transform: uppercase;
  padding: 0 16px; height: 100%;
  display: flex; align-items: center; gap: 7px; white-space: nowrap;
}
.ticker-dot { width: 6px; height: 6px; background: var(--brand-red); border-radius: 50%; animation: blink 1s ease-in-out infinite; }
.ticker-track { flex: 1 1; overflow: hidden; height: 100%; display: flex; align-items: center; }
.ticker-items {
  display: flex; align-items: center; white-space: nowrap;
  animation: ticker-scroll 55s linear infinite; will-change: transform;
}
.ticker-items:hover { animation-play-state: paused; }
.ticker-item {
  font-family: 'Barlow Condensed', sans-serif; font-size: 13.5px; font-weight: 600;
  color: white; padding-right: 56px; cursor: pointer;
  transition: opacity 0.15s;
}
.ticker-item:hover { opacity: 0.82; }
.ticker-sep { color: rgba(255,255,255,0.3); padding-right: 56px; font-size: 11px; }

/* ═══════════════════════════════════════
   CATEGORY NAV
═══════════════════════════════════════ */
.cat-nav {
  background: var(--nav-bg); border-bottom: 1px solid var(--border-subtle);
  height: 42px; overflow-x: auto; scrollbar-width: none;
}
.cat-nav::-webkit-scrollbar { display: none; }
.cat-nav-inner {
  max-width: 1400px; margin: 0 auto; padding: 0 20px;
  display: flex; align-items: stretch; height: 100%;
}
.cat-tab {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 13px; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase;
  padding: 0 16px; border: none; border-bottom: 3px solid transparent;
  background: none; color: var(--text-muted); height: 100%;
  display: flex; align-items: center; white-space: nowrap;
  transition: color 0.15s, border-color 0.15s;
}
.cat-tab:hover { color: var(--text-primary); }
.cat-tab.active { color: var(--text-primary); border-bottom-color: var(--brand-red); }

/* ═══════════════════════════════════════
   BADGES
═══════════════════════════════════════ */
.badge-breaking {
  display: inline-flex; align-items: center; gap: 5px;
  background: var(--brand-red); color: white;
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 10px; font-weight: 800; letter-spacing: 1.5px; text-transform: uppercase;
  padding: 3px 8px 3px 6px; border-radius: 2px;
  -webkit-clip-path: polygon(0 0, calc(100% - 6px) 0, 100% 50%, calc(100% - 6px) 100%, 0 100%);
          clip-path: polygon(0 0, calc(100% - 6px) 0, 100% 50%, calc(100% - 6px) 100%, 0 100%);
}
.badge-category {
  display: inline-block; font-family: 'Barlow Condensed', sans-serif;
  font-size: 10px; font-weight: 800; letter-spacing: 1.2px; text-transform: uppercase;
  padding: 2px 8px; border-radius: 2px; white-space: nowrap;
}
.cat-world   { background: rgba(0,71,171,0.15); color: #60a5fa; border: 1px solid rgba(96,165,250,0.22); }
.cat-tech    { background: rgba(94,234,212,0.1); color: #5eead4; border: 1px solid rgba(94,234,212,0.2); }
.cat-finance { background: rgba(74,222,128,0.1); color: #4ade80; border: 1px solid rgba(74,222,128,0.2); }
.cat-us      { background: rgba(248,113,113,0.1); color: #f87171; border: 1px solid rgba(248,113,113,0.2); }
.cat-sports  { background: rgba(250,204,21,0.1); color: #facc15; border: 1px solid rgba(250,204,21,0.2); }
.cat-viral   { background: rgba(192,132,252,0.1); color: #c084fc; border: 1px solid rgba(192,132,252,0.2); }
.cat-general { background: var(--border-subtle); color: var(--text-secondary); border: 1px solid var(--border-medium); }

[data-theme="light"] .cat-world   { background: rgba(0,71,171,0.07); color: #1d4ed8; border-color: rgba(29,78,216,0.18); }
[data-theme="light"] .cat-tech    { background: rgba(15,118,110,0.07); color: #0f766e; border-color: rgba(15,118,110,0.18); }
[data-theme="light"] .cat-finance { background: rgba(22,163,74,0.07); color: #15803d; border-color: rgba(22,163,74,0.18); }
[data-theme="light"] .cat-us      { background: rgba(220,38,38,0.07); color: #b91c1c; border-color: rgba(220,38,38,0.18); }
[data-theme="light"] .cat-sports  { background: rgba(202,138,4,0.07); color: #92400e; border-color: rgba(202,138,4,0.18); }
[data-theme="light"] .cat-viral   { background: rgba(109,40,217,0.07); color: #6d28d9; border-color: rgba(109,40,217,0.18); }
[data-theme="light"] .cat-general { background: rgba(0,0,0,0.05); color: #64748b; border-color: rgba(0,0,0,0.1); }

.badge-verified {
  display: inline-flex; align-items: center; gap: 4px;
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 10px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase;
  color: #22c55e; border: 1px solid rgba(34,197,94,0.3); padding: 2px 7px; border-radius: 2px;
}
.live-badge {
  display: inline-flex; align-items: center; gap: 5px;
  background: var(--brand-red); color: white;
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 11px; font-weight: 800; letter-spacing: 1.5px;
  padding: 3px 10px; border-radius: 2px; animation: pulse-badge 2s ease-in-out infinite;
}

/* ═══════════════════════════════════════
   STATS BAR
═══════════════════════════════════════ */
.stats-bar {
  background: rgba(10,15,28,0.45); border-bottom: 1px solid var(--border-subtle);
  padding: 6px 20px;
}
[data-theme="light"] .stats-bar { background: rgba(255,255,255,0.6); }
.stat-item { display: flex; gap: 6px; align-items: baseline; white-space: nowrap; }
.stat-value { font-family: 'Barlow Condensed', sans-serif; font-size: 16px; font-weight: 800; }
.stat-label { font-family: 'Barlow Condensed', sans-serif; font-size: 10px; letter-spacing: 1px; color: var(--text-muted); text-transform: uppercase; }

/* ═══════════════════════════════════════
   NEWS CARDS
═══════════════════════════════════════ */
.news-card {
  background: var(--bg-card); border: 1px solid var(--border-subtle); border-radius: 6px;
  overflow: hidden; cursor: pointer; display: flex; flex-direction: column;
  transition: transform 0.22s cubic-bezier(0.34,1.56,0.64,1), box-shadow 0.22s ease, border-color 0.22s ease;
  animation: fadeSlideUp 0.4s ease-out both;
}
.news-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-hover); border-color: var(--border-accent); }

.card-image-wrap { position: relative; width: 100%; aspect-ratio: 16/9; overflow: hidden; background: var(--bg-elevated); flex-shrink: 0; }
.card-image-wrap img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.35s ease; }
.news-card:hover .card-image-wrap img { transform: scale(1.05); }
.card-img-overlay { position: absolute; inset: 0; background: linear-gradient(180deg, transparent 45%, rgba(10,15,28,0.9) 100%); }
[data-theme="light"] .card-img-overlay { background: linear-gradient(180deg, transparent 50%, rgba(255,255,255,0.4) 100%); }

.card-body { padding: 14px 16px 16px; flex: 1 1; display: flex; flex-direction: column; }
.card-title {
  font-family: 'Barlow Condensed', sans-serif; font-size: 17px; font-weight: 700; line-height: 1.3;
  color: var(--text-primary);
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
  margin-bottom: 8px; flex: 1 1;
}
.card-meta { display: flex; justify-content: space-between; align-items: center; margin-top: auto; padding-top: 10px; border-top: 1px solid var(--border-subtle); }
.card-source { font-family: 'Barlow', sans-serif; font-size: 11px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-time { font-family: 'Barlow Condensed', sans-serif; font-size: 12px; font-weight: 600; color: var(--brand-orange); white-space: nowrap; flex-shrink: 0; }

/* Hero Card */
.hero-card { position: relative; border-radius: 8px; overflow: hidden; background: var(--bg-elevated); cursor: pointer; min-height: 440px; max-height: 520px; }
.hero-card > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s ease; }
.hero-card:hover > img { transform: scale(1.03); }
.hero-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(10,15,28,1) 0%, rgba(10,15,28,0.82) 35%, rgba(10,15,28,0.3) 65%, transparent 100%);
}
.hero-content { position: absolute; bottom: 0; left: 0; right: 0; padding: 32px 28px 28px; }
.hero-title {
  font-family: 'Barlow Condensed', sans-serif; font-size: clamp(22px,3vw,36px); font-weight: 800; line-height: 1.15;
  color: white; margin-bottom: 12px; text-shadow: 0 2px 8px rgba(0,0,0,0.5);
}

/* Horizontal card */
.card-horizontal {
  display: flex; align-items: flex-start;
  background: var(--bg-card); border: 1px solid var(--border-subtle); border-radius: 6px;
  overflow: hidden; cursor: pointer;
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}
.card-horizontal:hover { border-color: var(--border-accent); box-shadow: var(--shadow-card); }
.card-horizontal-img { width: 120px; min-width: 120px; height: 88px; object-fit: cover; flex-shrink: 0; }
.card-horizontal-body { flex: 1 1; padding: 10px 12px; }

/* Compact list card */
.list-card { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border-subtle); cursor: pointer; transition: opacity 0.15s; }
.list-card:hover { opacity: 0.72; }
.list-card:last-child { border-bottom: none; }
.list-card-num { font-family: 'Barlow Condensed', sans-serif; font-size: 26px; font-weight: 900; color: rgba(255,30,30,0.2); line-height: 1; min-width: 28px; flex-shrink: 0; }
[data-theme="light"] .list-card-num { color: rgba(255,30,30,0.15); }
.list-card-title { font-family: 'Barlow Condensed', sans-serif; font-size: 14px; font-weight: 700; line-height: 1.35; color: var(--text-primary); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin-bottom: 4px; }

/* ═══════════════════════════════════════
   SIDEBAR
═══════════════════════════════════════ */
.sidebar-section { background: var(--bg-card); border: 1px solid var(--border-subtle); border-top: 3px solid var(--brand-red); border-radius: 0 0 6px 6px; padding: 16px; margin-bottom: 20px; }
.sidebar-title { font-family: 'Barlow Condensed', sans-serif; font-size: 11px; font-weight: 800; letter-spacing: 2.5px; text-transform: uppercase; color: var(--text-muted); margin-bottom: 14px; }

/* ═══════════════════════════════════════
   INPUTS & BUTTONS
═══════════════════════════════════════ */
.search-bar { background: var(--bg-input); border: 1px solid var(--border-medium); border-radius: 4px; display: flex; align-items: center; gap: 8px; padding: 0 12px; height: 38px; transition: border-color 0.15s, box-shadow 0.15s; }
.search-bar:focus-within { border-color: var(--brand-orange); box-shadow: 0 0 0 3px rgba(255,106,0,0.12); }
.search-input { background: none; border: none; outline: none; font-family: 'Barlow', sans-serif; font-size: 14px; color: var(--text-primary); width: 100%; }
.search-input::placeholder { color: var(--text-muted); }

.btn-primary { display: inline-flex; align-items: center; gap: 6px; background: linear-gradient(135deg, #FF6A00 0%, #FF1E1E 100%); color: white; border: none; border-radius: 4px; font-family: 'Barlow Condensed', sans-serif; font-size: 13px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; padding: 8px 18px; cursor: pointer; transition: opacity 0.15s, transform 0.15s; }
.btn-primary:hover { opacity: 0.88; transform: translateY(-1px); }

.btn-ghost { display: inline-flex; align-items: center; gap: 6px; background: none; color: var(--text-secondary); border: 1px solid var(--border-medium); border-radius: 4px; font-family: 'Barlow Condensed', sans-serif; font-size: 12px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; padding: 7px 14px; cursor: pointer; transition: color 0.15s, border-color 0.15s; }
.btn-ghost:hover { color: var(--text-primary); border-color: var(--border-strong); }

.btn-icon { display: flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 4px; background: none; border: 1px solid var(--border-subtle); color: var(--text-secondary); cursor: pointer; transition: all 0.15s; }
.btn-icon:hover { color: var(--text-primary); background: var(--bg-elevated); border-color: var(--border-medium); }

/* ═══════════════════════════════════════
   THEME TOGGLE
═══════════════════════════════════════ */
.theme-toggle { position: relative; width: 46px; height: 25px; cursor: pointer; border: none; background: none; padding: 0; }
.theme-toggle-track { width: 100%; height: 100%; border-radius: 12px; background: var(--bg-elevated); border: 1px solid var(--border-medium); transition: background 0.2s; display: flex; align-items: center; padding: 0 3px; }
.theme-toggle-thumb { width: 19px; height: 19px; border-radius: 50%; background: linear-gradient(135deg, #FF6A00 0%, #FF1E1E 100%); transition: transform 0.25s cubic-bezier(0.34,1.56,0.64,1); display: flex; align-items: center; justify-content: center; font-size: 11px; flex-shrink: 0; }
[data-theme="light"] .theme-toggle-thumb { transform: translateX(21px); }

/* ═══════════════════════════════════════
   READING PROGRESS
═══════════════════════════════════════ */
.reading-progress { position: fixed; top: 0; left: 0; z-index: 999; height: 3px; background: linear-gradient(90deg, #FF6A00, #FF1E1E); transition: width 0.1s linear; pointer-events: none; }

/* ═══════════════════════════════════════
   NEWSLETTER
═══════════════════════════════════════ */
.newsletter-section { background: linear-gradient(135deg, #160800 0%, #0D1B2A 100%); border: 1px solid rgba(255,106,0,0.18); border-radius: 8px; padding: 24px 20px; text-align: center; }
[data-theme="light"] .newsletter-section { background: linear-gradient(135deg, #fff8f5 0%, #f0f4ff 100%); border-color: rgba(255,106,0,0.14); }

/* ═══════════════════════════════════════
   SKELETONS
═══════════════════════════════════════ */
.skeleton { background: linear-gradient(90deg, var(--bg-elevated) 25%, var(--bg-card-hover, #162030) 50%, var(--bg-elevated) 75%); background-size: 200% 100%; animation: shimmer 1.4s ease-in-out infinite; border-radius: 4px; }

/* ═══════════════════════════════════════
   FOOTER
═══════════════════════════════════════ */
.site-footer { background: var(--bg-primary); border-top: 1px solid var(--border-subtle); padding: 48px 20px 32px; margin-top: 60px; }

/* ═══════════════════════════════════════
   LAYOUT
═══════════════════════════════════════ */
.container { max-width: 1400px; margin: 0 auto; padding: 0 20px; }
.section-divider { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
.section-divider-bar { width: 4px; height: 22px; background: var(--brand-red); border-radius: 2px; flex-shrink: 0; }
.section-divider-title { font-family: 'Barlow Condensed', sans-serif; font-size: 14px; font-weight: 800; letter-spacing: 2.5px; color: var(--text-secondary); text-transform: uppercase; }
.section-divider-count { margin-left: auto; font-family: 'Barlow Condensed', sans-serif; font-size: 11px; color: var(--text-muted); letter-spacing: 1px; text-transform: uppercase; }

/* ═══════════════════════════════════════
   SCROLLBAR
═══════════════════════════════════════ */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,106,0,0.3); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--brand-orange); }

/* ═══════════════════════════════════════
   KEYFRAMES
═══════════════════════════════════════ */
@keyframes ticker-scroll { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@keyframes blink { 0%,100% { opacity:1; } 50% { opacity:0.1; } }
@keyframes pulse-badge { 0%,100% { box-shadow:0 0 0 0 rgba(255,30,30,0.4); } 50% { box-shadow:0 0 0 6px rgba(255,30,30,0); } }
@keyframes fadeSlideUp { from { opacity:0; transform:translateY(12px); } to { opacity:1; transform:translateY(0); } }
@keyframes shimmer { from { background-position:200% 0; } to { background-position:-200% 0; } }
@keyframes spin { to { transform:rotate(360deg); } }

/* ═══════════════════════════════════════
   RESPONSIVE
═══════════════════════════════════════ */
@media (max-width: 1024px) {
  .sidebar-hide { display: none !important; }
  .main-grid { grid-template-columns: 1fr !important; }
}
@media (min-width: 1025px) {
  .mobile-trending { display: none !important; }
}
@media (max-width: 640px) {
  .hero-card { min-height: 300px; }
  .container { padding: 0 12px; }
  .stats-bar { display: none; }
  :root { --nav-height: 56px; }
}

