/* ══════════════════════════════════════════════════════
   Flixer Stream v2.0 — Premium Dark Theme
   ══════════════════════════════════════════════════════ */

:root {
  --bg-base: #06060a;
  --bg-surface: #0e0e14;
  --bg-surface-elevated: #14141e;
  --bg-card: #12121c;
  --bg-card-hover: #1a1a28;
  --bg-glass: rgba(14, 14, 20, 0.85);
  --bg-glass-heavy: rgba(6, 6, 10, 0.92);

  --accent-red: #e50914;
  --accent-red-glow: rgba(229, 9, 20, 0.4);
  --accent-gold: #f5c518;
  --accent-emerald: #10b981;
  --accent-blue: #3b82f6;
  --accent-purple: #8b5cf6;
  --accent-cyan: #06b6d4;

  --text-primary: #f0f0f5;
  --text-secondary: #9ca3af;
  --text-muted: #6b7280;

  --border-subtle: rgba(255, 255, 255, 0.06);
  --border-medium: rgba(255, 255, 255, 0.1);

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-full: 100px;

  --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --font-ar: 'Cairo', sans-serif;
  --font-en: 'Outfit', sans-serif;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-ar);
  background: var(--bg-base);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ═══ SCROLLBAR ═══ */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-base); }
::-webkit-scrollbar-thumb { background: var(--accent-red); border-radius: var(--radius-full); }

/* ═══ NAVBAR ═══ */
.navbar {
  position: fixed; top: 0; left: 0; right: 0;
  z-index: 1000;
  background: transparent;
  transition: var(--transition);
  padding: 12px 0;
}
.navbar.scrolled {
  background: var(--bg-glass-heavy);
  backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--border-subtle);
  padding: 8px 0;
}
.nav-container {
  max-width: 1400px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px; gap: 20px;
}
.nav-brand {
  display: flex; align-items: center; gap: 10px;
}
.logo-icon {
  width: 38px; height: 38px;
  background: linear-gradient(135deg, var(--accent-red), #ff4757);
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; color: #fff;
  box-shadow: 0 4px 15px var(--accent-red-glow);
}
.logo-text {
  font-family: var(--font-en); font-weight: 900;
  font-size: 22px; letter-spacing: -0.5px; color: #fff;
}
.logo-highlight { color: var(--accent-red); }
.badge-live {
  background: rgba(229, 9, 20, 0.15); border: 1px solid rgba(229, 9, 20, 0.3);
  color: var(--accent-red); font-size: 11px; font-weight: 700;
  padding: 4px 10px; border-radius: var(--radius-full);
  display: flex; align-items: center; gap: 4px;
}

.nav-links { display: flex; gap: 4px; }
.nav-link {
  background: transparent; border: none; color: var(--text-secondary);
  font-family: var(--font-ar); font-size: 14px; font-weight: 600;
  padding: 8px 16px; border-radius: var(--radius-full);
  cursor: pointer; transition: var(--transition);
  display: flex; align-items: center; gap: 6px;
}
.nav-link:hover { color: var(--text-primary); background: rgba(255,255,255,0.06); }
.nav-link.active { color: #fff; background: var(--accent-red); }

.nav-search {
  position: relative; display: flex; align-items: center;
}
.search-icon {
  position: absolute; right: 14px; color: var(--text-muted);
  font-size: 14px; pointer-events: none;
}
#searchInput {
  background: rgba(255,255,255,0.06); border: 1px solid var(--border-subtle);
  color: var(--text-primary); font-family: var(--font-ar); font-size: 14px;
  padding: 10px 40px 10px 36px; border-radius: var(--radius-full);
  width: 260px; outline: none; transition: var(--transition);
}
#searchInput:focus {
  border-color: var(--accent-red); background: rgba(255,255,255,0.1);
  width: 320px;
}
.clear-btn {
  position: absolute; left: 10px; background: transparent;
  border: none; color: var(--text-muted); cursor: pointer;
  font-size: 14px; transition: var(--transition);
}
.clear-btn:hover { color: var(--accent-red); }

/* ═══ HERO ═══ */
.hero-section {
  position: relative; height: 75vh; min-height: 500px;
  display: flex; align-items: flex-end; overflow: hidden;
}
.hero-backdrop {
  position: absolute; inset: 0;
  background-size: cover; background-position: center top;
  transition: background-image 0.6s ease;
}
.hero-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(to top,
    var(--bg-base) 0%,
    rgba(6,6,10,0.85) 30%,
    rgba(6,6,10,0.4) 60%,
    rgba(6,6,10,0.2) 100%
  );
}
.hero-content {
  position: relative; z-index: 2;
  padding: 0 48px 60px; max-width: 700px;
}
.hero-badge {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(245, 197, 24, 0.15); border: 1px solid rgba(245, 197, 24, 0.3);
  color: var(--accent-gold); font-size: 12px; font-weight: 700;
  padding: 6px 14px; border-radius: var(--radius-full);
  margin-bottom: 16px;
}
.hero-title {
  font-size: 48px; font-weight: 900;
  line-height: 1.15; margin-bottom: 14px;
  text-shadow: 0 4px 20px rgba(0,0,0,0.6);
}
.hero-overview {
  font-size: 16px; line-height: 1.7;
  color: var(--text-secondary); margin-bottom: 20px;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical;
  overflow: hidden;
}
.hero-meta { display: flex; gap: 14px; align-items: center; margin-bottom: 24px; }
.meta-item { font-size: 14px; color: var(--text-secondary); font-weight: 600; }
.meta-badge {
  background: rgba(229, 9, 20, 0.15); border: 1px solid rgba(229, 9, 20, 0.3);
  color: var(--accent-red); font-size: 12px; font-weight: 700;
  padding: 4px 12px; border-radius: var(--radius-full);
}
.gold { color: var(--accent-gold); }
.hero-actions { display: flex; gap: 12px; }
.btn {
  border: none; font-family: var(--font-ar); font-size: 15px; font-weight: 700;
  padding: 12px 28px; border-radius: var(--radius-full);
  cursor: pointer; display: inline-flex; align-items: center; gap: 8px;
  transition: var(--transition);
}
.btn-primary {
  background: var(--accent-red); color: #fff;
  box-shadow: 0 4px 20px var(--accent-red-glow);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 8px 30px var(--accent-red-glow); }
.btn-secondary {
  background: rgba(255,255,255,0.1); color: #fff;
  border: 1px solid var(--border-medium);
}
.btn-secondary:hover { background: rgba(255,255,255,0.15); }

/* ═══ FILTER BAR ═══ */
.filter-bar {
  background: var(--bg-glass-heavy);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
  padding: 16px 0;
  position: sticky; top: 60px; z-index: 100;
}
.filter-container {
  max-width: 1400px; margin: 0 auto;
  display: flex; align-items: center; gap: 16px;
  padding: 0 24px; flex-wrap: wrap;
}
.filter-group {
  display: flex; align-items: center; gap: 8px;
}
.filter-group label {
  font-size: 13px; color: var(--text-muted); font-weight: 600;
  white-space: nowrap; display: flex; align-items: center; gap: 4px;
}
.filter-select {
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  font-family: var(--font-ar); font-size: 13px;
  padding: 8px 14px; border-radius: var(--radius-md);
  outline: none; cursor: pointer; min-width: 120px;
}
.filter-select:focus { border-color: var(--accent-red); }
.filter-apply-btn {
  background: var(--accent-red); color: #fff;
  border: none; font-family: var(--font-ar); font-size: 13px; font-weight: 700;
  padding: 8px 20px; border-radius: var(--radius-full);
  cursor: pointer; display: flex; align-items: center; gap: 6px;
  transition: var(--transition);
}
.filter-apply-btn:hover { box-shadow: 0 4px 15px var(--accent-red-glow); }

/* ═══ MAIN CONTENT ═══ */
.main-container {
  max-width: 1400px; margin: 0 auto;
  padding: 32px 24px 60px;
}
.section-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 24px;
}
.section-title {
  font-size: 22px; font-weight: 700;
  display: flex; align-items: center; gap: 10px;
}
.status-indicator {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; color: var(--text-muted);
}
.dot {
  width: 8px; height: 8px;
  background: var(--accent-emerald);
  border-radius: 50%;
}
.dot.pulse { animation: pulse 2s infinite; }
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.6); }
  50% { box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
}

/* ═══ MEDIA GRID ═══ */
.media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 20px;
}
.media-card {
  border-radius: var(--radius-lg);
  overflow: hidden; cursor: pointer;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  transition: var(--transition);
}
.media-card:hover {
  transform: translateY(-6px) scale(1.02);
  border-color: var(--accent-red);
  box-shadow: 0 12px 40px rgba(229, 9, 20, 0.15);
}
.card-poster {
  position: relative; aspect-ratio: 2/3; overflow: hidden;
}
.card-poster img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform 0.4s ease;
}
.media-card:hover .card-poster img { transform: scale(1.08); }
.card-badge {
  position: absolute; top: 10px; right: 10px;
  background: var(--accent-red); color: #fff;
  font-size: 11px; font-weight: 700;
  padding: 4px 10px; border-radius: var(--radius-full);
}
.card-play-overlay {
  position: absolute; inset: 0;
  background: rgba(0,0,0,0.5);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: var(--transition);
}
.media-card:hover .card-play-overlay { opacity: 1; }
.play-icon-circle {
  width: 50px; height: 50px;
  background: var(--accent-red);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; color: #fff;
  box-shadow: 0 4px 20px var(--accent-red-glow);
  transform: scale(0.8); transition: var(--transition);
}
.media-card:hover .play-icon-circle { transform: scale(1); }
.card-content { padding: 12px 14px; }
.card-title {
  font-size: 14px; font-weight: 700;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  margin-bottom: 6px;
}
.card-footer {
  display: flex; justify-content: space-between;
  font-size: 12px; color: var(--text-muted);
}

/* Skeleton */
.skeleton-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  aspect-ratio: 2/3;
  animation: shimmer 1.5s infinite;
}
@keyframes shimmer {
  0% { opacity: 0.3; }
  50% { opacity: 0.6; }
  100% { opacity: 0.3; }
}

/* ═══ PAGINATION ═══ */
.pagination {
  display: flex; justify-content: center; align-items: center;
  gap: 8px; margin-top: 40px; flex-wrap: wrap;
}
.page-btn {
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-family: var(--font-en); font-size: 14px; font-weight: 600;
  width: 40px; height: 40px;
  border-radius: var(--radius-md);
  cursor: pointer; transition: var(--transition);
  display: flex; align-items: center; justify-content: center;
}
.page-btn:hover { border-color: var(--accent-red); color: var(--accent-red); }
.page-btn.active {
  background: var(--accent-red); color: #fff; border-color: var(--accent-red);
}
.page-btn:disabled { opacity: 0.3; cursor: not-allowed; }

/* ═══ PLAYER MODAL ═══ */
.player-modal {
  position: fixed;
  top: 0; left: 0; width: 100vw; height: 100vh;
  z-index: 99999;
  opacity: 0; visibility: hidden;
  pointer-events: none;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}
.player-modal.active {
  opacity: 1; visibility: visible;
  pointer-events: auto;
}
.modal-overlay {
  position: fixed; top: 0; left: 0; width: 100vw; height: 100vh;
  background: rgba(0,0,0,0.88);
  backdrop-filter: blur(12px);
}
.modal-container {
  position: fixed;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  z-index: 100000;
  width: 90vw; max-width: 1150px;
  max-height: 90vh; overflow-y: auto;
  background: var(--bg-surface);
  border-radius: var(--radius-xl);
  border: 1px solid var(--border-medium);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.9), 0 0 60px rgba(229, 9, 20, 0.25);
}
.player-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 16px 20px;
  background: var(--bg-surface-elevated);
  border-bottom: 1px solid var(--border-subtle);
}
.player-title-box { display: flex; align-items: center; gap: 12px; }
.player-title-box h3 { font-size: 18px; font-weight: 700; }
.player-media-type {
  background: var(--accent-red); color: #fff;
  font-size: 11px; font-weight: 700;
  padding: 3px 10px; border-radius: var(--radius-full);
}
.player-controls-top { display: flex; align-items: center; gap: 12px; }
.custom-select {
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  font-family: var(--font-ar); font-size: 13px;
  padding: 6px 12px; border-radius: var(--radius-md);
  outline: none; cursor: pointer;
}
.close-modal-btn {
  width: 36px; height: 36px;
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  border-radius: 50%; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; transition: var(--transition);
}
.close-modal-btn:hover { background: var(--accent-red); color: #fff; border-color: var(--accent-red); }

/* Player Frame */
.player-frame-wrapper {
  position: relative; width: 100%;
  aspect-ratio: 16/9; background: #000;
  overflow: hidden;
}
.player-loader {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  background: rgba(0,0,0,0.8); z-index: 5;
  gap: 16px;
}
.spinner {
  width: 44px; height: 44px;
  border: 3px solid var(--border-medium);
  border-top-color: var(--accent-red);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
.spinner-sm {
  width: 20px; height: 20px;
  border: 2px solid var(--border-medium);
  border-top-color: var(--accent-red);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loader-text { font-size: 14px; color: var(--text-secondary); }

.native-video {
  width: 100%; height: 100%;
  object-fit: contain; background: #000;
}
#videoIframe {
  width: 100%; height: 100%;
  border: none; background: #000;
}

/* Custom Controls */
.custom-video-controls {
  position: absolute; bottom: 0; left: 0; right: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.95) 0%, rgba(0,0,0,0.5) 60%, transparent 100%);
  padding: 16px 20px 12px;
  display: flex; flex-direction: column; gap: 10px;
  z-index: 10; opacity: 0; transition: opacity 0.3s ease;
}
.player-frame-wrapper:hover .custom-video-controls { opacity: 1; }

.progress-container {
  width: 100%; height: 6px;
  background: rgba(255,255,255,0.2); border-radius: 3px;
  cursor: pointer; transition: height 0.15s ease;
}
.progress-container:hover { height: 10px; }
.progress-bar {
  height: 100%; width: 0%;
  background: var(--accent-red); border-radius: 3px;
  box-shadow: 0 0 10px var(--accent-red-glow);
  position: relative;
}
.progress-bar::after {
  content: ''; position: absolute;
  left: 100%; top: 50%;
  transform: translate(-50%, -50%);
  width: 12px; height: 12px;
  background: #fff; border-radius: 50%;
  box-shadow: 0 0 8px rgba(0,0,0,0.5);
  opacity: 0; transition: opacity 0.15s ease;
}
.progress-container:hover .progress-bar::after { opacity: 1; }
.controls-row {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.controls-left, .controls-right {
  display: flex; align-items: center; gap: 12px;
}
.ctrl-btn {
  background: transparent; border: none; color: #fff;
  font-size: 16px; width: 34px; height: 34px;
  border-radius: 50%; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: var(--transition);
}
.ctrl-btn:hover { background: rgba(255,255,255,0.15); color: var(--accent-red); transform: scale(1.1); }
.volume-box { display: flex; align-items: center; gap: 6px; }
.volume-slider { width: 70px; accent-color: var(--accent-red); cursor: pointer; }
.time-display { font-size: 13px; font-family: var(--font-en); color: var(--text-secondary); }

/* ═══ STREAMS SECTION (Provider Cards) ═══ */
.streams-section {
  border-top: 1px solid var(--border-subtle);
}
.streams-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 20px;
  background: var(--bg-surface-elevated);
}
.streams-header h4 {
  font-size: 15px; font-weight: 700;
  display: flex; align-items: center; gap: 8px;
}
.streams-tabs { display: flex; gap: 4px; }
.stream-tab {
  background: transparent; border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-family: var(--font-ar); font-size: 12px; font-weight: 600;
  padding: 5px 14px; border-radius: var(--radius-full);
  cursor: pointer; transition: var(--transition);
}
.stream-tab:hover { border-color: var(--accent-red); color: var(--accent-red); }
.stream-tab.active { background: var(--accent-red); color: #fff; border-color: var(--accent-red); }

.streams-list {
  padding: 12px 16px;
  max-height: 280px; overflow-y: auto;
  display: flex; flex-direction: column; gap: 8px;
}
.stream-loading {
  display: flex; align-items: center; justify-content: center;
  gap: 10px; padding: 30px;
  font-size: 14px; color: var(--text-muted);
}

/* Individual Stream Card */
.stream-card {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  cursor: pointer; transition: var(--transition);
  gap: 12px;
}
.stream-card:hover {
  background: rgba(229, 9, 20, 0.08);
  border-color: rgba(229, 9, 20, 0.3);
}
.stream-card.active-stream {
  background: rgba(229, 9, 20, 0.12);
  border-color: var(--accent-red);
}
.stream-info {
  display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0;
}
.stream-logo {
  font-size: 22px; width: 36px; text-align: center; flex-shrink: 0;
}
.stream-details { min-width: 0; }
.stream-name {
  font-size: 13px; font-weight: 700;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.stream-meta {
  font-size: 11px; color: var(--text-muted);
  display: flex; align-items: center; gap: 8px; margin-top: 2px;
}
.stream-badges {
  display: flex; align-items: center; gap: 6px; flex-shrink: 0;
}
.quality-badge {
  font-size: 11px; font-weight: 700;
  padding: 3px 8px; border-radius: var(--radius-sm);
}
.quality-badge.q-4k { background: rgba(139, 92, 246, 0.2); color: var(--accent-purple); }
.quality-badge.q-1080p { background: rgba(59, 130, 246, 0.2); color: var(--accent-blue); }
.quality-badge.q-720p { background: rgba(6, 182, 212, 0.2); color: var(--accent-cyan); }
.quality-badge.q-auto { background: rgba(107, 114, 128, 0.2); color: var(--text-muted); }
.type-badge {
  font-size: 10px; font-weight: 700;
  padding: 3px 8px; border-radius: var(--radius-sm);
  text-transform: uppercase;
}
.type-badge.t-embed { background: rgba(16, 185, 129, 0.15); color: var(--accent-emerald); }
.type-badge.t-direct { background: rgba(59, 130, 246, 0.15); color: var(--accent-blue); }
.type-badge.t-torrent { background: rgba(245, 197, 24, 0.15); color: var(--accent-gold); }
.status-dot {
  width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0;
}
.status-dot.working { background: var(--accent-emerald); box-shadow: 0 0 6px rgba(16, 185, 129, 0.5); }
.status-dot.failed { background: #ef4444; }
.stream-play-btn {
  background: var(--accent-red); border: none; color: #fff;
  font-size: 12px; padding: 6px 14px; border-radius: var(--radius-full);
  cursor: pointer; font-weight: 700; font-family: var(--font-ar);
  transition: var(--transition); flex-shrink: 0;
  display: flex; align-items: center; gap: 4px;
}
.stream-play-btn:hover { box-shadow: 0 4px 12px var(--accent-red-glow); }

/* Torrent Info */
.torrent-info {
  font-size: 11px; color: var(--text-muted);
  display: flex; gap: 8px; margin-top: 2px;
}
.torrent-info .seeds { color: var(--accent-emerald); }
.torrent-info .size { color: var(--accent-cyan); }

/* Player Footer */
.player-footer {
  padding: 16px 24px;
  background: var(--bg-surface-elevated);
  border-top: 1px solid var(--border-subtle);
  font-size: 14px; color: var(--text-secondary);
  line-height: 1.7;
}

/* ═══ FOOTER ═══ */
.footer {
  background: var(--bg-surface);
  border-top: 1px solid var(--border-subtle);
  padding: 24px; text-align: center;
}
.footer p { font-size: 13px; color: var(--text-muted); }

/* ═══ UTILITIES ═══ */
.hidden { display: none !important; }

/* ═══ QUALITY CATEGORIES GRID ═══ */
.categories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  padding: 12px 4px;
}
.category-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}
.category-card:hover {
  background: rgba(255, 255, 255, 0.06);
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

/* Category Specific Hover Borders */
.category-card.cat-4k:hover { border-color: var(--accent-purple); }
.category-card.cat-1080p:hover { border-color: var(--accent-blue); }
.category-card.cat-720p:hover { border-color: var(--accent-cyan); }
.category-card.cat-torrent:hover { border-color: var(--accent-gold); }
.category-card.cat-embed:hover { border-color: var(--accent-red); }

.category-icon {
  font-size: 28px;
  width: 48px;
  height: 48px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.category-info {
  flex: 1;
  min-width: 0;
}
.category-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 3px;
}
.category-desc {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.category-count {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.08);
  padding: 4px 12px;
  border-radius: var(--radius-full);
  white-space: nowrap;
}

/* ═══ BACK BUTTON CONTAINER ═══ */
.back-btn-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 4px 16px;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 12px;
}
.back-to-categories-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  font-family: var(--font-ar);
  font-size: 12px;
  font-weight: 700;
  padding: 8px 16px;
  border-radius: var(--radius-full);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: var(--transition);
}
.back-to-categories-btn:hover {
  background: var(--accent-red);
  border-color: var(--accent-red);
  color: #fff;
}
.selected-category-label {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-secondary);
}

/* ═══ RESPONSIVE ═══ */
@media (max-width: 768px) {
  .nav-links { display: none; }
  #searchInput { width: 180px; }
  #searchInput:focus { width: 220px; }
  .hero-title { font-size: 28px; }
  .hero-content { padding: 0 20px 40px; }
  .hero-section { height: 60vh; }
  .filter-container { gap: 10px; }
  .filter-group { flex: 1 1 45%; }
  .media-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
  .modal-container { width: 100vw; max-width: 100%; border-radius: var(--radius-md); }
  .streams-list { max-height: 350px; }
  .stream-card { flex-wrap: wrap; }
  .categories-grid { grid-template-columns: 1fr; }
}

/* --- POPUP MENUS --- */
.menu-container {
  position: relative;
  display: inline-block;
}

.popup-menu {
  position: absolute;
  bottom: 50px;
  right: 0;
  background: rgba(15, 15, 20, 0.95);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 10px;
  min-width: 150px;
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 5px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
  transition: opacity 0.2s, transform 0.2s;
}

.popup-menu.hidden {
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
}

.menu-title {
  color: var(--text-secondary);
  font-size: 12px;
  margin-bottom: 5px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  padding-bottom: 5px;
  text-align: center;
}

.menu-list {
  display: flex;
  flex-direction: column;
  max-height: 200px;
  overflow-y: auto;
}

.menu-item {
  background: none;
  border: none;
  color: #fff;
  padding: 8px 10px;
  text-align: right;
  border-radius: 4px;
  cursor: pointer;
  font-size: 13px;
  transition: 0.2s;
}

.menu-item:hover {
  background: rgba(255, 255, 255, 0.1);
}

.menu-item.active {
  background: var(--accent-red);
  color: #fff;
}

