/* =========================
   THEME TOKENS
   ========================= */
:root {
  /* fallback */
  --radius: 16px;
  --radius-sm: 12px;
  --shadow: 0 12px 28px rgba(0,0,0,0.35);
  --shadow-soft: 0 10px 24px rgba(0,0,0,0.18);
  --ring: 0 0 0 3px rgba(255, 210, 74, 0.25);

  --font: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  /* Optional Arabic: "Tajawal", system-ui, ... */
  --font-ar: var(--font);
}

/* Dark (default) */
html[data-theme="dark"] {
  --bg: #0b0f14;
  --surface: #141b25;
  --surface-2: #101621;
  --border: #1c2430;
  --text: #eef3ff;
  --muted: #7d8aa3;
  --accent: #ffd24a;
  --accent-2: #00d4ff;
}

/* Light */
html[data-theme="light"] {
  --bg: #f6f7fb;
  --surface: #ffffff;
  --surface-2: #f0f2f8;
  --border: #e4e8f1;
  --text: #121826;
  --muted: #5b667a;
  --accent: #7b2ff7;
  --accent-2: #00a6c7;
  --shadow: 0 18px 34px rgba(18, 24, 38, 0.12);
  --shadow-soft: 0 10px 20px rgba(18, 24, 38, 0.10);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  line-height: 1.6;
}

/* Arabic mode */
html[lang="ar"] body {
  font-family: var(--font-ar);
}

/* Layout helper */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 18px;
}

/* =========================
   TOPBAR
   ========================= */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in oklab, var(--bg) 85%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.topbar-inner {
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Brand */
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
}

.brand-logo {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  box-shadow: var(--shadow-soft);
}

.brand-name {
  font-weight: 800;
  letter-spacing: 0.4px;
}

/* RTL flip */
html[dir="rtl"] .brand {
  flex-direction: row-reverse;
}

.topbar-actions {
  display: flex;
  gap: 10px;
}

/* Buttons */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.chip:hover { transform: translateY(-1px); box-shadow: var(--shadow-soft); }
.chip:focus { outline: none; box-shadow: var(--ring); }
.chip-icon { opacity: 0.9; }

/* =========================
   HERO
   ========================= */
.hero {
  padding: 48px 0 22px;
}

.hero-inner {
  display: grid;
  grid-template-columns: 1.3fr 0.7fr;
  gap: 22px;
  align-items: stretch;
}

@media (max-width: 920px) {
  .hero-inner { grid-template-columns: 1fr; }
}

.hero-title {
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  line-height: 1.15;
  margin: 0 0 10px;
  font-weight: 900;
}

.hero-subtitle {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 1.03rem;
}

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

.badge {
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: color-mix(in oklab, var(--surface) 80%, transparent);
  color: var(--text);
  font-weight: 600;
}

/* Right hero card */
.hero-card {
  border: 1px solid var(--border);
  background: linear-gradient(180deg, var(--surface), color-mix(in oklab, var(--surface-2) 80%, transparent));
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow-soft);
}

/* Pulse header */
.hero-card-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.pulse {
  width: 10px;
  height: 10px;
  background: var(--accent);
  border-radius: 50%;
  box-shadow: 0 0 0 0 rgba(255, 210, 74, 0.6);
  animation: pulseAnim 1.8s infinite;
}

@keyframes pulseAnim {
  0% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(255, 210, 74, 0.6);
  }
  70% {
    transform: scale(1.4);
    box-shadow: 0 0 0 10px rgba(255, 210, 74, 0);
  }
  100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(255, 210, 74, 0);
  }
}

.hero-card-title {
  font-weight: 800;
  margin-bottom: 8px;
}

.hero-card-desc {
  color: var(--muted);
  font-size: 0.95rem;
}

/* Last updated line */
.hero-updated {
  margin-top: 10px;
  font-size: 0.85rem;
  color: var(--muted);
}

/* =========================
   NEWS
   ========================= */
.news {
  margin: 26px 0 44px;
}

.news-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.section-title {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 800;
}

.section-hint {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.news-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

@media (max-width: 820px) {
  .news-grid { grid-template-columns: 1fr; }
}

.news-card {
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: var(--radius);
  padding: 16px 16px 14px;
  box-shadow: var(--shadow-soft);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.news-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }

.news-card h3 {
  margin: 0 0 10px;
  font-size: 1rem;
  line-height: 1.55;
  font-weight: 700;
}

.news-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
  font-size: 0.82rem;
  gap: 10px;
}

.source-pill {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: color-mix(in oklab, var(--surface-2) 70%, transparent);
}

.read-link {
  color: var(--accent);
  text-decoration: none;
  font-weight: 700;
}

.read-link:hover { text-decoration: underline; }

/* RTL adjustments */
html[dir="rtl"] .news-card h3 { text-align: right; }
html[dir="rtl"] .news-meta { flex-direction: row-reverse; }

/* Skeleton */
.skeleton {
  height: 16px;
  border-radius: 10px;
  background: linear-gradient(
    90deg,
    color-mix(in oklab, var(--surface) 80%, transparent),
    color-mix(in oklab, var(--surface-2) 85%, transparent),
    color-mix(in oklab, var(--surface) 80%, transparent)
  );
  background-size: 200% 100%;
  animation: shimmer 1.15s infinite linear;
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* =========================
   FEATURES
   ========================= */
.features {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin: 0 0 64px;
}

@media (max-width: 920px) {
  .features { grid-template-columns: 1fr; }
}

.feature {
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow-soft);
}

.feature h3 { margin: 0 0 6px; }
.feature p { margin: 0; color: var(--muted); }

/* =========================
   FOOTER
   ========================= */
.footer {
  border-top: 1px solid var(--border);
  padding: 24px 0;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  color: var(--muted);
  flex-wrap: wrap;
}

.footer-legal {
  max-width: 680px;
}

/* =========================
   LIVE UPDATE ANIMATION
   ========================= */
.fade-in {
  animation: fadeIn 0.45s ease-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Glow for new articles */
.glow {
  animation: glowAnim 1.2s ease-out;
}

@keyframes glowAnim {
  0% { box-shadow: 0 0 0px var(--accent); }
  50% { box-shadow: 0 0 18px var(--accent); }
  100% { box-shadow: 0 0 0px var(--accent); }
}
