:root {
  --bg: #07080D;
  --bg-alt: #0D0E14;
  --bg-card: #0F0F14;
  --text: #E8E9ED;
  --text-soft: rgba(255,255,255,0.82);
  --text-muted: rgba(255,255,255,0.62);
  --text-faint: rgba(255,255,255,0.70);
  --text-dim: rgba(255,255,255,0.58);
  --border: rgba(255,255,255,0.06);
  --border-light: rgba(255,255,255,0.08);
  --border-med: rgba(255,255,255,0.1);
  --surface: rgba(255,255,255,0.04);
  --surface-hover: rgba(255,255,255,0.06);
  --surface-med: rgba(255,255,255,0.08);
  --surface-strong: rgba(255,255,255,0.1);
  --overlay: rgba(0,0,0,0.7);
  --sidebar-bg: rgba(10,10,15,0.95);
  --header-bg: rgba(7,8,13,0.95);
  --panel-bg: rgba(15,15,20,0.95);
  --card-shadow: 0 2px 20px rgba(0,0,0,0.3);
  --scroll-thumb: rgba(255,255,255,0.1);
  --scroll-thumb-hover: rgba(255,255,255,0.2);
  --card-gradient: linear-gradient(135deg, rgba(255,255,255,0.04) 0%, rgba(255,255,255,0.01) 100%);
  --card-active-gradient: linear-gradient(135deg, rgba(225,29,72,0.08) 0%, rgba(255,255,255,0.02) 100%);
  --banner-overlay: linear-gradient(135deg, rgba(7,8,13,0.95), rgba(7,8,13,0.7));
}

body.light-theme {
  --bg: #F2F4F8;
  --bg-alt: #FFFFFF;
  --bg-card: #FFFFFF;
  --text: #1A1B2E;
  --text-soft: rgba(0,0,0,0.78);
  --text-muted: rgba(0,0,0,0.62);
  --text-faint: rgba(0,0,0,0.70);
  --text-dim: rgba(0,0,0,0.58);
  --border: rgba(0,0,0,0.08);
  --border-light: rgba(0,0,0,0.06);
  --border-med: rgba(0,0,0,0.1);
  --surface: rgba(0,0,0,0.03);
  --surface-hover: rgba(0,0,0,0.05);
  --surface-med: rgba(0,0,0,0.06);
  --surface-strong: rgba(0,0,0,0.08);
  --overlay: rgba(0,0,0,0.5);
  --sidebar-bg: rgba(255,255,255,0.98);
  --header-bg: rgba(242,244,248,0.95);
  --panel-bg: rgba(255,255,255,0.98);
  --card-shadow: 0 2px 12px rgba(0,0,0,0.08);
  --scroll-thumb: rgba(0,0,0,0.12);
  --scroll-thumb-hover: rgba(0,0,0,0.2);
  --card-gradient: linear-gradient(135deg, rgba(0,0,0,0.02) 0%, rgba(0,0,0,0.005) 100%);
  --card-active-gradient: linear-gradient(135deg, rgba(225,29,72,0.06) 0%, rgba(0,0,0,0.01) 100%);
  --banner-overlay: linear-gradient(135deg, rgba(20,20,40,0.85), rgba(20,20,40,0.6));
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  min-height: 100vh;
  overflow-x: hidden;
}

::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--scroll-thumb); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--scroll-thumb-hover); }

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(15px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #EF4444;
  animation: pulse 1.5s infinite;
  display: inline-block;
  box-shadow: 0 0 8px rgba(239,68,68,0.6);
}

.nav-item {
  cursor: pointer;
  transition: all 0.2s ease;
}
.nav-item:hover {
  background: var(--surface-hover) !important;
}

.channel-card {
  cursor: pointer;
  min-width: 0;
  overflow: hidden;
  transition: transform 0.2s ease, border-color 0.2s ease;
  contain: layout style paint;
  content-visibility: auto;
  contain-intrinsic-size: auto 200px;
}
.channel-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-med) !important;
}
.channel-card:hover .play-btn {
  transform: scale(1.1);
}

.fav-btn {
  cursor: pointer;
  transition: transform 0.2s ease;
}
.fav-btn:hover {
  transform: scale(1.2);
}

.category-btn {
  cursor: pointer;
  transition: all 0.25s ease;
}
.category-btn:hover {
  background: var(--surface-strong) !important;
}

.play-btn {
  transition: all 0.3s ease;
}

.sidebar-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 150;
  backdrop-filter: blur(4px);
}

.mobile-sidebar {
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  width: 280px;
  background: var(--sidebar-bg);
  z-index: 160;
  overflow-y: auto;
  animation: slideIn 0.3s ease;
  border-right: 1px solid var(--border);
}

@keyframes slideIn {
  from { transform: translateX(-100%); }
  to { transform: translateX(0); }
}

.search-input {
  background: var(--surface);
  border: 1px solid var(--border-light);
  color: var(--text);
  padding: 12px 16px 12px 44px;
  border-radius: 12px;
  font-size: 14px;
  width: 100%;
  outline: none;
  font-family: 'Outfit', sans-serif;
  transition: all 0.25s ease;
}
.search-input:focus {
  border-color: rgba(99,102,241,0.5);
  background: var(--surface-med);
  box-shadow: 0 0 20px rgba(99,102,241,0.15);
}
.search-input::placeholder {
  color: var(--text-dim);
}

.desktop-sidebar {
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  width: 260px;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  z-index: 100;
  backdrop-filter: blur(20px);
}

.mobile-header {
  display: none;
}

.main-content {
  margin-left: 260px;
  min-height: 100vh;
  position: relative;
  z-index: 1;
}

.sticky-menu {
  position: sticky;
  top: 0;
  z-index: 30;
  background: var(--header-bg);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}

.channel-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
  padding: 0 32px 40px;
}


.ptv-station-card {
  cursor: pointer;
  transition: all 0.2s ease;
}
.ptv-station-card:hover {
  background: var(--surface-hover) !important;
  border-color: #6366F1 !important;
  transform: translateY(-1px);
}

.ptv-back-btn {
  transition: all 0.2s ease;
}
.ptv-back-btn:hover {
  background: var(--surface-hover) !important;
}

#featured-container {
  contain: layout style;
  min-height: 420px;
  transition: min-height 0.25s ease;
}

#grid-container {
  contain: content;
  min-height: 80vh;
}

.channel-grid {
  contain: layout style;
}


.ambient-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background: radial-gradient(ellipse at 20% 50%, rgba(99,102,241,0.06) 0%, transparent 60%),
              radial-gradient(ellipse at 80% 20%, rgba(236,72,153,0.04) 0%, transparent 50%),
              radial-gradient(ellipse at 50% 80%, rgba(16,185,129,0.04) 0%, transparent 50%);
}

/* Football match mobile */
.football-match .fm-teams-row { display: flex; align-items: center; gap: 8px; }

@media (max-width: 768px) {
  .desktop-sidebar { display: none !important; }
  .mobile-header { display: flex !important; }
  .main-content { margin-left: 0 !important; }
  .channel-grid {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)) !important;
    gap: 12px !important;
    padding: 0 16px 40px !important;
  }
  #featured-container { min-height: 270px; }
  .featured-section { height: auto !important; min-height: 0 !important; }
  .movie-poster { width: 90px !important; height: 130px !important; border-radius: 10px !important; }
  .movie-content { padding: 16px !important; gap: 14px !important; }
  .featured-title { font-size: 18px !important; }
  .featured-badges { gap: 5px !important; margin-bottom: 8px !important; }
  .featured-bottom { gap: 6px !important; row-gap: 6px !important; }
  .featured-arrows { display: none !important; }
  .featured-wrap { padding: 0 16px !important; }
  .featured-dots { margin-top: 10px !important; gap: 4px !important; overflow-x: auto !important; max-width: 100% !important; justify-content: flex-start !important; padding: 0 16px !important; scrollbar-width: none !important; }
  .featured-desc { display: none !important; }
  .featured-director { display: none !important; }
  .featured-subtitle { display: none !important; }
  .featured-bottom .pipe-sep { display: none !important; }
  .category-scroll { padding: 0 16px !important; }
  .epg-panel { padding: 0 16px 40px !important; }
  .sticky-menu { top: 56px !important; }
  .football-match {
    flex-wrap: wrap !important;
    padding: 12px 12px !important;
    gap: 8px !important;
  }
  .football-match .fm-time { width: 40px !important; font-size: 12px !important; }
  .football-match .fm-league { width: 22px !important; height: 22px !important; }
  .football-match .fm-league img { width: 18px !important; height: 18px !important; }
  .football-match .fm-teams { flex: 1 1 calc(100% - 120px) !important; min-width: 0 !important; }
  .football-match .fm-teams-row {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 2px !important;
  }
  .football-match .fm-teams-row .fm-vs { display: none !important; }
  .football-match .fm-team-name {
    font-size: 12px !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    max-width: 100% !important;
  }
  .football-match .fm-tv-badges { gap: 4px !important; }
  .football-match .fm-tv-badge { font-size: 9px !important; padding: 1px 6px !important; }
  .football-match .fm-score { font-size: 14px !important; padding: 3px 8px !important; }
  .football-match .fm-tv-logo { width: 22px !important; height: 22px !important; }
  .football-match .fm-tv-logo img { width: 18px !important; height: 18px !important; }
}

@media (max-width: 480px) {
  .channel-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)) !important;
    gap: 10px !important;
    padding: 0 12px 32px !important;
  }
  .channel-card { padding: 14px !important; }
  .featured-section { min-height: 180px !important; }
  .featured-wrap { margin-bottom: 16px !important; }
  .category-scroll { padding: 0 12px !important; margin-bottom: 16px !important; }
  #search-bar-container { padding: 12px 12px 0 !important; }
}

@media (min-width: 769px) and (max-width: 1024px) {
  .movie-poster { width: 110px !important; }
  .movie-content { padding: 20px 24px !important; gap: 20px !important; }
  .featured-title { font-size: 22px !important; }
  .channel-grid { padding: 0 20px 40px !important; }
}

@media (min-width: 769px) {
  .mobile-header { display: none !important; }
}

@media (min-width: 1200px) {
  .channel-grid { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)) !important; }
}

/* =====================================================
   LIGHT MODE — Banner filme (fundal mereu dark)
   Redefine variabilele CSS in contextul bannerului
   ca textul sa fie mereu alb, indiferent de tema
   ===================================================== */
body.light-theme .featured-section {
  --text:           #E8E9ED;
  --text-soft:      rgba(255,255,255,0.88);
  --text-muted:     rgba(255,255,255,0.62);
  --text-faint:     rgba(255,255,255,0.55);
  --text-dim:       rgba(255,255,255,0.38);
  --border:         rgba(255,255,255,0.09);
  --border-light:   rgba(255,255,255,0.07);
  --border-med:     rgba(255,255,255,0.18);
  --border-strong:  rgba(255,255,255,0.22);
  --surface:        rgba(255,255,255,0.07);
  --surface-hover:  rgba(255,255,255,0.11);
  --surface-med:    rgba(255,255,255,0.14);
  --surface-strong: rgba(255,255,255,0.18);
  --bg-alt:         rgba(0,0,0,0.28);
  --bg-card:        rgba(0,0,0,0.18);
  color: #E8E9ED;
}