/* NodeCast TV — Red Edition visual layer
   CSS-only overrides for NodeCast TV 2.2.8. Does not change application logic. */
:root {
  --color-bg-primary: #080808;
  --color-bg-secondary: #111111;
  --color-bg-tertiary: #1a1a1a;
  --color-bg-hover: #262626;
  --color-bg-active: #303030;
  --color-accent: #e50914;
  --color-accent-hover: #f6121d;
  --color-accent-dim: rgba(229, 9, 20, .18);
  --color-success: #22c55e;
  --color-warning: #f59e0b;
  --color-error: #ef4444;
  --color-text-primary: #f5f5f5;
  --color-text-secondary: #b3b3b3;
  --color-text-muted: #808080;
  --color-border: #292929;
  --color-border-light: #3a3a3a;
  --glass-bg: rgba(12, 12, 12, .94);
  --glass-border: rgba(255, 255, 255, .09);
  --shadow-glow: 0 0 24px rgba(229, 9, 20, .22);
  --radius-sm: 5px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --transition-fast: 150ms ease;
  --transition-normal: 220ms ease;
}

html, body {
  background: #080808;
  color: var(--color-text-primary);
}
body {
  background-image: radial-gradient(ellipse at 50% -35%, rgba(125, 0, 8, .20), transparent 58%);
}
#app { background: transparent; }

/* Top navigation */
.navbar {
  background: linear-gradient(180deg, rgba(5,5,5,.98), rgba(12,12,12,.94));
  border-bottom: 1px solid rgba(255,255,255,.07);
  box-shadow: 0 8px 28px rgba(0,0,0,.28);
  backdrop-filter: blur(16px);
}
.logo svg { fill: var(--color-accent) !important; }
.navbar-brand .logo img { display: block; width: 34px; height: 38px; object-fit: contain; border-radius: 3px; }
.brand-text {
  font-family: 'Outfit', 'Arial Narrow', Impact, sans-serif;
  font-size: 1.38rem;
  line-height: 1;
  font-weight: 900;
  letter-spacing: .075em;
  text-transform: uppercase;
  color: #e50914;
  text-shadow: 0 1px 12px rgba(229, 9, 20, .16);
}
.brand-accent { color: var(--color-accent) !important; }
.version-badge {
  background: #292929;
  color: #d6d6d6;
  border: 1px solid rgba(255,255,255,.1);
}
.navbar-menu { gap: 6px; }
.nav-link {
  border-radius: 6px;
  color: #bdbdbd;
  font-weight: 600;
  transition: color .18s ease, background .18s ease, transform .18s ease;
}
.nav-link:hover {
  color: #fff;
  background: rgba(255,255,255,.08);
}
.nav-link.active {
  color: #fff;
  background: rgba(229,9,20,.15);
  box-shadow: inset 0 -2px 0 var(--color-accent);
}
.nav-link.active .nav-icon { color: var(--color-accent); }
.now-playing-indicator {
  border-color: rgba(229,9,20,.4) !important;
  background: rgba(229,9,20,.12) !important;
}

/* Shared page surfaces */
.main-content, .page { background: #080808; }
.page { scrollbar-color: #454545 #111; }
h1, h2, h3, h4, h5, h6 { letter-spacing: -.025em; }

/* Home dashboard rows */
#page-home {
  background: linear-gradient(180deg, #101010 0%, #080808 340px);
}
.dashboard-content {
  max-width: 1760px;
  padding: 30px clamp(18px, 3vw, 52px) 56px;
}
.dashboard-section { margin-bottom: 34px; }
.section-header {
  margin-bottom: 15px;
  padding-left: 12px;
  border-left: 3px solid var(--color-accent);
}
.section-header h2 {
  color: #f5f5f5;
  font-family: 'Inter', sans-serif;
  font-size: clamp(1.15rem, 1.6vw, 1.45rem);
  font-weight: 750;
}
.horizontal-scroll {
  gap: 13px;
  padding: 5px 2px 14px;
  scroll-padding-inline: 20px;
}
.scroll-arrow {
  background: rgba(20,20,20,.94) !important;
  border: 1px solid rgba(255,255,255,.12) !important;
  color: #fff !important;
  box-shadow: 0 5px 20px rgba(0,0,0,.4);
}
.scroll-arrow:hover {
  background: var(--color-accent) !important;
  border-color: var(--color-accent) !important;
}

/* Movie and series tiles */
.movie-card, .series-card {
  background: #171717;
  border: 1px solid rgba(255,255,255,.07);
  border-radius: 7px;
  box-shadow: 0 5px 18px rgba(0,0,0,.24);
  transition: transform .22s ease, border-color .22s ease, box-shadow .22s ease;
}
.movie-card:hover, .series-card:hover {
  transform: translateY(-5px) scale(1.025);
  border-color: rgba(229,9,20,.65);
  box-shadow: 0 12px 30px rgba(0,0,0,.55), 0 0 0 1px rgba(229,9,20,.14);
  z-index: 2;
}
.movie-poster, .series-poster,
.series-card .series-poster { background: #151515; }
.movie-poster img, .series-poster img { transition: transform .35s ease; }
.movie-card:hover .movie-poster img,
.series-card:hover .series-poster img { transform: scale(1.045); }
.movie-info, .series-card-info { background: linear-gradient(180deg, #191919, #121212); }
.movie-title, .series-title { color: #f5f5f5; font-weight: 650; }
.movie-meta, .series-meta { color: #999; }
.movie-play-overlay, .series-play-overlay {
  background: linear-gradient(0deg, rgba(0,0,0,.78), rgba(0,0,0,.16));
}
.play-icon { color: #fff; text-shadow: 0 2px 12px rgba(0,0,0,.7); }
.favorite-btn.active, .fav-icon { color: var(--color-accent); }

/* Live TV */
.channel-sidebar {
  background: #101010;
  border-right: 1px solid rgba(255,255,255,.08);
}
.sidebar-header {
  background: linear-gradient(180deg, #151515, #101010);
  border-bottom-color: rgba(255,255,255,.08);
}
.channel-item {
  border-radius: 5px;
  margin: 2px 7px;
  padding: 9px 10px;
}
.channel-item:hover { background: #222 !important; }
.channel-item.active {
  background: rgba(229,9,20,.14) !important;
  border-left: 3px solid var(--color-accent) !important;
}
.channel-item.active .channel-name { color: #fff; }
.channel-logo { background: #202020; border-radius: 5px; }
.group-header.favorites-group {
  background: linear-gradient(90deg, rgba(229,9,20,.16), transparent);
  border-left-color: var(--color-accent);
}
.group-header.favorites-group .group-name { color: #ff646b; }
.player-section, .video-container { background: #000; }
.channel-toggle-btn:hover { background: var(--color-accent); }

/* Guide / EPG */
.epg-time-header, .epg-header-corner, .epg-channel-info {
  background: #141414;
}
.epg-channel-row { border-bottom-color: rgba(255,255,255,.07); }
.epg-channel-info:hover { background: #242424; }
.epg-time-slot { border-right-color: rgba(255,255,255,.07); }
.epg-program:hover { background: rgba(229,9,20,.12); }
.epg-program.current { border-color: rgba(229,9,20,.8); }

/* Movies / series headers and filters */
.movies-header, .series-header {
  background: linear-gradient(180deg, #151515, #101010);
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.movies-header h2, .series-header h2 { color: #f5f5f5; font-weight: 800; }
.movies-grid, .series-grid {
  background: radial-gradient(ellipse at 50% 0%, rgba(100,0,7,.10), transparent 60%), #080808;
  gap: 18px;
  padding: 24px clamp(14px, 2.5vw, 38px);
}

/* Buttons and inputs */
.btn { border-radius: 6px; font-weight: 650; }
.btn-primary, .btn-login {
  background: var(--color-accent) !important;
  color: #fff !important;
  border-color: var(--color-accent) !important;
}
.btn-primary:hover, .btn-login:hover {
  background: #f6121d !important;
  box-shadow: 0 6px 20px rgba(229,9,20,.25) !important;
}
.btn-secondary {
  background: #242424;
  border-color: #393939;
}
.btn-secondary:hover { background: #303030; }
.btn-ghost:hover { background: rgba(255,255,255,.08); }
input:not([type="checkbox"]):not([type="radio"]),
select, textarea, .form-input {
  background-color: #181818;
  border-color: #3a3a3a;
  color: #f5f5f5;
}
input:focus, select:focus, textarea:focus, .form-input:focus {
  border-color: var(--color-accent) !important;
  box-shadow: 0 0 0 3px rgba(229,9,20,.14);
  outline: none;
}
input[type="checkbox"], input[type="radio"] { accent-color: var(--color-accent); }

/* Settings, tabs, modals and source manager */
.settings-container { max-width: 1120px; }
.settings-container h2 { color: #fff; font-weight: 800; }
.settings-section, .source-item, .tab-content,
.modal-content, .source-card {
  border-color: rgba(255,255,255,.09);
}
.tabs { border-bottom-color: rgba(255,255,255,.09); }
.tab.active {
  color: #fff;
  border-bottom-color: var(--color-accent) !important;
}
.tab:hover { color: #fff; }
.modal { background: rgba(0,0,0,.78); }
.modal-content {
  background: #151515;
  border: 1px solid #343434;
  box-shadow: 0 24px 70px rgba(0,0,0,.65);
}
.modal-header { border-bottom-color: rgba(255,255,255,.08); }
.modal-footer { border-top-color: rgba(255,255,255,.08); }

/* Login */
.login-container {
  background: radial-gradient(ellipse at 50% 10%, rgba(150,0,10,.22), transparent 48%), #080808;
}
.login-box {
  background: rgba(18,18,18,.96) !important;
  border: 1px solid rgba(255,255,255,.11) !important;
  box-shadow: 0 24px 80px rgba(0,0,0,.6) !important;
}
.login-logo .logo-icon { color: var(--color-accent) !important; }
.login-logo h1 { font-weight: 800 !important; }

/* Player overlays: preserve their positioning and controls */
.watch-overlay, .watch-captions-menu {
  background-color: rgba(10,10,10,.88);
  border-color: rgba(255,255,255,.12);
}
.watch-btn:hover, .watch-btn.active { color: #fff; background: rgba(229,9,20,.78); }
.captions-option.active { color: #ff5b63; }

/* Keyboard / TV navigation focus */
:focus-visible {
  outline: 2px solid #ff343e !important;
  outline-offset: 3px;
}

/* Scrollbars */
::-webkit-scrollbar-track { background: #111; }
::-webkit-scrollbar-thumb { background: #414141; border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: #686868; }

@media (max-width: 768px) {
  .dashboard-content { padding: 20px 14px 34px; }
  .dashboard-section { margin-bottom: 27px; }
  .section-header { margin-bottom: 12px; }
  .navbar { background: rgba(8,8,8,.98); }
  .navbar-menu { background: rgba(10,10,10,.98); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
  }
  /* Keep the only visual feedback for long video loads animated. */
  .watch-loading .loading-spinner {
    animation: spin 1s linear infinite !important;
    animation-duration: 1s !important;
    animation-iteration-count: infinite !important;
  }
}
