/* IBO Player Pro Design System & Clean Aesthetics */
:root {
  --bg-nebula: radial-gradient(circle at 75% 35%, #521847 0%, #290e38 38%, #110722 75%, #070312 100%);
  --bg-dark: #0a0517;
  --bg-card: rgba(26, 17, 44, 0.75);
  --bg-card-hover: rgba(45, 29, 74, 0.9);
  --bg-glass: rgba(18, 10, 32, 0.82);
  --accent-gold: #f5b82e;
  --accent-gold-glow: rgba(245, 184, 46, 0.45);
  --text-white: #ffffff;
  --text-dim: #b6acc9;
  --text-muted: #786d91;
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-gold: #f5b82e;
  --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  user-select: none;
}

/* Custom Modern Scrollbars */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: rgba(14, 8, 25, 0.4);
  border-radius: 8px;
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  transition: background 0.2s ease;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--accent-gold);
}

::-webkit-scrollbar-corner {
  background: transparent;
}

body {
  font-family: var(--font-family);
  background: var(--bg-nebula);
  background-attachment: fixed;
  color: var(--text-white);
  height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

button, input, select {
  font: inherit;
  color: inherit;
  outline: none;
  border: none;
}

button {
  cursor: pointer;
  background: transparent;
  transition: all 0.18s ease;
}

/* --- TV Remote Control (D-Pad) Focus Styles: Curvature-Safe Box-Shadow --- */
.tv-focused,
.tv-nav-item:focus-visible {
  outline: none !important;
  border-color: var(--accent-gold) !important;
  box-shadow: 0 0 0 2.5px var(--accent-gold), 0 0 18px var(--accent-gold-glow) !important;
  z-index: 60 !important;
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease !important;
}

.poster-card.tv-focused {
  outline: none !important;
  border-color: var(--accent-gold) !important;
  box-shadow: 0 0 0 3px var(--accent-gold), 0 0 24px var(--accent-gold-glow), 0 14px 32px rgba(0, 0, 0, 0.85) !important;
  transform: translateY(-3px) scale(1.025) !important;
  z-index: 60 !important;
  transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease !important;
}

.home-tile.tv-focused {
  outline: none !important;
  border-color: var(--accent-gold) !important;
  box-shadow: 0 0 0 3px var(--accent-gold), 0 0 30px var(--accent-gold-glow), 0 20px 48px rgba(0, 0, 0, 0.85) !important;
  transform: translateY(-5px) scale(1.02) !important;
  z-index: 60 !important;
  transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease !important;
}

.cat-item.tv-focused {
  outline: none !important;
  border-color: var(--accent-gold) !important;
  box-shadow: 0 0 0 2.5px var(--accent-gold), 0 0 16px var(--accent-gold-glow) !important;
  background: rgba(255, 255, 255, 0.14) !important;
  color: #fff !important;
  transform: scale(1.02) !important;
  border-radius: 8px !important;
  z-index: 10 !important;
}

.action-btn.tv-focused {
  outline: none !important;
  border-color: var(--accent-gold) !important;
  box-shadow: 0 0 0 2.5px var(--accent-gold), 0 0 16px var(--accent-gold-glow) !important;
  background: rgba(255, 255, 255, 0.18) !important;
  color: #fff !important;
  transform: scale(1.03) !important;
  border-radius: 8px !important;
  z-index: 10 !important;
}

.nav-link.tv-focused {
  outline: none !important;
  box-shadow: 0 0 0 2px var(--accent-gold), 0 0 14px var(--accent-gold-glow) !important;
  border-radius: 6px !important;
  background: rgba(255, 255, 255, 0.1) !important;
  color: #ffffff !important;
  transform: translateY(-1px) !important;
}

.ctrl-btn.tv-focused,
.icon-btn.tv-focused,
.live-preview-icon-btn.tv-focused {
  outline: none !important;
  box-shadow: 0 0 0 2.5px var(--accent-gold), 0 0 18px var(--accent-gold-glow) !important;
  background: rgba(245, 184, 46, 0.25) !important;
  color: #fff !important;
  transform: scale(1.15) !important;
}

.episode-card.tv-focused {
  outline: none !important;
  border: 2px solid var(--accent-gold) !important;
  background: rgba(48, 30, 78, 0.95) !important;
  transform: scale(1.02) !important;
  box-shadow: 0 0 20px var(--accent-gold-glow) !important;
}

.btn-play-movie.tv-focused,
.btn-watched-movie.tv-focused,
.btn-fav-movie.tv-focused,
.btn-back-movie.tv-focused {
  outline: none !important;
  border: 2px solid var(--accent-gold) !important;
  transform: scale(1.04) !important;
  box-shadow: 0 0 18px var(--accent-gold-glow) !important;
}

.player-drawer-item.tv-focused {
  background: rgba(255, 255, 255, 0.14) !important;
  border: 1px solid var(--accent-gold) !important;
  box-shadow: 0 0 0 2px var(--accent-gold), 0 0 14px var(--accent-gold-glow) !important;
  outline: none !important;
  transform: translateX(-3px) !important;
}

/* --- Top Header Navigation (Screenshot 3 style) --- */
.app-header {
  height: 60px;
  background: rgba(11, 6, 24, 0.92);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  z-index: 100;
  flex-shrink: 0;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 32px;
}

.logo {
  display: flex;
  align-items: center;
  cursor: pointer;
  transition: transform 0.15s ease, opacity 0.15s ease;
}

.logo:hover {
  transform: scale(1.03);
  opacity: 0.95;
}

.app-logo-img {
  height: 40px;
  width: auto;
  max-width: 170px;
  object-fit: contain;
  display: block;
}

.logo-pro {
  background: var(--accent-gold);
  color: #1a0e05;
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 1px;
  margin-left: 3px;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 16px;
}

.nav-link {
  font-size: 15px;
  font-weight: 600;
  color: #d1c7e2;
  padding: 6px 4px;
  position: relative;
  transition: color 0.2s, transform 0.15s;
}

.nav-link:hover {
  color: #ffffff;
}

.nav-link.active {
  color: var(--accent-gold);
  font-weight: 700;
}

.nav-link.active::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  right: 0;
  height: 2.5px;
  background: var(--accent-gold);
  border-radius: 2px;
  box-shadow: 0 0 10px var(--accent-gold-glow);
}

.nav-sep {
  color: rgba(255, 255, 255, 0.18);
  font-weight: 300;
  font-size: 14px;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 20px;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(38, 20, 60, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.15);
  padding: 6px 14px;
  border-radius: 24px;
  width: 260px;
  transition: border-color 0.2s, background 0.2s;
}

.search-box:focus-within {
  border-color: var(--accent-gold);
  background: rgba(50, 26, 80, 0.9);
  box-shadow: 0 0 12px var(--accent-gold-glow);
}

.search-icon-svg {
  opacity: 0.7;
  color: #d1c7e2;
}

.search-box input {
  background: transparent;
  width: 100%;
  font-size: 13px;
  color: #ffffff;
}

.search-box input::placeholder {
  color: #8c7f9e;
}

.btn-clear-search-input {
  background: transparent;
  border: none;
  color: #a494bf;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  padding: 0 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s, transform 0.15s;
}

.btn-clear-search-input:hover {
  color: #ffffff;
  transform: scale(1.2);
}

.btn-filter-reset {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(245, 184, 46, 0.15);
  border: 1px solid var(--accent-gold);
  color: var(--accent-gold);
  padding: 8px 18px;
  border-radius: 20px;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  margin-top: 10px;
  transition: all 0.2s ease;
}

.btn-filter-reset:hover {
  background: var(--accent-gold);
  color: #0b0514;
  box-shadow: 0 4px 14px rgba(245, 184, 46, 0.4);
  transform: translateY(-1px);
}

.header-clock {
  font-size: 14px;
  font-weight: 600;
  color: #d4c9ea;
  letter-spacing: 0.5px;
}

.icon-btn {
  background: rgba(255, 255, 255, 0.08);
  border-radius: 50%;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  color: #dcd2f0;
}

.icon-btn:hover {
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
}

/* --- App Body & Views --- */
.app-body {
  flex: 1;
  overflow: hidden;
  position: relative;
}

.view-section {
  position: absolute;
  inset: 0;
  display: none;
  overflow: hidden;
}

.view-section.active {
  display: flex;
}

/* --- 1. Home Dashboard View --- */
.home-container {
  width: 100%;
  height: 100%;
  overflow-y: auto;
  padding: 36px 48px;
  display: flex;
  flex-direction: column;
  gap: 36px;
}

.home-banner {
  display: flex;
  justify-content: flex-end;
}

.account-card {
  background: rgba(20, 11, 35, 0.75);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 14px 22px;
  display: flex;
  align-items: center;
  gap: 28px;
  font-size: 13px;
}

.account-status {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #55f07a;
  font-weight: 700;
}

.dot-online {
  width: 8px;
  height: 8px;
  background: #55f07a;
  border-radius: 50%;
  box-shadow: 0 0 8px #55f07a;
}

.account-details {
  display: flex;
  gap: 20px;
  color: var(--text-dim);
}

.account-details b {
  color: #fff;
}

.home-tiles-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
  min-height: 280px;
  padding: 12px;
  margin: -12px;
}

.home-tile {
  position: relative;
  border-radius: 18px;
  padding: 36px 30px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  cursor: pointer;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.4);
  transition: transform 0.22s, border-color 0.22s, box-shadow 0.22s;
}

.home-tile:hover {
  transform: translateY(-6px);
  border-color: var(--accent-gold);
  box-shadow: 0 22px 48px rgba(0, 0, 0, 0.6), 0 0 20px var(--accent-gold-glow);
}

.tile-bg {
  position: absolute;
  inset: 0;
  z-index: 1;
  opacity: 0.85;
}

.tile-live .tile-bg {
  background: linear-gradient(135deg, #7c1a2e 0%, #2e091b 100%);
}
.tile-vod .tile-bg {
  background: linear-gradient(135deg, #1b3d7a 0%, #0d1a3c 100%);
}
.tile-series .tile-bg {
  background: linear-gradient(135deg, #4d1c73 0%, #1e0936 100%);
}

.tile-icon-svg {
  position: relative;
  z-index: 2;
  margin-bottom: 20px;
  color: #fff;
}

.home-tile h2 {
  position: relative;
  z-index: 2;
  font-size: 28px;
  font-weight: 800;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

.home-tile p {
  position: relative;
  z-index: 2;
  font-size: 13px;
  color: var(--text-dim);
  margin-bottom: 20px;
  line-height: 1.4;
}

.tile-count {
  position: relative;
  z-index: 2;
  font-size: 12px;
  font-weight: 700;
  color: var(--accent-gold);
  background: rgba(0, 0, 0, 0.35);
  padding: 5px 12px;
  border-radius: 20px;
  align-self: flex-start;
  border: 1px solid rgba(245, 184, 46, 0.3);
}

.home-resume-section {
  margin-top: 10px;
}

.section-title {
  font-size: 16px;
  font-weight: 700;
  color: #e4ddf3;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.resume-carousel {
  display: flex;
  gap: 18px;
  overflow-x: auto;
  overflow-y: visible;
  padding: 16px 16px 20px 16px;
  margin: -16px -16px 0 -16px;
  scrollbar-width: thin;
  scrollbar-color: rgba(245, 184, 46, 0.45) rgba(255, 255, 255, 0.04);
}

.resume-carousel::-webkit-scrollbar {
  height: 5px;
}

.resume-carousel::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.04);
  border-radius: 10px;
  margin: 0 4px;
}

.resume-carousel::-webkit-scrollbar-thumb {
  background: rgba(245, 184, 46, 0.45);
  border-radius: 10px;
  transition: all 0.2s ease;
}

.resume-carousel::-webkit-scrollbar-thumb:hover {
  background: var(--accent-gold);
  box-shadow: 0 0 10px rgba(245, 184, 46, 0.6);
}

.home-media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  grid-auto-rows: 275px;
  gap: 24px 18px;
  padding: 16px 16px 36px 16px;
  margin: -16px -16px 0 -16px;
}

/* --- 2. Explorer View (Category Sidebar + Media Grid - Screenshot 3) --- */
#viewExplorer {
  width: 100%;
  height: 100%;
}

.explorer-sidebar {
  width: 290px;
  height: 100%;
  background: rgba(14, 8, 27, 0.92);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  padding: 24px 16px;
}

.sidebar-top-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 16px;
  background: rgba(255, 255, 255, 0.05);
  border: 1.5px solid rgba(255, 255, 255, 0.2);
  border-radius: 14px;
  display: grid;
  place-items: center;
  color: #fff;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.sidebar-actions {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  padding: 4px;
  margin: -4px -4px 12px -4px;
}

.action-btn {
  flex: 1;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #ccc;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.18s ease;
}

.action-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.2);
}

.categories-list {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px 8px 16px 8px;
  margin: -8px -8px 0 -8px;
}

.categories-list::-webkit-scrollbar {
  width: 5px;
}
.categories-list::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 4px;
}

.cat-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 11px 16px;
  border-radius: 8px;
  font-size: 13.5px;
  color: #c9bfdc;
  font-weight: 500;
  border: none;
  border-left: 3.5px solid transparent;
  background: transparent;
  outline: none;
  transition: all 0.15s ease;
  text-align: left;
}

.cat-item:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
}

.cat-item.active {
  background: rgba(255, 255, 255, 0.1);
  color: var(--accent-gold);
  font-weight: 700;
  border: none;
  border-left: 3.5px solid var(--accent-gold);
  border-radius: 8px;
  box-shadow: none;
  outline: none;
}

.cat-count {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 600;
  margin-left: 8px;
  flex-shrink: 0;
}

.cat-item.active .cat-count {
  color: var(--accent-gold);
  font-weight: 700;
}

.explorer-main {
  flex: 1;
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 24px 36px 0;
}

.main-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  flex-shrink: 0;
}

.toolbar-left {
  display: flex;
  align-items: baseline;
  gap: 12px;
}

.toolbar-left h2 {
  font-size: 22px;
  font-weight: 700;
}

.category-badge-count {
  font-size: 12px;
  color: var(--text-dim);
}

#sortSelect {
  background: rgba(30, 16, 50, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #e5daf7;
  padding: 7px 16px;
  border-radius: 20px;
  font-size: 12px;
  cursor: pointer;
}

#sortSelect:focus {
  border-color: var(--accent-gold);
}

/* FIXED POSTER GRID LAYOUT: Strict Row Height & No Overlaps */
.media-grid {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  grid-auto-rows: 275px;
  gap: 24px 18px;
  padding: 16px 16px 60px 16px;
  margin: -16px -16px 0 -16px;
  align-content: start;
}

.media-grid::-webkit-scrollbar {
  width: 6px;
}
.media-grid::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 4px;
}

/* Individual Poster Card: Solid Fixed Dimensions */
.poster-card {
  height: 275px;
  min-height: 275px;
  max-height: 275px;
  border-radius: 12px;
  overflow: hidden;
  background: #140d24;
  border: 1.5px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.45);
  cursor: pointer;
  transition: transform 0.18s, border-color 0.18s, box-shadow 0.18s;
  display: flex;
  flex-direction: column;
  position: relative;
  box-sizing: border-box;
}

.poster-card:hover {
  transform: translateY(-4px) scale(1.02);
  border-color: var(--accent-gold);
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.7), 0 0 16px var(--accent-gold-glow);
  z-index: 10;
}

.poster-media {
  flex: 1 1 auto;
  height: calc(275px - 48px);
  min-height: 0;
  width: 100%;
  position: relative;
  overflow: hidden;
  background: #0f081d;
}

.poster-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.25s ease;
}

.poster-card:hover .poster-img {
  transform: scale(1.06);
}

.poster-badge-top {
  position: absolute;
  top: 8px;
  left: 8px;
  background: rgba(0, 0, 0, 0.75);
  color: var(--accent-gold);
  font-size: 11px;
  font-weight: 700;
  padding: 3px 7px;
  border-radius: 4px;
  backdrop-filter: blur(4px);
  z-index: 2;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}

.poster-badge-new {
  position: absolute;
  top: 8px;
  right: 8px;
  background: linear-gradient(135deg, #f5b82e, #e59714);
  color: #0b0514;
  font-size: 10px;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 4px;
  letter-spacing: 0.5px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
  z-index: 2;
}

.poster-badge-hd {
  position: absolute;
  bottom: 8px;
  right: 8px;
  background: #0077b6;
  color: #fff;
  font-size: 9px;
  font-weight: 800;
  padding: 2px 5px;
  border-radius: 3px;
  letter-spacing: 0.5px;
  z-index: 2;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}

.poster-title-box {
  height: 48px;
  width: 100%;
  padding: 6px 8px;
  background: rgba(14, 8, 25, 0.95);
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.poster-title-pill {
  width: 100%;
  background: #205c5c;
  color: #fff;
  font-size: 11.5px;
  font-weight: 600;
  text-align: center;
  padding: 6px 10px;
  border-radius: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.poster-card:hover .poster-title-pill {
  background: #2b7a7a;
}

.btn-load-more {
  margin: 10px auto 30px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #fff;
  padding: 10px 24px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
}
.btn-load-more:hover {
  background: var(--accent-gold);
  color: #000;
}

/* Active Card Highlight when playing in Side Preview */
.poster-card.preview-active {
  border-color: var(--accent-gold) !important;
  box-shadow: 0 0 20px var(--accent-gold-glow), 0 12px 28px rgba(0, 0, 0, 0.7) !important;
  transform: translateY(-4px) scale(1.02);
}

.poster-card.preview-active .poster-title-pill {
  background: linear-gradient(90deg, #d34528 0%, #b82b18 100%) !important;
  color: #fff !important;
  font-weight: 700;
}

/* Side Live TV Preview Panel (from user screenshot) */
.live-preview-panel {
  width: 440px;
  height: 100%;
  background: rgba(14, 8, 27, 0.96);
  backdrop-filter: blur(20px);
  border-left: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  padding: 20px 22px;
  overflow-y: auto;
  box-shadow: -10px 0 30px rgba(0, 0, 0, 0.5);
  animation: slideInRight 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 50;
}

.live-preview-panel.hidden {
  display: none !important;
}

@keyframes slideInRight {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

.live-preview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.live-preview-tag {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1.2px;
  color: #f5b82e;
  text-transform: uppercase;
}

.live-pulse-dot {
  width: 9px;
  height: 9px;
  background: #ff3b30;
  border-radius: 50%;
  box-shadow: 0 0 10px #ff3b30;
  animation: pulseDot 1.4s infinite alternate;
}

@keyframes pulseDot {
  from { opacity: 0.6; transform: scale(0.9); }
  to { opacity: 1; transform: scale(1.2); }
}

.live-preview-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.live-preview-icon-btn {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  display: grid;
  place-items: center;
  color: #d1c8e0;
  cursor: pointer;
  transition: all 0.18s ease;
}

.live-preview-icon-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.3);
  transform: scale(1.05);
}

.live-preview-icon-btn.active {
  background: rgba(245, 184, 46, 0.25);
  color: var(--accent-gold);
  border-color: var(--accent-gold);
  box-shadow: 0 0 12px var(--accent-gold-glow);
}

/* Video Player Box in Preview */
.live-preview-player-box {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 14px 14px 0 0;
  overflow: hidden;
  background: #000;
  position: relative;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-bottom: none;
}

#livePreviewVideo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  background: #000;
  transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1), object-fit 0.2s ease;
}

.live-preview-aspect-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(10, 4, 20, 0.75);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.22);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 8px;
  cursor: pointer;
  z-index: 6;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.5);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
  user-select: none;
}

.live-preview-aspect-badge:hover {
  background: var(--accent-gold);
  color: #0b0618;
  border-color: var(--accent-gold);
  box-shadow: 0 0 16px var(--accent-gold-glow);
  transform: scale(1.06);
}

.live-preview-spinner {
  position: absolute;
  inset: 0;
  background: rgba(5, 2, 12, 0.85);
  backdrop-filter: blur(6px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: #e4ddf3;
  font-size: 13px;
  font-weight: 500;
  z-index: 5;
}

.live-preview-spinner.hidden {
  display: none !important;
}

.live-preview-hover-hint {
  position: absolute;
  inset: 0;
  background: rgba(10, 4, 20, 0.65);
  backdrop-filter: blur(4px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  opacity: 0;
  transition: opacity 0.2s ease;
  z-index: 6;
  pointer-events: none;
}

.live-preview-player-box:hover .live-preview-hover-hint {
  opacity: 1;
}

.hint-icon-box {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: rgba(245, 184, 46, 0.9);
  color: #120824;
  display: grid;
  place-items: center;
  box-shadow: 0 0 20px var(--accent-gold-glow);
  transform: scale(0.9);
  transition: transform 0.2s ease;
}

.live-preview-player-box:hover .hint-icon-box {
  transform: scale(1.05);
}

.live-preview-hover-hint span {
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.5px;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.8);
}

/* Warm Red/Orange Gradient Channel Card (from user screenshot) */
.live-preview-info-card {
  width: 100%;
  background: linear-gradient(180deg, #d34528 0%, #aa2c18 60%, #7e1708 100%);
  border-radius: 0 0 14px 14px;
  padding: 18px 20px 22px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-top: 1px solid rgba(255, 255, 255, 0.25);
  box-shadow: 0 14px 36px rgba(184, 43, 24, 0.4), 0 0 25px rgba(211, 69, 40, 0.25);
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
  margin-bottom: 20px;
}

.live-preview-info-card:hover {
  transform: translateY(-2px);
  filter: brightness(1.08);
  box-shadow: 0 18px 42px rgba(184, 43, 24, 0.55), 0 0 35px rgba(245, 184, 46, 0.35);
  border-color: rgba(255, 255, 255, 0.35);
}

.live-preview-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.live-preview-card-title {
  font-size: 19px;
  font-weight: 800;
  color: #ffffff;
  line-height: 1.35;
  margin-bottom: 0;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
  word-break: break-word;
  flex: 1;
}

.live-preview-card-fav-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.35);
  border: 1.5px solid rgba(255, 255, 255, 0.25);
  display: grid;
  place-items: center;
  color: #fff;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.live-preview-card-fav-btn:hover {
  background: rgba(0, 0, 0, 0.65);
  transform: scale(1.1);
  border-color: #fff;
}

.live-preview-card-fav-btn.active {
  background: #ffffff;
  color: #e63946;
  border-color: #ffffff;
  box-shadow: 0 0 16px rgba(255, 255, 255, 0.7);
  transform: scale(1.08);
}

.live-preview-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.live-status-pill {
  background: rgba(0, 0, 0, 0.4);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.8px;
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.25);
}

.live-expand-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.22);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: 20px;
  backdrop-filter: blur(4px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  transition: all 0.2s ease;
}

.live-preview-info-card:hover .live-expand-pill {
  background: #ffffff;
  color: #87180c;
  transform: scale(1.04);
}

/* EPG Info in Live Preview Card */
.live-preview-epg-box {
  background: rgba(0, 0, 0, 0.38);
  border-radius: 10px;
  padding: 10px 12px;
  margin: 10px 0 14px 0;
  border: 1px solid rgba(255, 255, 255, 0.14);
  display: flex;
  flex-direction: column;
  gap: 7px;
  backdrop-filter: blur(8px);
}

.epg-now-row, .epg-next-row {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow: hidden;
}

.epg-badge-now {
  background: #ff3b30;
  color: #fff;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.6px;
  padding: 2px 6px;
  border-radius: 4px;
  flex-shrink: 0;
  box-shadow: 0 0 8px rgba(255, 59, 48, 0.6);
}

.epg-badge-next {
  background: rgba(255, 255, 255, 0.18);
  color: #ffd066;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.6px;
  padding: 2px 6px;
  border-radius: 4px;
  flex-shrink: 0;
}

.epg-title-now {
  font-size: 13px;
  font-weight: 700;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}

.epg-title-next {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.75);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}

.epg-progress-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 2px 0;
}

.epg-bar {
  flex: 1;
  height: 5px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 3px;
  overflow: hidden;
}

.epg-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #f5b82e, #ff6b4a);
  border-radius: 3px;
  transition: width 0.3s ease;
}

.epg-time-span {
  font-size: 10px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.85);
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}

/* EPG Full Day Schedule Card */
.live-preview-schedule-card {
  width: 100%;
  background: rgba(18, 10, 34, 0.85);
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  backdrop-filter: blur(14px);
  margin-bottom: 24px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

.schedule-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 10px;
}

.schedule-header-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 800;
  color: var(--accent-gold);
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

.schedule-badge-date {
  font-size: 11px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.65);
  background: rgba(255, 255, 255, 0.07);
  padding: 3px 8px;
  border-radius: 6px;
}

.schedule-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 340px;
  overflow-y: auto;
  padding-right: 4px;
}

.schedule-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  transition: all 0.18s ease;
}

.schedule-item:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.16);
  transform: translateX(2px);
}

.schedule-item.current {
  background: rgba(245, 184, 46, 0.14);
  border-color: var(--accent-gold);
  box-shadow: 0 0 16px rgba(245, 184, 46, 0.2);
}

.schedule-time-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  flex-shrink: 0;
  width: 52px;
}

.schedule-start-time {
  font-size: 13px;
  font-weight: 800;
  color: var(--accent-gold);
  font-variant-numeric: tabular-nums;
}

.schedule-end-time {
  font-size: 10px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.4);
  font-variant-numeric: tabular-nums;
}

.schedule-details {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow: hidden;
}

.schedule-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.schedule-title {
  font-size: 13px;
  font-weight: 700;
  color: #ffffff;
  line-height: 1.3;
  word-break: break-word;
}

.schedule-item.current .schedule-title {
  color: #ffd066;
}

.schedule-now-tag {
  background: #ff3b30;
  color: #fff;
  font-size: 8px;
  font-weight: 900;
  letter-spacing: 0.6px;
  padding: 2px 6px;
  border-radius: 4px;
  flex-shrink: 0;
  box-shadow: 0 0 8px rgba(255, 59, 48, 0.7);
}

.schedule-desc {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.65);
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.schedule-empty {
  padding: 22px;
  text-align: center;
  color: rgba(255, 255, 255, 0.5);
  font-size: 12px;
}

/* --- 3. Series Detail / Seasons & Episodes View (Screenshot 2) --- */
#viewSeriesDetail {
  width: 100%;
  height: 100%;
  background: var(--bg-dark);
  position: relative;
  z-index: 10;
}

.seasons-sidebar {
  width: 260px;
  height: 100%;
  background: rgba(14, 8, 27, 0.98);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  padding: 24px 16px;
  flex-shrink: 0;
}

.seasons-header {
  margin-bottom: 24px;
}

.btn-back-series {
  color: var(--text-dim);
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 12px;
  padding: 4px 0;
}
.btn-back-series:hover {
  color: #fff;
}

.seasons-header h3 {
  font-size: 17px;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.seasons-list {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.season-btn {
  text-align: left;
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  color: #ccc;
  border: none;
  border-left: 3.5px solid transparent;
  outline: none;
  transition: all 0.15s;
}

.season-btn:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
}

.season-btn.active {
  background: rgba(255, 255, 255, 0.1);
  color: var(--accent-gold);
  font-weight: 700;
  border: none;
  border-left: 3.5px solid var(--accent-gold);
  border-radius: 8px;
  outline: none;
}

.episodes-main {
  flex: 1;
  height: 100%;
  overflow-y: auto;
  padding: 24px 36px;
  display: flex;
  flex-direction: column;
  background: var(--bg-dark);
}

.episodes-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.episodes-header-left {
  display: flex;
  align-items: baseline;
  gap: 12px;
}

.episodes-header h2 {
  font-size: 22px;
  font-weight: 700;
}

.episodes-header-left span,
#episodesCount {
  font-size: 13px;
  color: var(--text-dim);
}

/* Continuar Assistindo Top Button (Series View) */
.btn-resume-series {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 18px;
  background: linear-gradient(135deg, #f5b82e 0%, #e09914 100%);
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 9999px;
  color: #0b0514 !important;
  font-weight: 800;
  font-size: 13px;
  letter-spacing: 0.2px;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(245, 184, 46, 0.42), inset 0 1px 0 rgba(255, 255, 255, 0.45);
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  user-select: none;
}

.btn-resume-series span,
#resumeSeriesText {
  color: #0b0514 !important;
  font-weight: 800 !important;
  font-size: 13px !important;
  line-height: 1 !important;
  letter-spacing: 0.2px !important;
  text-shadow: none !important;
}

.btn-resume-series svg {
  color: #0b0514 !important;
  fill: #0b0514 !important;
  width: 13px;
  height: 13px;
  flex-shrink: 0;
  display: block;
}

.btn-resume-series:hover {
  transform: translateY(-2px) scale(1.02);
  background: linear-gradient(135deg, #ffc53d 0%, #f0a31a 100%);
  box-shadow: 0 8px 24px rgba(245, 184, 46, 0.65), inset 0 1px 0 rgba(255, 255, 255, 0.55);
}

.btn-resume-series:active {
  transform: translateY(0) scale(0.97);
  box-shadow: 0 2px 8px rgba(245, 184, 46, 0.35);
}

.episodes-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 12px 14px 40px 12px;
  margin: -12px -14px 0 -12px;
}

/* Episode Card (Screenshot 2 style) */
.episode-card {
  background: rgba(28, 20, 44, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 12px 16px;
  display: flex;
  gap: 18px;
  align-items: center;
  cursor: pointer;
  transition: all 0.18s ease;
}

.episode-card:hover {
  background: rgba(42, 28, 66, 0.9);
  border-color: rgba(255, 255, 255, 0.25);
  transform: translateX(4px);
}

.episode-card.active, .episode-card:focus-visible {
  border-color: var(--accent-gold);
  box-shadow: 0 0 14px var(--accent-gold-glow);
  background: rgba(48, 30, 78, 0.95);
}

.episode-thumb-wrap {
  width: 145px;
  height: 85px;
  border-radius: 8px;
  overflow: hidden;
  background: #000;
  flex-shrink: 0;
  position: relative;
}

.episode-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.episode-thumb-play {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  display: grid;
  place-items: center;
  color: #fff;
  opacity: 0;
  transition: opacity 0.2s;
}

.episode-card:hover .episode-thumb-play {
  opacity: 1;
}

.episode-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.episode-title {
  font-size: 14.5px;
  font-weight: 700;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.episode-meta-row {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 11.5px;
}

.episode-duration {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  padding: 2px 7px;
  border-radius: 4px;
  color: #d1c7e2;
  font-weight: 600;
}

.episode-rating {
  color: var(--accent-gold);
  font-weight: 700;
}

.episode-plot {
  font-size: 12px;
  color: #9d92b3;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* --- 4. Fullscreen Video Player (Screenshot 1) --- */
.player-overlay {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  background: #000;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  margin: 0;
  padding: 0;
  border: none;
  outline: none;
}

.player-overlay:fullscreen,
.player-overlay:-webkit-full-screen,
.player-overlay.fullscreen-active {
  width: 100vw !important;
  height: 100vh !important;
  inset: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  border: none !important;
  outline: none !important;
  background: #000000 !important;
}

.video-container {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  background: #000;
}

video {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.player-spinner {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  z-index: 10;
}

.spinner {
  width: 48px;
  height: 48px;
  border: 4px solid rgba(255, 255, 255, 0.2);
  border-top-color: var(--accent-gold);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.player-topbar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 70px;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.88) 0%, rgba(0, 0, 0, 0.4) 70%, transparent 100%);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  z-index: 20;
  transition: opacity 0.3s;
}

.player-btn-back {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
}
.player-btn-back:hover {
  background: rgba(255, 255, 255, 0.15);
}

.player-title-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.player-title-info h3 {
  font-size: 16px;
  font-weight: 700;
  color: #ffffff;
}

.player-epg-subtitle {
  font-size: 12px;
  color: var(--accent-gold);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}

.player-epg-subtitle:empty {
  display: none;
}

.player-clock {
  font-size: 14px;
  font-weight: 600;
  color: #ddd;
}



/* Vertical Volume Slider on Left */
.player-volume-slider {
  position: absolute;
  left: 24px;
  top: 50%;
  transform: translateY(-50%);
  height: 204px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  z-index: 20;
  background: rgba(0, 0, 0, 0.55);
  padding: 14px 6px;
  border-radius: 24px;
  backdrop-filter: blur(8px);
  box-sizing: border-box;
  transition: opacity 0.3s;
}

.vol-btn {
  background: transparent;
  border: none;
  margin: 0;
  padding: 0;
  width: 22px;
  height: 22px;
  color: #fff;
  cursor: pointer;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.18s ease;
  outline: none;
}

.vol-btn:hover {
  color: var(--accent-gold);
  background: rgba(255, 255, 255, 0.2);
  transform: scale(1.15);
}

.vol-btn:active {
  transform: scale(0.92);
}

.vol-icon {
  color: currentColor;
  transition: all 0.2s ease;
  display: block;
}

#volRange {
  writing-mode: vertical-lr;
  direction: rtl;
  height: 104px;
  width: 6px;
  margin: 2px 0;
  cursor: pointer;
  accent-color: var(--accent-gold);
  flex-shrink: 0;
  transition: accent-color 0.2s ease;
}

#volRange.boosted {
  accent-color: #ff9d00;
  filter: drop-shadow(0 0 5px rgba(255, 157, 0, 0.7));
}

.vol-btn.boosted {
  color: #ff9d00 !important;
  filter: drop-shadow(0 0 8px rgba(255, 157, 0, 0.85));
}

/* Bottom Controls */
.player-bottombar {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.92) 0%, rgba(0, 0, 0, 0.5) 70%, transparent 100%);
  padding: 16px 36px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  z-index: 20;
  transition: opacity 0.3s;
}

.player-timeline {
  display: flex;
  align-items: center;
  gap: 16px;
}

.time-current, .time-duration {
  font-size: 12px;
  font-weight: 600;
  color: #e0e0e0;
  font-variant-numeric: tabular-nums;
  min-width: 42px;
}

.timeline-bar {
  flex: 1;
  height: 5px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 3px;
  position: relative;
  cursor: pointer;
}

.timeline-buffered {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.4);
  border-radius: 3px;
  width: 0%;
}

.timeline-played {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  background: #ff3838;
  border-radius: 3px;
  width: 0%;
}

.timeline-handle {
  position: absolute;
  top: 50%;
  left: 0%;
  transform: translate(-50%, -50%);
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #ff3838;
  box-shadow: 0 0 6px #ff3838;
  pointer-events: none;
}

.player-controls-row {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  width: 100%;
}

.ctrl-left {
  display: flex;
  align-items: center;
  gap: 18px;
  justify-self: start;
}

.ctrl-center {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  justify-self: center;
}

.ctrl-right {
  display: flex;
  align-items: center;
  gap: 18px;
  justify-self: end;
}

.ctrl-btn {
  color: #d8cfea;
  padding: 8px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  transition: all 0.15s;
}
.ctrl-btn:hover {
  color: #fff;
  transform: scale(1.15);
  background: rgba(255, 255, 255, 0.08);
}

.btn-playpause {
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
  width: 46px;
  height: 46px;
  border-radius: 50%;
  margin: 0 6px;
}
.btn-playpause:hover {
  background: var(--accent-gold);
  color: #120a03;
  transform: scale(1.08);
}

/* Idle Player: Smooth fade out of controls and hide cursor */
.player-overlay {
  transition: cursor 0.2s;
}

.player-overlay.idle {
  cursor: none;
}

.player-topbar,
.player-bottombar,
.player-volume-slider {
  transition: opacity 0.35s ease, transform 0.35s ease, visibility 0.35s ease;
  visibility: visible;
  opacity: 1;
}

.player-overlay.idle .player-topbar {
  opacity: 0;
  transform: translateY(-20px);
  pointer-events: none;
  visibility: hidden;
}

.player-overlay.idle .player-bottombar {
  opacity: 0;
  transform: translateY(20px);
  pointer-events: none;
  visibility: hidden;
}

.player-overlay.idle .player-volume-slider {
  opacity: 0;
  transform: translateY(-50%) translateX(-20px);
  pointer-events: none;
  visibility: hidden;
}

/* Player Popups (Audio, Subtitles, Aspect Ratio, Player Settings) */
.player-popup-menu {
  position: absolute;
  bottom: 95px;
  background: rgba(18, 11, 32, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 14px;
  box-shadow: 0 16px 45px rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(16px);
  z-index: 100;
  width: 320px;
  color: #fff;
  overflow: hidden;
  animation: popupSlideUp 0.18s ease-out;
}

@keyframes popupSlideUp {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

#popupAudioTracks {
  left: 36px;
}
#popupSubtitles {
  left: 76px;
}
#popupAspect {
  right: 76px;
}
#popupPlayerSettings {
  right: 36px;
  width: 350px;
}

.popup-menu-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.04);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 13.5px;
  font-weight: 700;
  color: var(--accent-gold);
}

.popup-close-btn {
  margin-left: auto;
  font-size: 18px;
  color: #a092b8;
  cursor: pointer;
  background: transparent;
  border: none;
  padding: 0 4px;
  line-height: 1;
}
.popup-close-btn:hover {
  color: #fff;
}

.popup-menu-list {
  max-height: 240px;
  overflow-y: auto;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.popup-item {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-radius: 8px;
  background: transparent;
  border: 1px solid transparent;
  color: #ddd;
  font-size: 13px;
  text-align: left;
  cursor: pointer;
  transition: all 0.15s ease;
}
.popup-item:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}
.popup-item.active {
  background: rgba(247, 184, 1, 0.15);
  border-color: rgba(247, 184, 1, 0.35);
  color: var(--accent-gold);
  font-weight: 600;
}
.popup-item-check {
  font-size: 14px;
  font-weight: bold;
}

.popup-menu-footer {
  padding: 10px 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.2);
}

/* Quick Channel Switcher Drawer (OSD in Player) */
.player-channel-drawer {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 360px;
  max-width: 85vw;
  background: rgba(14, 8, 25, 0.95);
  backdrop-filter: blur(24px);
  border-left: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: -15px 0 45px rgba(0, 0, 0, 0.85);
  display: flex;
  flex-direction: column;
  z-index: 120;
  animation: slideDrawer 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

.player-channel-drawer.hidden {
  display: none !important;
}

@keyframes slideDrawer {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

.player-drawer-header {
  padding: 20px 18px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: rgba(0, 0, 0, 0.25);
}

.drawer-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.drawer-title-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 800;
  color: var(--accent-gold);
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

.drawer-close-btn {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #fff;
  font-size: 18px;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: all 0.15s ease;
}

.drawer-close-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  color: #ff3b30;
}

.drawer-category-box {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  padding: 5px 12px;
  transition: all 0.2s ease;
}

.drawer-category-box:focus-within {
  border-color: var(--accent-gold);
  background: rgba(255, 255, 255, 0.12);
  box-shadow: 0 0 12px rgba(245, 184, 46, 0.2);
}

.drawer-category-box svg {
  color: var(--accent-gold);
  flex-shrink: 0;
}

.player-drawer-category-select {
  background: transparent;
  border: none;
  outline: none;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  width: 100%;
  cursor: pointer;
  padding: 3px 0;
}

.player-drawer-category-select option {
  background: #180d2e;
  color: #ffffff;
  padding: 8px;
}

.drawer-search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  padding: 6px 12px;
}

.drawer-search-box svg {
  color: var(--text-muted);
}

.drawer-search-box input {
  background: transparent;
  border: none;
  outline: none;
  color: #fff;
  font-size: 12px;
  width: 100%;
}

.player-drawer-list {
  flex: 1;
  overflow-y: auto;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.player-drawer-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 12px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  cursor: pointer;
  transition: all 0.15s ease;
}

.player-drawer-item:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateX(-3px);
}

.player-drawer-item.active {
  background: rgba(245, 184, 46, 0.18);
  border-color: var(--accent-gold);
  box-shadow: 0 0 16px rgba(245, 184, 46, 0.25);
}

.player-drawer-num {
  font-size: 11px;
  font-weight: 800;
  color: var(--accent-gold);
  min-width: 24px;
  text-align: right;
  flex-shrink: 0;
}

.player-drawer-logo {
  width: 34px;
  height: 34px;
  border-radius: 6px;
  object-fit: contain;
  background: rgba(0, 0, 0, 0.4);
  flex-shrink: 0;
  padding: 2px;
}

.player-drawer-info {
  flex: 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.player-drawer-name {
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.player-drawer-item.active .player-drawer-name {
  color: var(--accent-gold);
}

.player-drawer-fav-icon {
  color: #e63946;
  flex-shrink: 0;
}

.ctrl-btn.active {
  color: var(--accent-gold);
  background: rgba(245, 184, 46, 0.2);
  border-radius: 8px;
}

.btn-load-sub {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px dashed rgba(255, 255, 255, 0.25);
  border-radius: 8px;
  color: #cfc2e6;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.18s ease;
}
.btn-load-sub:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  border-color: var(--accent-gold);
}

/* Player Settings Content */
.popup-settings-content {
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-height: 380px;
  overflow-y: auto;
}

.settings-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.settings-group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.settings-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--accent-gold);
}

.btn-reset-filters {
  font-size: 11px;
  color: #a092b8;
  background: transparent;
  border: none;
  cursor: pointer;
  text-decoration: underline;
}
.btn-reset-filters:hover {
  color: #fff;
}

.speed-buttons-row {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 4px;
}
.speed-btn {
  padding: 6px 0;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #ccc;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}
.speed-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
}
.speed-btn.active {
  background: var(--accent-gold);
  border-color: var(--accent-gold);
  color: #120a03;
  font-weight: 700;
}

.filter-slider-row {
  display: grid;
  grid-template-columns: 75px 1fr 40px;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  color: #c0b4d4;
}
.filter-slider-row input[type="range"] {
  height: 4px;
  accent-color: var(--accent-gold);
  cursor: pointer;
}
.filter-val {
  text-align: right;
  font-size: 11px;
  color: #fff;
  font-family: monospace;
}

.buffer-mode-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.buffer-btn {
  padding: 8px 10px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #ccc;
  font-size: 11.5px;
  cursor: pointer;
  text-align: center;
  transition: all 0.15s ease;
}
.buffer-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}
.buffer-btn.active {
  background: rgba(46, 196, 182, 0.2);
  border-color: #2ec4b6;
  color: #2ec4b6;
  font-weight: 600;
}

/* --- Modals & Dialogs --- */
dialog {
  margin: auto;
  background: transparent;
  border: none;
}

dialog::backdrop {
  background: rgba(6, 3, 14, 0.85);
  backdrop-filter: blur(8px);
}

.modal-box {
  background: #150c26;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 18px;
  width: 480px;
  padding: 32px;
  position: relative;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.7);
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 18px;
  font-size: 22px;
  color: #999;
}
.modal-close:hover { color: #fff; }

.modal-eyebrow {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1.5px;
  color: var(--accent-gold);
}

.modal-box h2 {
  font-size: 22px;
  margin: 6px 0 10px;
}

.modal-box p {
  font-size: 12px;
  color: var(--text-dim);
  margin-bottom: 22px;
  line-height: 1.5;
}

.modal-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
  color: #c9bfdc;
  margin-bottom: 14px;
}

.modal-field input {
  background: #0c0617;
  border: 1px solid rgba(255, 255, 255, 0.15);
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 13px;
  color: #fff;
}
.modal-field input:focus {
  border-color: var(--accent-gold);
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.modal-divider {
  text-align: center;
  position: relative;
  margin: 18px 0;
}
.modal-divider::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 1px;
  background: rgba(255, 255, 255, 0.1);
}
.modal-divider span {
  position: relative;
  background: #150c26;
  padding: 0 10px;
  font-size: 10px;
  font-weight: 700;
  color: #8c7f9e;
  letter-spacing: 1px;
}

.btn-primary {
  width: 100%;
  background: var(--accent-gold);
  color: #1a0f05;
  padding: 12px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 800;
  margin-top: 10px;
}
.btn-primary:hover {
  background: #ffd066;
}

/* Movie Details Modal */
/* --- Modals & Dialogs --- */
dialog {
  margin: auto;
  background: transparent;
  border: none;
  color: #ffffff;
  color-scheme: dark;
}

dialog::backdrop {
  background: rgba(6, 3, 14, 0.85);
  backdrop-filter: blur(8px);
}

.movie-modal-box {
  background: #140d24;
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 18px;
  width: 940px;
  max-width: 95vw;
  max-height: 88vh;
  overflow-y: auto;
  overflow-x: hidden;
  position: relative;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.85);
}

.movie-modal-box::-webkit-scrollbar {
  width: 8px;
}
.movie-modal-box::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.18);
  border-radius: 4px;
}
.movie-modal-box::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.2);
}

.movie-backdrop {
  height: 240px;
  background-size: cover;
  background-position: center 20%;
  position: relative;
}
.movie-backdrop::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, #140d24 15%, rgba(20, 13, 36, 0.4) 60%, transparent 100%);
}

.movie-content {
  display: flex;
  gap: 26px;
  padding: 0 32px 20px;
  margin-top: -85px;
  position: relative;
  z-index: 2;
}

.movie-poster {
  width: 150px;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  border-radius: 12px;
  border: 1.5px solid rgba(255, 255, 255, 0.25);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.7);
  flex-shrink: 0;
}

.movie-director {
  font-size: 13px;
  color: #d1c4e9;
  margin-bottom: 8px;
  font-weight: 500;
}

.movie-details {
  color: #ffffff;
}

.movie-details h2,
#movieTitle {
  font-size: 28px;
  font-weight: 800;
  color: #ffffff !important;
  margin-bottom: 8px;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.8);
  letter-spacing: -0.3px;
}

.movie-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.meta-pill {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.16);
  font-size: 11.5px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 6px;
  color: #f1edfa;
}

.movie-plot {
  font-size: 13.5px;
  color: #e4ddf2;
  line-height: 1.6;
  margin-bottom: 20px;
  max-height: 105px;
  overflow-y: auto;
}

/* Cast and Actor Filmography sections */
.movie-extra-section {
  padding: 18px 32px 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.section-subtitle {
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

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

.actor-movies-count {
  font-size: 12px;
  color: #8e80a8;
}

.cast-row {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  padding: 8px 4px 14px;
  scroll-behavior: smooth;
}

.cast-row::-webkit-scrollbar,
.actor-movies-row::-webkit-scrollbar {
  height: 6px;
}
.cast-row::-webkit-scrollbar-thumb,
.actor-movies-row::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 3px;
}

.actor-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 95px;
  flex-shrink: 0;
  cursor: pointer;
  padding: 8px 6px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid transparent;
  transition: all 0.2s ease;
  user-select: none;
}
.actor-card:hover {
  background: rgba(255, 255, 255, 0.08);
  transform: translateY(-3px);
  border-color: rgba(255, 255, 255, 0.15);
}
.actor-card.active {
  background: rgba(247, 184, 1, 0.12);
  border-color: var(--accent-gold);
  box-shadow: 0 4px 16px rgba(247, 184, 1, 0.25);
  transform: translateY(-3px);
}

.actor-photo-wrap {
  width: 66px;
  height: 66px;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
  transition: all 0.2s ease;
  background: #201338;
}
.actor-card.active .actor-photo-wrap {
  border-color: var(--accent-gold);
  box-shadow: 0 0 14px var(--accent-gold-glow);
}

.actor-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.actor-name {
  font-size: 11.5px;
  font-weight: 600;
  color: #fff;
  text-align: center;
  margin-top: 8px;
  line-height: 1.2;
  max-width: 85px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.actor-card.active .actor-name {
  color: var(--accent-gold);
}

.actor-char {
  font-size: 10px;
  color: #8e80a8;
  text-align: center;
  margin-top: 2px;
  max-width: 85px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.actor-movies-row {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  padding: 8px 4px 14px;
  scroll-behavior: smooth;
  min-height: 220px;
}

.actor-movie-card {
  width: 140px;
  flex-shrink: 0;
  border-radius: 10px;
  background: rgba(22, 14, 38, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.08);
  overflow: hidden;
  cursor: pointer;
  transition: all 0.22s ease;
  display: flex;
  flex-direction: column;
  position: relative;
}
.actor-movie-card:hover {
  transform: translateY(-5px);
  border-color: var(--accent-gold);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.6);
}

.actor-movie-thumb-wrap {
  position: relative;
  width: 100%;
  height: 190px;
  overflow: hidden;
  background: #190e2b;
}

.actor-movie-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.25s ease;
}
.actor-movie-card:hover .actor-movie-thumb {
  transform: scale(1.05);
}

.actor-movie-badge-live {
  position: absolute;
  top: 6px;
  left: 6px;
  background: #2ec4b6;
  color: #042420;
  font-size: 9px;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 4px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}

.actor-movie-badge-type {
  position: absolute;
  bottom: 6px;
  left: 6px;
  background: rgba(123, 44, 191, 0.85);
  color: #fff;
  font-size: 9.5px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  backdrop-filter: blur(4px);
}

.actor-movie-badge-rating {
  position: absolute;
  top: 6px;
  right: 6px;
  background: rgba(0, 0, 0, 0.75);
  color: var(--accent-gold);
  font-size: 10px;
  font-weight: 700;
  padding: 2px 5px;
  border-radius: 4px;
}

.actor-movie-info {
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.actor-movie-title {
  font-size: 12.5px;
  font-weight: 700;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.actor-movie-year {
  font-size: 11px;
  color: #c9bede;
}

.modal-close-btn {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.65);
  border: 1.5px solid rgba(255, 255, 255, 0.25);
  color: #fff;
  display: grid;
  place-items: center;
  cursor: pointer;
  z-index: 50;
  transition: all 0.18s ease;
  backdrop-filter: blur(8px);
}
.modal-close-btn:hover {
  background: #ff3344;
  border-color: #ff3344;
  transform: scale(1.1);
  box-shadow: 0 0 12px rgba(255, 51, 68, 0.6);
}

.movie-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 10px;
}

.btn-play-movie {
  background: var(--accent-gold);
  color: #1a0f05;
  padding: 10px 22px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: all 0.18s ease;
}
.btn-play-movie:hover {
  background: #ffd066;
  transform: translateY(-2px);
  box-shadow: 0 4px 14px var(--accent-gold-glow);
}

.btn-back-movie {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  padding: 10px 22px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: all 0.18s ease;
}
.btn-back-movie:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
}

/* Favorite Buttons System */
.poster-fav-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #c0b4d4;
  display: grid;
  place-items: center;
  cursor: pointer;
  z-index: 3;
  transition: all 0.2s ease;
  padding: 0;
}
.poster-fav-btn:hover {
  background: rgba(230, 57, 70, 0.9);
  color: #fff;
  transform: scale(1.15);
  border-color: transparent;
}
.poster-fav-btn.active {
  background: #e63946;
  color: #fff;
  border-color: #ff6b6b;
  box-shadow: 0 0 10px rgba(230, 57, 70, 0.6);
}

.btn-fav-movie {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  padding: 10px 18px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: all 0.18s ease;
}
.btn-fav-movie:hover {
  background: rgba(230, 57, 70, 0.25);
  border-color: #e63946;
  color: #ff6b6b;
  transform: translateY(-2px);
}
.btn-fav-movie.active {
  background: #e63946;
  border-color: #ff6b6b;
  color: #fff;
  box-shadow: 0 4px 14px rgba(230, 57, 70, 0.5);
}

.btn-fav-series {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #c0b4d4;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.18s ease;
  margin-top: 8px;
}
.btn-fav-series:hover {
  background: rgba(230, 57, 70, 0.25);
  border-color: #e63946;
  color: #ff6b6b;
  transform: scale(1.1);
}
.btn-fav-series.active {
  background: #e63946;
  border-color: #ff6b6b;
  color: #fff;
  box-shadow: 0 0 10px rgba(230, 57, 70, 0.6);
}

.player-btn-fav {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #c0b4d4;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  margin-right: 18px;
  cursor: pointer;
  transition: all 0.2s ease;
}
.player-btn-fav:hover {
  background: rgba(230, 57, 70, 0.3);
  color: #ff6b6b;
  border-color: #e63946;
  transform: scale(1.1);
}
.player-btn-fav.active {
  background: #e63946;
  border-color: #ff6b6b;
  color: #fff;
  box-shadow: 0 0 12px rgba(230, 57, 70, 0.6);
}

/* Toast */
#toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--accent-gold);
  color: #120a03;
  font-weight: 700;
  font-size: 13px;
  padding: 10px 20px;
  border-radius: 20px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
  z-index: 2000;
}
#toast.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(-6px);
}

/* --- Resume Playback & Watched Status Styles --- */
.player-resume-toast {
  position: absolute;
  top: 76px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(18, 9, 32, 0.94);
  border: 1px solid rgba(245, 184, 46, 0.45);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.7), 0 0 20px rgba(245, 184, 46, 0.25);
  border-radius: 30px;
  padding: 8px 18px 8px 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  z-index: 60;
  backdrop-filter: blur(14px);
  animation: slideDownToast 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideDownToast {
  from { opacity: 0; transform: translate(-50%, -15px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

.resume-toast-info {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
}

.resume-toast-info svg {
  color: var(--accent-gold);
}

.btn-resume-restart {
  background: rgba(245, 184, 46, 0.15);
  border: 1px solid rgba(245, 184, 46, 0.4);
  color: var(--accent-gold);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 5px 12px;
  border-radius: 16px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-resume-restart:hover {
  background: var(--accent-gold);
  color: #120b22;
  box-shadow: 0 0 12px rgba(245, 184, 46, 0.45);
}

.btn-resume-close {
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.6);
  font-size: 16px;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
  transition: color 0.15s;
}

.btn-resume-close:hover {
  color: #ff3b30;
}

/* Episodes Header with Resume Button */
.episodes-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  gap: 16px;
}

.episodes-header-left {
  display: flex;
  align-items: baseline;
  gap: 14px;
}

.btn-resume-series {
  background: linear-gradient(135deg, #f5b82e, #e59714);
  border: none;
  color: #120b22;
  font-weight: 700;
  font-size: 13px;
  padding: 8px 18px;
  border-radius: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 4px 14px rgba(245, 184, 46, 0.35);
  transition: all 0.2s ease;
}

.btn-resume-series:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(245, 184, 46, 0.55);
}

/* Watched Badges on Posters */
.poster-badge-watched {
  position: absolute;
  bottom: 8px;
  left: 8px;
  background: rgba(34, 197, 94, 0.94);
  color: #ffffff;
  font-size: 10px;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 5px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  gap: 4px;
  z-index: 3;
}

/* Progress track on bottom of poster */
.poster-progress-track {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: rgba(0, 0, 0, 0.7);
  z-index: 4;
  overflow: hidden;
}

.poster-progress-fill {
  height: 100%;
  background: #ff3b30;
  box-shadow: 0 0 6px #ff3b30;
  border-radius: 0 2px 2px 0;
}

/* Episode Progress & Watched */
.episode-card {
  position: relative;
}

.episode-card.watched {
  opacity: 0.88;
}

.episode-progress-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: rgba(0, 0, 0, 0.7);
  z-index: 3;
}

.episode-progress-fill {
  height: 100%;
  background: #ff3b30;
  box-shadow: 0 0 6px #ff3b30;
}

.badge-watched-ep {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(34, 197, 94, 0.2);
  color: #4ade80;
  border: 1px solid rgba(34, 197, 94, 0.4);
  font-size: 10px;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.btn-toggle-ep-watched {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--text-muted);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-left: auto;
  flex-shrink: 0;
}

.btn-toggle-ep-watched:hover {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  transform: scale(1.1);
}

.btn-toggle-ep-watched.active {
  background: rgba(34, 197, 94, 0.25);
  border-color: #22c55e;
  color: #22c55e;
}

/* Movie Modal Watched Button */
.btn-watched-movie {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #fff;
  padding: 10px 18px;
  border-radius: 25px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-watched-movie:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.35);
  transform: translateY(-2px);
}

.btn-watched-movie.active {
  background: rgba(34, 197, 94, 0.22);
  border-color: #22c55e;
  color: #4ade80;
}

/* Resume Dismiss Button on Home Cards */
.poster-dismiss-resume {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  cursor: pointer;
  opacity: 0;
  transition: all 0.2s ease;
  z-index: 10;
}

.poster-card:hover .poster-dismiss-resume {
  opacity: 1;
}

.poster-dismiss-resume:hover {
  background: #ff3b30;
  border-color: #ff3b30;
  transform: scale(1.15);
}

.hidden {
  display: none !important;
}

/* --- PWA Mobile Responsive Styles --- */
@media (max-width: 860px) {
  /* Header */
  .app-header {
    padding: 0 14px;
    height: 56px;
  }
  .header-left {
    gap: 14px;
  }
  .app-logo-img {
    height: 30px;
    max-width: 120px;
  }
  .main-nav {
    gap: 8px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .nav-link {
    font-size: 13px;
    padding: 4px 3px;
    white-space: nowrap;
  }
  .nav-sep {
    font-size: 11px;
  }
  .header-clock {
    display: none;
  }
  .header-right {
    gap: 10px;
  }
  .search-box {
    padding: 4px 10px;
  }
  .search-box input {
    width: 90px;
    font-size: 12px;
  }
  .search-box input:focus {
    width: 120px;
  }

  /* Home Dashboard */
  .home-container {
    padding: 16px 14px 40px;
    gap: 20px;
  }
  .home-banner {
    justify-content: stretch;
  }
  .account-card {
    width: 100%;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    padding: 12px 14px;
  }
  .account-details {
    flex-wrap: wrap;
    gap: 12px;
    font-size: 12px;
  }
  .home-tiles-grid {
    grid-template-columns: 1fr;
    gap: 14px;
    min-height: auto;
  }
  .home-tile {
    padding: 22px 18px;
    min-height: 110px;
  }
  .home-tile h2 {
    font-size: 20px;
  }
  .home-tile p {
    font-size: 12px;
    margin-bottom: 12px;
  }

  /* Grids */
  .home-media-grid,
  .media-grid {
    grid-template-columns: repeat(auto-fill, minmax(135px, 1fr));
    grid-auto-rows: 230px;
    gap: 12px 10px;
  }
  .poster-card {
    height: 230px;
    min-height: 230px;
    max-height: 230px;
  }
  .poster-title-box {
    padding: 6px;
  }
  .poster-title-pill {
    font-size: 11px;
    padding: 3px 6px;
  }

  /* Explorer Sidebar */
  #viewExplorer {
    flex-direction: column;
  }
  .explorer-sidebar {
    width: 100%;
    height: auto;
    max-height: 120px;
    border-right: none;
    border-bottom: 1px solid var(--border-subtle);
    padding: 10px 14px;
  }
  .sidebar-top-icon,
  .sidebar-actions {
    display: none;
  }
  .categories-list {
    flex-direction: row;
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 6px;
    gap: 6px;
    -webkit-overflow-scrolling: touch;
  }
  .cat-item {
    white-space: nowrap;
    flex-shrink: 0;
    padding: 6px 12px;
    font-size: 12px;
  }
  .explorer-main {
    padding: 14px 12px;
  }
  .main-toolbar {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 14px;
  }

  /* Live Preview Panel */
  .live-preview-panel {
    position: fixed;
    inset: auto 0 0 0;
    width: 100%;
    height: 320px;
    z-index: 999;
    border-left: none;
    border-top: 1px solid var(--border-subtle);
    box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.8);
  }

  /* Series Detail View */
  .series-detail-container {
    flex-direction: column;
    padding: 14px;
    overflow-y: auto;
  }
  .series-detail-sidebar {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid var(--border-subtle);
    padding-bottom: 14px;
  }
  .episodes-grid {
    grid-template-columns: 1fr;
  }

  /* Movie Modal Dialog */
  dialog#movieModal {
    width: 95vw;
    max-height: 90vh;
    padding: 16px 14px;
  }
  .movie-content {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 16px;
  }
  .movie-poster {
    width: 140px;
    height: 200px;
  }
  .movie-actions {
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
  }

  /* Resume Dismiss Button always visible on touch */
  .poster-dismiss-resume {
    opacity: 0.85;
  }
}

/* ==========================================================================
   Picture-in-Picture (PiP) Mode & Floating Restore Bar
   ========================================================================== */

/* Quando o PiP é ativado no player principal:
   O Chromium/Electron destrói o PiP se o elemento de vídeo tiver display:none ou visibility:hidden.
   Por isso, minimizamos o playerView para 1px transparente no canto, mantendo a visibilidade e
   desbloqueando 100% da interface do aplicativo para o usuário navegar pelos canais, filmes e séries! */
.player-overlay.pip-mode {
  position: fixed !important;
  bottom: 0 !important;
  right: 0 !important;
  width: 1px !important;
  height: 1px !important;
  opacity: 0 !important;
  pointer-events: none !important;
  z-index: -10 !important;
  visibility: visible !important;
  overflow: hidden !important;
  background: transparent !important;
}

.player-overlay.pip-mode * {
  pointer-events: none !important;
}

/* Barra Flutuante de PiP no App */
.pip-floating-bar {
  position: fixed;
  bottom: 24px;
  right: 28px;
  z-index: 950;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 16px;
  background: linear-gradient(135deg, rgba(20, 11, 38, 0.95), rgba(35, 17, 65, 0.92));
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 190, 46, 0.35);
  border-radius: 50px;
  box-shadow: 0 10px 32px rgba(0, 0, 0, 0.65), 0 0 20px rgba(255, 184, 0, 0.15);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  animation: pipBarSlideUp 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.pip-floating-bar.hidden {
  display: none !important;
}

@keyframes pipBarSlideUp {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.pip-bar-indicator {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.pip-pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ffb800;
  box-shadow: 0 0 10px #ffb800;
  animation: pipPulse 1.6s infinite ease-in-out;
}

@keyframes pipPulse {
  0% { transform: scale(0.9); opacity: 0.7; }
  50% { transform: scale(1.3); opacity: 1; box-shadow: 0 0 14px #ffb800; }
  100% { transform: scale(0.9); opacity: 0.7; }
}

.pip-bar-badge {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.8px;
  color: #ffb800;
  text-transform: uppercase;
}

.pip-bar-info {
  display: flex;
  align-items: center;
  max-width: 260px;
  overflow: hidden;
}

.pip-bar-title {
  font-size: 13px;
  font-weight: 600;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pip-bar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.pip-bar-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
}

.pip-bar-restore {
  background: linear-gradient(135deg, #ffb800, #ff8c00);
  color: #120a21;
  font-size: 12px;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: 20px;
  box-shadow: 0 2px 10px rgba(255, 184, 0, 0.3);
}

.pip-bar-restore:hover,
.pip-bar-restore.tv-focused {
  background: linear-gradient(135deg, #ffd043, #ffa01c);
  transform: translateY(-1px) scale(1.03);
  box-shadow: 0 4px 16px rgba(255, 184, 0, 0.5);
  outline: 2px solid #fff;
}

.pip-bar-close {
  background: rgba(255, 255, 255, 0.08);
  color: #c4b5fd;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pip-bar-close:hover,
.pip-bar-close.tv-focused {
  background: rgba(255, 75, 75, 0.85);
  color: #ffffff;
  transform: scale(1.1);
  outline: 2px solid #fff;
}

