:root {
  --primary: #111827;
  --primary-light: #1f2937;
  --accent: #f5b838;
  --accent-hover: #e0a325;
  --accent-light: #fef3c7;
  --bg-main: #f8fafc;
  --bg-card: #ffffff;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --tag-tech: #0284c7;
  --tag-biz: #059669;
  --tag-sports: #dc2626;
  --tag-culture: #7c3aed;
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.04);
}

/* Dark Mode Theme */
body.dark-mode {
  --primary: #090d16;
  --primary-light: #151d2f;
  --bg-main: #0b0f19;
  --bg-card: #131b2e;
  --text-main: #f1f5f9;
  --text-muted: #94a3b8;
  --border: #1e293b;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.4);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Cairo', 'Tajawal', system-ui, -apple-system, sans-serif;
  background-color: var(--bg-main);
  color: var(--text-main);
  line-height: 1.6;
  direction: rtl;
  text-align: right;
  overflow-x: hidden;
  max-width: 100vw;
  transition: background-color 0.3s ease, color 0.3s ease;
}

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

a {
  text-decoration: none;
  color: inherit;
  transition: color 0.2s;
}

/* Container */
.container {
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 16px;
}

/* --- Top Bar --- */
.top-bar {
  background-color: var(--primary);
  color: #94a3b8;
  font-size: 13px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.top-bar .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
.top-bar-meta {
  display: flex;
  align-items: center;
  gap: 16px;
}
.top-bar-social {
  display: flex;
  align-items: center;
  gap: 12px;
}
.top-bar-social a:hover {
  color: var(--accent);
}

/* --- Main Header --- */
.main-header {
  background-color: var(--bg-card);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  transition: all 0.3s;
}
.header-wrapper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 74px;
}
.logo-container {
  display: flex;
  align-items: center;
  gap: 12px;
}
.logo-img {
  height: 48px;
  width: auto;
  object-fit: contain;
}

/* Desktop Navigation */
.desktop-nav {
  display: flex;
  align-items: center;
  gap: 24px;
}
.nav-link {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-main);
  padding: 8px 4px;
  position: relative;
}
.nav-link:hover, .nav-link.active {
  color: var(--accent-hover);
}
.nav-link.active::after {
  content: '';
  position: absolute;
  bottom: -4px;
  right: 0;
  left: 0;
  height: 3px;
  background-color: var(--accent);
  border-radius: 2px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}
.btn-icon {
  background: var(--bg-main);
  border: 1px solid var(--border);
  color: var(--text-main);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 16px;
  transition: all 0.2s;
}
.btn-icon:hover {
  background: var(--accent-light);
  color: #854d0e;
  border-color: var(--accent);
}
.mobile-menu-btn {
  display: none;
}

/* --- Mobile Drawer Menu --- */
.mobile-drawer {
  position: fixed;
  top: 0;
  right: -320px;
  width: 300px;
  height: 100vh;
  background: var(--bg-card);
  box-shadow: -4px 0 20px rgba(0, 0, 0, 0.2);
  z-index: 1000;
  transition: right 0.3s ease-in-out;
  display: flex;
  flex-direction: column;
  padding: 24px;
  overflow-y: auto;
}
.mobile-drawer.open {
  right: 0;
}
.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(2px);
  z-index: 999;
  display: none;
}
.drawer-backdrop.show {
  display: block;
}
.drawer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.drawer-nav {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.drawer-nav a {
  font-size: 18px;
  font-weight: 700;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
}
.drawer-nav a:hover {
  background-color: var(--bg-main);
  color: var(--accent-hover);
}

/* --- Breaking News Ticker --- */
.breaking-ticker {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  padding: 10px 0;
}
.ticker-content {
  display: flex;
  align-items: center;
  gap: 12px;
  overflow: hidden;
}
.ticker-badge {
  background: #ef4444;
  color: #ffffff;
  padding: 4px 12px;
  border-radius: 4px;
  font-weight: 800;
  font-size: 13px;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 6px;
}
.ticker-badge::before {
  content: '';
  width: 8px;
  height: 8px;
  background: #ffffff;
  border-radius: 50%;
  display: inline-block;
  animation: pulse 1.2s infinite;
}
@keyframes pulse {
  0% { transform: scale(0.9); opacity: 0.8; }
  50% { transform: scale(1.3); opacity: 1; }
  100% { transform: scale(0.9); opacity: 0.8; }
}
.ticker-text {
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* --- Ad Banners (IAB Standards) --- */
.ad-slot {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  position: relative;
  overflow: hidden;
  margin: 16px auto;
  background: transparent;
  border: none;
}
.dark-mode .ad-slot {
  background: transparent;
  border: none;
}
.ad-slot::before {
  display: none !important;
  content: "" !important;
}
.ad-leaderboard {
  width: 100%;
  max-width: 728px;
  min-height: 60px;
}
.ad-rectangle {
  width: 100%;
  max-width: 300px;
  min-height: 250px;
}
.ad-infeed {
  display: none !important;
}

/* --- Hero Section --- */
.hero-section {
  margin-top: 24px;
}
.hero-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 20px;
}
.hero-main-card {
  position: relative;
  border-radius: var(--radius-md);
  overflow: hidden;
  min-height: 420px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  box-shadow: var(--shadow-md);
}
.hero-main-card img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}
.hero-main-card:hover img {
  transform: scale(1.03);
}
.hero-overlay {
  position: relative;
  z-index: 2;
  background: linear-gradient(to top, rgba(15, 23, 42, 0.95) 0%, rgba(15, 23, 42, 0.6) 60%, transparent 100%);
  padding: 32px 24px;
  color: #ffffff;
}
.hero-sub-cards {
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.hero-sub-card {
  position: relative;
  border-radius: var(--radius-md);
  overflow: hidden;
  flex: 1;
  min-height: 200px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  box-shadow: var(--shadow-md);
}
.hero-sub-card img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}
.hero-sub-card:hover img {
  transform: scale(1.04);
}

/* Category Badges */
.badge {
  display: inline-block;
  font-size: 12px;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 4px;
  color: #ffffff;
  margin-bottom: 8px;
}
.badge-tech { background-color: var(--tag-tech); }
.badge-biz { background-color: var(--tag-biz); }
.badge-sports { background-color: var(--tag-sports); }
.badge-culture { background-color: var(--tag-culture); }

/* --- Layout Split (Main Content + Sidebar) --- */
.main-layout {
  display: grid;
  grid-template-columns: 8fr 4fr;
  gap: 30px;
  margin-top: 36px;
}

/* Section Headings */
.section-title-wrap {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 2px solid var(--border);
  margin-bottom: 20px;
  padding-bottom: 8px;
}
.section-title {
  font-size: 22px;
  font-weight: 900;
  position: relative;
  color: var(--text-main);
}
.section-title::after {
  content: '';
  position: absolute;
  bottom: -10px;
  right: 0;
  width: 48px;
  height: 3px;
  background-color: var(--accent);
}

/* News Cards Grid */
.news-cards-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}
.news-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  transition: transform 0.2s, box-shadow 0.2s;
}
.news-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}
.card-thumb {
  height: 190px;
  width: 100%;
  position: relative;
  overflow: hidden;
}
.card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.card-body {
  padding: 16px;
  flex: 1;
  display: flex;
  flex-direction: column;
}
.card-title {
  font-size: 17px;
  font-weight: 700;
  line-height: 1.4;
  margin-bottom: 8px;
}
.card-meta {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Sidebar Styling */
.sidebar-widget {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
}
.widget-title {
  font-size: 18px;
  font-weight: 800;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 8px;
}
.mini-news-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.mini-news-item {
  display: flex;
  gap: 12px;
  align-items: center;
}
.mini-news-thumb {
  width: 80px;
  height: 64px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  flex-shrink: 0;
}
.mini-news-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.mini-news-title {
  font-size: 14px;
  font-weight: 700;
  line-height: 1.35;
}

/* --- Podcast & Media Section (Highlighting Pvlix Mic Identity) --- */
.media-section {
  background: var(--primary);
  color: #ffffff;
  padding: 40px 0;
  margin-top: 48px;
  border-radius: var(--radius-lg);
}
.media-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
}
.media-title-box {
  display: flex;
  align-items: center;
  gap: 12px;
}
.media-badge {
  background: var(--accent);
  color: #111;
  font-weight: 900;
  font-size: 13px;
  padding: 4px 10px;
  border-radius: 4px;
}
.media-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.media-card {
  background: var(--primary-light);
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.media-card-img {
  position: relative;
  height: 170px;
}
.media-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.play-btn {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 48px;
  height: 48px;
  background: var(--accent);
  color: #111;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}
.media-card-info {
  padding: 16px;
}
.media-card-title {
  font-size: 16px;
  font-weight: 700;
  color: #ffffff;
}

/* --- Footer --- */
.main-footer {
  background: var(--primary);
  color: #94a3b8;
  margin-top: 60px;
  padding-top: 48px;
  border-top: 4px solid var(--accent);
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1.5fr;
  gap: 32px;
  padding-bottom: 40px;
}
.footer-logo {
  height: 44px;
  margin-bottom: 16px;
  filter: brightness(0) invert(1);
}
.footer-col h4 {
  color: #ffffff;
  font-size: 16px;
  font-weight: 800;
  margin-bottom: 16px;
}
.footer-col ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 14px;
}
.footer-col ul a:hover {
  color: var(--accent);
}
.newsletter-input {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}
.newsletter-input input {
  flex: 1;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid #334155;
  background: #1e293b;
  color: #ffffff;
  font-family: inherit;
  font-size: 14px;
}
.newsletter-input button {
  background: var(--accent);
  color: #111;
  border: none;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  font-weight: 800;
  cursor: pointer;
}
.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding: 20px 0;
  text-align: center;
  font-size: 13px;
}

/* --- RESPONSIVE MEDIA QUERIES (Mobile First Optimization) --- */

/* Tablets & Small Laptops */
@media (max-width: 1024px) {
  .hero-grid {
    grid-template-columns: 1fr;
  }
  .main-layout {
    grid-template-columns: 1fr;
  }
  .footer-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .media-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Mobile Phones (Screen <= 768px) */
@media (max-width: 768px) {
  .top-bar {
    display: none; /* Hide top bar on mobile to save vertical space */
  }
  .desktop-nav {
    display: none; /* Hide desktop nav */
  }
  .mobile-menu-btn {
    display: flex; /* Show hamburger button */
  }
  .header-wrapper {
    height: 60px;
  }
  .logo-img {
    height: 38px; /* Perfectly sized logo for phones */
  }
  
  .news-cards-grid {
    grid-template-columns: 1fr; /* Single column on phones */
  }
  .media-grid {
    grid-template-columns: 1fr;
  }
  .footer-grid {
    grid-template-columns: 1fr;
  }
  
  .hero-main-card {
    min-height: 300px;
  }
  .hero-overlay {
    padding: 20px 16px;
  }
  .hero-overlay h1 {
    font-size: 20px;
  }
  
  /* Make Ad slots responsive on mobile */
  .ad-leaderboard {
    min-height: 60px;
    font-size: 12px;
  }
}

/* --- LTR (English Language) Support --- */
html[dir="ltr"] body {
  direction: ltr;
  text-align: left;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

html[dir="ltr"] .mobile-drawer {
  right: auto;
  left: -320px;
  transition: left 0.3s ease-in-out;
}

html[dir="ltr"] .mobile-drawer.open {
  right: auto;
  left: 0;
}

html[dir="ltr"] .section-title::after {
  right: auto;
  left: 0;
}

html[dir="ltr"] .nav-link.active::after {
  right: auto;
  left: 0;
}

.lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--bg-main);
  border: 1px solid var(--border);
  padding: 6px 12px;
  border-radius: 20px;
  font-weight: 800;
  font-size: 13px;
  color: var(--text-main);
  transition: all 0.2s;
  cursor: pointer;
}

.lang-switch:hover {
  background: var(--accent);
  color: #111111;
  border-color: var(--accent);
}

/* --- AI Features Styling (Pvlix AI) --- */
.ai-badge {
  background: linear-gradient(135deg, #f5b838 0%, #ec4899 50%, #8b5cf6 100%);
  color: #ffffff;
  font-size: 12px;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 20px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 2px 8px rgba(236, 72, 153, 0.3);
}

.ai-summary-box {
  background: linear-gradient(135deg, rgba(245, 184, 56, 0.08) 0%, rgba(139, 92, 246, 0.08) 100%);
  border: 1px solid rgba(245, 184, 56, 0.3);
  border-right: 4px solid var(--accent);
  border-radius: var(--radius-md);
  padding: 20px;
  margin: 24px 0;
  position: relative;
  overflow: hidden;
}

.dark-mode .ai-summary-box {
  background: linear-gradient(135deg, rgba(245, 184, 56, 0.12) 0%, rgba(139, 92, 246, 0.12) 100%);
  border-color: rgba(245, 184, 56, 0.4);
}

.ai-summary-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.ai-summary-title {
  font-size: 16px;
  font-weight: 800;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 8px;
}

.ai-summary-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 15px;
  line-height: 1.6;
}

.ai-summary-list li {
  position: relative;
  padding-right: 20px;
  color: var(--text-main);
}

.ai-summary-list li::before {
  content: '⚡';
  position: absolute;
  right: 0;
  top: 1px;
  font-size: 12px;
}
