/* ONBR PLAYER - WebOS Standalone Styles */
/* Layout completo com detalhes de filmes e séries */

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

:root {
  --bg-primary: #0a0a0f;
  --bg-secondary: #14141f;
  --bg-card: #1e1e2d;
  --bg-hover: rgba(139, 92, 246, 0.15);
  --bg-active: rgba(139, 92, 246, 0.4);
  --text-primary: #ffffff;
  --text-secondary: #a0a0b0;
  --accent: #8b5cf6;
  --border: #2a2a3d;
  --border-active: rgba(139, 92, 246, 0.5);
  --glass-bg: rgba(26, 31, 58, 0.65);
  --purple-glow: 0 0 5px rgba(139, 92, 246, 0.4);
}

html,
body {
  font-family: 'Segoe UI', system-ui, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  margin: 0;
  padding: 0;
  /* Base font size - proportional to screen height for TV */
  font-size: clamp(18px, 1.8vw, 28px);
}

/* Ocultar scrollbar horizontal em toda aplicação */
* {
  scrollbar-width: none;
  /* Firefox */
  -ms-overflow-style: none;
  /* IE/Edge */
}

*::-webkit-scrollbar {
  display: none;
  /* Chrome, Safari, Opera */
}

#root {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #0a0a0f, #1a1a2e, #16213e);
  overflow: hidden;
}

/* ==================== LOGIN ==================== */
.login-container {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 40px;
  background: linear-gradient(135deg, #0a0a0f, #1a1a2e, #16213e);
}

.login-card {
  width: 100%;
  max-width: 420px;
  padding: 40px;
  background: rgba(30, 30, 45, 0.95);
  /* backdrop-filter removed for performance */
  border-radius: 20px;
  border: 1px solid var(--border);
}

.login-header {
  text-align: center;
  margin-bottom: 32px;
}

.login-header h1 {
  font-size: 36px;
  background: linear-gradient(90deg, var(--accent), #a855f7);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.login-header p {
  color: var(--text-secondary);
  margin-top: 8px;
  font-size: 18px;
}

.form-group {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  margin-bottom: 8px;
  color: var(--text-secondary);
  font-size: 20px;
  font-weight: 500;
}

.form-input {
  width: 100%;
  padding: 16px 20px;
  font-size: 18px;
  height: 60px;
  border: 2px solid var(--border);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
  outline: none;
  transition: all 0.2s;
}

.form-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.2);
}

.form-input::placeholder {
  color: var(--text-secondary);
}

.btn-primary {
  width: 100%;
  padding: 18px;
  font-size: 20px;
  height: 60px;
  font-weight: 600;
  border: none;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--accent), #7c3aed);
  color: white;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-primary:hover,
.btn-primary:focus {
  transform: translateY(-2px);
  box-shadow: var(--purple-glow);
  outline: none;
}

.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.error {
  padding: 14px;
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.5);
  border-radius: 10px;
  color: #f87171;
  font-size: 16px;
  text-align: center;
}

/* ==================== APP LAYOUT ==================== */
.app-layout {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.main-sidebar {
  width: 230px;
  min-width: 230px;
  background: rgba(30, 30, 45, 0.98);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 16px 14px;
  flex-shrink: 0;
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
}

.sidebar-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 16px;
}

.logo-icon {
  width: 60px;
  height: 60px;
  border-radius: 14px;
  object-fit: contain;
  background: linear-gradient(135deg, var(--accent), #7c3aed);
  padding: 8px;
}

.logo-text {
  display: flex;
  flex-direction: column;
}

.logo-text strong {
  font-size: 1.1em;
  color: var(--text-primary);
}

.logo-text span {
  font-size: 0.8em;
  color: var(--text-secondary);
}

.nav-section {
  flex: 1;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 10px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: background 0.08s, transform 0.08s;
  margin-bottom: 4px;
  font-size: 1em;
  border: 1px solid transparent;
  white-space: nowrap;
  overflow: visible;
}

.nav-item:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.nav-item.active {
  background: var(--bg-active);
  color: var(--text-primary);
  border-color: var(--border-active);
  box-shadow: var(--purple-glow);
}

.nav-item:focus {
  outline: none;
  border-color: var(--accent);
}

.nav-icon {
  font-size: 1.1em;
  flex-shrink: 0;
}

.nav-label {
  font-weight: 500;
  white-space: nowrap;
}

/* ==================== SIDEBAR COLLAPSED STATE ==================== */
.main-sidebar.collapsed {
  width: 70px;
  min-width: 70px;
  padding: 16px 8px;
  transition: width 0.1s ease, min-width 0.1s ease, padding 0.1s ease;
}

.main-sidebar:not(.collapsed) {
  transition: width 0.1s ease, min-width 0.1s ease, padding 0.1s ease;
}

.main-sidebar.collapsed .sidebar-header {
  justify-content: center;
}

.main-sidebar.collapsed .logo-icon {
  width: 48px;
  height: 48px;
}

.main-sidebar.collapsed .logo-text {
  display: none;
}

.main-sidebar.collapsed .nav-item {
  justify-content: center;
  padding: 12px 8px;
}

.main-sidebar.collapsed .nav-label {
  display: none;
}

.main-sidebar.collapsed .nav-help {
  display: none;
}

.btn-logout {
  margin-top: auto;
  padding: 12px;
  font-size: 1em;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-secondary);
  cursor: pointer;
}

.btn-logout:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

/* Logout item in menu */
.nav-item.nav-logout {
  margin-top: 12px;
  border-top: 1px solid var(--border);
  padding-top: 16px;
  color: #ff6b6b;
}

.nav-item.nav-logout:hover,
.nav-item.nav-logout.focused {
  background: rgba(255, 107, 107, 0.2);
  color: #ff6b6b;
}

.category-sidebar {
  width: 220px;
  background: rgba(20, 20, 30, 0.8);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}

.category-header {
  padding: 16px;
  font-size: 12px;
  font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 1px;
  border-bottom: 1px solid var(--border);
}

.category-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
}

.category-item {
  padding: 12px 14px;
  border-radius: 8px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s;
  margin-bottom: 2px;
  font-size: 0.95em;
  border-left: 3px solid transparent;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.category-item:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.category-item.active {
  background: var(--bg-active);
  color: var(--text-primary);
  border-left-color: var(--accent);
}

/* Focused but not active - keyboard focus indicator */
.category-item.focused:not(.active) {
  background: rgba(139, 92, 246, 0.15);
  color: var(--text-primary);
  border-left-color: rgba(139, 92, 246, 0.5);
  box-shadow: 0 0 0 2px rgba(139, 92, 246, 0.3);
}

/* Focused AND active - highlighted selection */
.category-item.active.focused {
  background: var(--accent);
  color: #fff;
  border-left-color: var(--accent);
  box-shadow: 0 0 4px rgba(139, 92, 246, 0.5);
}

.category-loading {
  padding: 20px;
  text-align: center;
  color: var(--text-secondary);
}

/* ==================== SEARCH UI ==================== */
.search-container {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.search-input {
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.08);
  border: 2px solid var(--border);
  border-radius: 10px;
  color: var(--text-primary);
  font-size: 1em;
  outline: none;
  transition: all 0.2s;
}

.search-input:focus {
  border-color: var(--accent);
  background: rgba(255, 255, 255, 0.12);
}

.search-input::placeholder {
  color: var(--text-secondary);
}

.search-btn {
  padding: 14px 20px;
  background: rgba(139, 92, 246, 0.3);
  border: 2px solid rgba(139, 92, 246, 0.5);
  border-radius: 10px;
  color: #fff;
  font-size: 1em;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.search-btn:hover:not(:disabled) {
  background: rgba(139, 92, 246, 0.5);
  border-color: var(--accent);
}

.search-btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.spinner-small {
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.content-area {
  flex: 1;
  overflow-y: auto;
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
}

.content-header {
  margin-bottom: 16px;
  font-size: 14px;
  color: var(--text-secondary);
}

.content-loading,
.content-empty {
  display: flex;
  flex: 1;
  width: 100%;
  height: 100%;
  min-height: 300px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  color: var(--text-secondary);
}

.loading-percent {
  font-size: 1.1em;
  font-weight: bold;
  color: var(--accent);
}

.content-empty span {
  font-size: 48px;
  opacity: 0.5;
}

.content-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
  padding-bottom: 40px;
}

.content-card {
  background: var(--bg-card);
  border-radius: 10px;
  border: 2px solid transparent;
  cursor: pointer;
  transition: all 0.2s;
}

.content-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-active);
  box-shadow: var(--purple-glow);
}

.content-card:focus {
  outline: none;
  border-color: var(--accent);
  transform: scale(1.02);
}

/* ✅ Fallback universal (funciona até sem aspect-ratio e sem @supports) */
.card-image-wrapper {
  width: 100%;
  position: relative;
  overflow: hidden;
  background: var(--bg-secondary);

  /* força proporção 2:3 com dupla proteção */
  height: 0;
  padding-bottom: 150%;
  min-height: 270px;
  /* Fallback adicional para Tizen - garante altura mínima */
}

.card-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  /* evita "gap" de inline-img */
  transition: transform 0.3s;
}

/* Removed @supports - padding-bottom hack é universal e confiável em Tizen/WebView */

.content-card:hover .card-image,
.content-card.focused .card-image {
  transform: scale(1.1);
}

.card-placeholder {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: linear-gradient(145deg, #14141f 0%, #1e1e2d 50%, #252840 100%);
  color: rgba(139, 92, 246, 0.7);
  font-size: 0;
  overflow: hidden;
}

/* ONBR Logo text placeholder */
.card-placeholder::before {
  content: "ONBR";
  font-family: 'Segoe UI', system-ui, sans-serif;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 3px;
  background: linear-gradient(135deg, #8b5cf6 0%, #22c55e 50%, #facc15 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  opacity: 0.85;
}

/* Shimmer loading effect */
.card-placeholder::after {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg,
      transparent 0%,
      rgba(139, 92, 246, 0.1) 50%,
      transparent 100%);
  animation: placeholder-shimmer 2.5s ease-in-out infinite;
}

@keyframes placeholder-shimmer {
  0% {
    left: -100%;
  }

  100% {
    left: 100%;
  }
}

.card-title {
  padding: 10px;
  font-size: 0.85em;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ==================== DETAIL PAGES ==================== */
.detail-page {
  width: 100vw;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background-size: cover;
  background-position: center;
}

.detail-loading,
.detail-error {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  color: var(--text-secondary);
}

.detail-content {
  display: flex;
  gap: 48px;
  padding: 50px;
  max-width: 1400px;
  width: 100%;
}

.detail-poster {
  width: 350px;
  height: 525px;
  background: #222;
  border-radius: 16px;
  overflow: hidden;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.8);
}

.detail-poster img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.poster-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 60px;
  background: #1a1a2e;
}

.detail-info {
  flex: 1;
  max-width: 800px;
}

.back-btn {
  display: inline-block;
  margin-bottom: 20px;
  padding: 12px 24px;
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 1em;
  transition: all 0.2s;
}

.back-btn:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.detail-info h1 {
  font-size: 1.8em;
  font-weight: 700;
  margin-bottom: 20px;
}

.detail-meta {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.meta-badge {
  padding: 8px 18px;
  background: #333;
  border-radius: 20px;
  font-size: 1em;
}

.meta-badge.accent {
  background: var(--accent);
}

.detail-genre {
  color: #a78bfa;
  font-size: 1.1em;
  margin-bottom: 16px;
}

.detail-plot {
  color: #ccc;
  font-size: 1em;
  line-height: 1.6;
  margin-bottom: 20px;
  max-height: 150px;
  overflow: hidden;
}

.detail-credit {
  color: #888;
  font-size: 0.95em;
  margin-bottom: 8px;
}

.detail-rating {
  color: #fbbf24;
  font-size: 1.1em;
  margin-bottom: 12px;
}

.play-btn {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin-top: 24px;
  padding: 18px 36px;
  background: linear-gradient(135deg, var(--accent), #a855f7);
  border: none;
  border-radius: 12px;
  color: white;
  font-size: 1.2em;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(124, 58, 237, 0.5);
  transition: all 0.2s;
}

.play-btn:hover {
  transform: scale(1.05);
}

/* ==================== SERIES PAGE ==================== */
.series-page {
  display: flex;
  flex-direction: column;
  height: 100vh;
  background: var(--bg-primary);
}

.series-header {
  display: flex;
  gap: 20px;
  padding: 20px;
  background: linear-gradient(135deg, #1a1a2e, #16213e);
  border-bottom: 2px solid var(--accent);
}

.series-poster {
  width: 120px;
  height: 160px;
  background: #222;
  border-radius: 8px;
  overflow: hidden;
  flex-shrink: 0;
}

.series-poster img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.series-info {
  flex: 1;
}

.series-info h1 {
  font-size: 22px;
  margin-bottom: 8px;
}

.series-stats {
  color: var(--accent);
  font-size: 14px;
  margin-top: 12px;
}

.series-content {
  display: flex;
  flex: 1;
  overflow: hidden;
}

.seasons-list {
  width: 200px;
  background: #111118;
  border-right: 1px solid #222;
  overflow-y: auto;
  flex-shrink: 0;
}

.list-header {
  padding: 16px 18px;
  color: #888;
  font-size: 0.9em;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  border-bottom: 1px solid #222;
}

.season-item {
  padding: 16px 18px;
  cursor: pointer;
  font-size: 1.05em;
  border-left: 3px solid transparent;
  color: #888;
  transition: all 0.2s;
}

.season-item:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.season-item.active {
  background: var(--accent);
  color: white;
  border-left-color: white;
}

.season-item span {
  color: inherit;
  opacity: 0.7;
  margin-left: 8px;
  font-size: 0.9em;
}

.episodes-list {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
}

.no-episodes {
  text-align: center;
  padding: 40px;
  color: #666;
}

.episode-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px;
  background: #16161f;
  border-radius: 8px;
  margin-bottom: 8px;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all 0.2s;
}

.episode-item:hover {
  background: var(--bg-hover);
  border-color: var(--border-active);
}

.ep-number {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #222;
  border-radius: 8px;
  font-size: 18px;
  font-weight: 700;
}

.ep-info {
  flex: 1;
}

.ep-title {
  font-size: 1.05em;
  font-weight: 500;
}

.ep-duration {
  font-size: 0.9em;
  color: #888;
  margin-top: 4px;
}

.ep-play {
  font-size: 20px;
}

/* ==================== PLAYER ==================== */
.player-overlay {
  position: fixed;
  inset: 0;
  background: #000;
  z-index: 100;
}

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

.player-loading,
.player-error {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 100;
  pointer-events: none;
  background: rgba(0, 0, 0, 0.4);
  padding: 30px;
  border-radius: 20px;
  backdrop-filter: blur(4px);
}

.player-loading p,
.player-error p {
  margin-top: 16px;
}

/* Controls Overlay */
.player-controls-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.7) 0%, transparent 30%, transparent 70%, rgba(0, 0, 0, 0.9) 100%);
}

.player-controls-overlay>* {
  pointer-events: auto;
}

/* Top bar */
.player-top-bar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px 24px;
}

.player-back-btn {
  padding: 10px 16px;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  border-radius: 8px;
  color: #fff;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.2s;
}

.player-back-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}

.player-title {
  font-size: 18px;
  font-weight: 600;
  color: #fff;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

/* Bottom bar */
.player-bottom-bar {
  padding: 24px 40px 50px;
}

/* Progress bar */
.player-progress-container {
  height: 20px;
  display: flex;
  align-items: center;
  cursor: pointer;
  margin-bottom: 12px;
}

.player-progress-track {
  position: relative;
  width: 100%;
  height: 5px;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 3px;
  transition: height 0.2s;
}

.player-progress-container:hover .player-progress-track {
  height: 8px;
}

.player-progress-fill {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  background: linear-gradient(90deg, #8b5cf6, #a855f7);
  border-radius: 3px;
}

.player-progress-handle {
  position: absolute;
  top: 50%;
  width: 14px;
  height: 14px;
  background: #fff;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
  transition: transform 0.2s;
}

.player-progress-container:hover .player-progress-handle {
  transform: translate(-50%, -50%) scale(1.2);
}

/* Controls row */
.player-controls-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.player-controls-left,
.player-controls-right {
  display: flex;
  align-items: center;
  gap: 20px;
}

.player-control-btn {
  padding: 18px 28px;
  background: rgba(255, 255, 255, 0.15);
  border: 2px solid transparent;
  border-radius: 12px;
  color: #fff;
  font-size: 1.2em;
  cursor: pointer;
  transition: all 0.2s;
}

.player-control-btn:hover {
  background: rgba(255, 255, 255, 0.25);
  transform: scale(1.05);
}

.player-control-btn.focused {
  border-color: var(--accent);
  background: rgba(139, 92, 246, 0.4);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.5);
}

.player-play-btn {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: linear-gradient(135deg, #8b5cf6, #7c3aed);
  font-size: 1.8em;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 15px rgba(139, 92, 246, 0.5);
}

.player-play-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 20px rgba(139, 92, 246, 0.7);
}

.player-play-btn.focused {
  box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.6), 0 6px 20px rgba(139, 92, 246, 0.7);
}

.player-next-btn {
  background: rgba(139, 92, 246, 0.4);
  padding: 18px 28px;
}

.player-next-btn:hover {
  background: rgba(139, 92, 246, 0.6);
}

.player-next-btn.focused {
  background: rgba(139, 92, 246, 0.6);
  border-color: var(--accent);
}

.player-time {
  font-size: 1.1em;
  color: rgba(255, 255, 255, 0.9);
  font-variant-numeric: tabular-nums;
  margin-left: 16px;
}

/* Player EPG Banner */
.player-epg-banner {
  position: absolute;
  bottom: 100px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  z-index: 25;
  pointer-events: none;
}

.epg-banner-content {
  background: rgba(0, 0, 0, 0.8);
  padding: 12px 24px;
  border-radius: 30px;
  color: #fff;
  font-size: 1.2em;
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.1);
  max-width: 80%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: center;
}

/* Quality Badges */
.quality-badge {
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 0.75em;
  font-weight: bold;
  color: #fff;
  margin-right: 4px;
  display: inline-block;
}

.player-live-badge {
  padding: 6px 14px;
  background: #e50914;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
}

/* Old player-back - kept for compatibility */
.player-back {
  display: none;
}

/* ==================== EPG PAGE ==================== */
.epg-page,
.epg-page-with-sidebar {
  width: 100vw;
  height: 100vh;
  background: var(--bg-primary);
  display: flex;
  overflow: hidden;
}

.epg-sidebar {
  width: 250px;
  background: rgba(20, 20, 30, 0.95);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  z-index: 20;
}

.epg-sidebar-header {
  padding: 20px;
  font-size: 1.1em;
  font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 1px;
  border-bottom: 1px solid var(--border);
}

.epg-sidebar-list {
  flex: 1;
  overflow-y: auto;
  padding: 10px;
}

.epg-sidebar-item {
  padding: 14px 16px;
  border-radius: 8px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s;
  margin-bottom: 4px;
  font-size: 0.95em;
  border-left: 3px solid transparent;
}

.epg-sidebar-item:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.epg-sidebar-item.active {
  background: var(--bg-active);
  color: white;
  border-left-color: var(--accent);
}

.epg-sidebar-item.focused {
  background: var(--accent);
  color: white;
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.4);
}

.epg-main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}

.epg-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  gap: 20px;
}

.epg-header {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 20px 30px;
  background: linear-gradient(135deg, #1a1a2e, #16213e);
  border-bottom: 2px solid var(--accent);
}

.epg-header h1 {
  font-size: 1.5em;
  font-weight: 600;
}

.epg-channels {
  flex: 1;
  overflow-y: auto;
  padding: 20px 30px;
}

.epg-channel {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  background: var(--bg-card);
  border-radius: 12px;
  margin-bottom: 10px;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all 0.2s;
}

.epg-channel:hover,
.epg-channel.focused {
  background: var(--bg-active);
  border-color: var(--accent);
  box-shadow: var(--purple-glow);
}

.channel-logo {
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  overflow: hidden;
}

.channel-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.channel-logo span {
  font-size: 2em;
}

.channel-info {
  flex: 1;
}

.channel-name {
  font-size: 1.1em;
  font-weight: 600;
  margin-bottom: 4px;
}

.current-program {
  font-size: 0.9em;
  color: var(--accent);
}

.epg-programs {
  flex: 1;
  overflow-y: auto;
  padding: 20px 30px;
}

.epg-program {
  padding: 16px 20px;
  background: var(--bg-card);
  border-radius: 10px;
  margin-bottom: 10px;
  border-left: 4px solid var(--accent);
}

.program-time {
  font-size: 0.9em;
  color: var(--accent);
  margin-bottom: 6px;
}

.program-title {
  font-size: 1.1em;
  font-weight: 600;
  margin-bottom: 4px;
}

.program-desc {
  font-size: 0.9em;
  color: var(--text-secondary);
  line-height: 1.4;
}

.no-programs {
  text-align: center;
  padding: 40px;
  color: var(--text-secondary);
}

.epg-footer {
  padding: 16px 30px;
  background: rgba(0, 0, 0, 0.8);
  border-top: 1px solid var(--border);
  text-align: center;
  font-size: 0.9em;
  color: var(--text-secondary);
}

/* ==================== SPINNER ==================== */
.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

/* ==================== SCROLLBAR ==================== */
::-webkit-scrollbar {
  width: 6px;
}

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

::-webkit-scrollbar-thumb {
  background: rgba(139, 92, 246, 0.3);
  border-radius: 10px;
}

/* ==================== TV RESPONSIVE ==================== */
/* Full HD TVs (1920px) */
@media (min-width: 1920px) {
  html {
    font-size: 20px;
  }

  .main-sidebar {
    width: 280px;
  }

  .category-sidebar {
    width: 300px;
  }

  .content-grid {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 24px;
  }

  .nav-item {
    padding: 16px 18px;
  }

  .category-item {
    padding: 14px 16px;
  }
}

/* 4K TVs (3840px) */
@media (min-width: 3000px) {
  html {
    font-size: 28px;
  }

  .main-sidebar {
    width: 400px;
  }

  .category-sidebar {
    width: 420px;
  }

  .content-grid {
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 32px;
  }
}

/* Smaller screens */
@media (max-width: 1279px) {
  html {
    font-size: 16px;
  }

  .main-sidebar {
    width: 200px;
  }

  .category-sidebar {
    width: 200px;
  }

  .content-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 14px;
  }

  .seasons-list {
    width: 180px;
  }
}

/* ==================== FOCUS STYLES FOR REMOTE ==================== */
.focused {
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.6) !important;
  border-color: var(--accent) !important;
}

.form-input.focused {
  border-color: var(--accent) !important;
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.4) !important;
}

.btn-primary.focused {
  transform: scale(1.02);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.6), var(--purple-glow) !important;
}

.nav-item.focused {
  border-color: var(--accent) !important;
  box-shadow: 0 0 0 2px rgba(139, 92, 246, 0.4) !important;
}

.category-item.focused {
  background: var(--bg-active) !important;
  color: var(--text-primary) !important;
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.4) !important;
}

.content-card.focused {
  transform: scale(1.08) !important;
  border-color: var(--accent) !important;
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.6), var(--purple-glow) !important;
  z-index: 10;
}

.season-item.focused {
  background: var(--accent) !important;
  color: white !important;
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.4) !important;
}

.episode-item.focused {
  background: var(--accent) !important;
  color: white !important;
  border-color: var(--accent) !important;
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.4) !important;
}

.episode-item.focused .ep-number {
  background: rgba(255, 255, 255, 0.2);
}

/* ==================== NAVIGATION HELP ==================== */
.nav-help,
.login-help {
  padding: 10px;
  font-size: 11px;
  color: #666;
  text-align: center;
  border-top: 1px solid var(--border);
  margin-top: 12px;
}

.nav-help span,
.login-help span {
  color: #888;
}

.help-inline {
  color: #666;
  font-size: 12px;
}

.detail-footer,
.player-help {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 12px 24px;
  background: rgba(0, 0, 0, 0.9);
  border-top: 1px solid #222;
  font-size: 13px;
  color: #888;
  text-align: center;
}

.detail-footer span,
.player-help span {
  margin: 0 8px;
}

/* ==================== EPG ==================== */
.epg-page {
  display: flex;
  flex-direction: column;
  height: 100vh;
  background: var(--bg-primary);
}

.epg-header {
  display: flex;
  align-items: center;
  padding: 20px;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
}

.epg-header h1 {
  margin: 0;
  font-size: 2rem;
  color: var(--accent);
}

.back-btn {
  background: var(--accent);
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 1rem;
  margin-right: 20px;
}

.back-btn:hover {
  background: #a855f7;
}

.epg-channels {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
}

.epg-channel {
  display: flex;
  align-items: center;
  padding: 15px;
  margin-bottom: 10px;
  background: var(--bg-card);
  border-radius: 10px;
  border: 2px solid transparent;
  transition: all 0.2s;
}

.epg-channel.focused {
  border-color: var(--accent);
  box-shadow: var(--purple-glow);
}

.channel-logo {
  width: 60px;
  height: 60px;
  margin-right: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-secondary);
  border-radius: 8px;
}

.channel-logo img {
  max-width: 100%;
  max-height: 100%;
  border-radius: 8px;
}

.channel-info {
  flex: 1;
}

.channel-name {
  font-size: 1.2rem;
  font-weight: bold;
  margin-bottom: 5px;
}

.current-program {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.epg-programs {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
}

.epg-program {
  display: flex;
  padding: 15px;
  margin-bottom: 10px;
  background: var(--bg-card);
  border-radius: 10px;
  border-left: 4px solid var(--accent);
}

.program-time {
  font-weight: bold;
  margin-right: 15px;
  min-width: 80px;
}

.program-title {
  font-size: 1.1rem;
  margin-bottom: 5px;
}

.program-desc {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.no-programs {
  text-align: center;
  padding: 40px;
  color: var(--text-secondary);
}

/* ==================== EPG COMPONENT (Split View) ==================== */
.epg-container {
  display: flex;
  height: 100vh;
  width: 100vw;
  background: var(--bg-primary);
  overflow: hidden;
}

/* Left Sidebar: Channels List */
.epg-channels-sidebar {
  width: 30%;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  background: var(--bg-secondary);
}

.epg-channels-header {
  padding: 20px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: bold;
  font-size: 1.1em;
}

.epg-channels-list {
  flex: 1;
  overflow-y: auto;
  padding: 10px 0;
}

.epg-channel-item {
  display: flex;
  align-items: center;
  padding: 15px 20px;
  border-left: 4px solid transparent;
  cursor: pointer;
  transition: all 0.2s;
}

.epg-channel-item.focused {
  background: var(--bg-active);
  border-left-color: var(--accent);
}

.epg-channel-item.active {
  background: rgba(255, 255, 255, 0.05);
  /* Dimmed active state */
}

.epg-channel-logo {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 15px;
  overflow: hidden;
}

.epg-channel-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.epg-channel-info {
  flex: 1;
}

.epg-channel-name {
  font-weight: 600;
  font-size: 1rem;
  color: var(--text-primary);
}

/* Right Panel: Programs */
.epg-programs-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: var(--bg-primary);
}

.epg-programs-header {
  padding: 20px 30px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  z-index: 10;
}

.epg-program-list {
  flex: 1;
  overflow-y: auto;
  padding: 20px 30px;
}

.epg-program-item {
  background: var(--bg-card);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 15px;
  border: 2px solid transparent;
  display: flex;
  gap: 20px;
  transition: all 0.2s;
}

.epg-program-item.focused {
  border-color: var(--accent);
  background: var(--bg-active);
  transform: scale(1.02);
  box-shadow: 0 4px 20px rgba(114, 9, 183, 0.3);
}

.epg-program-item.live {
  border-left: 4px solid #ef233c;
  /* Red indicator for live */
}

.epg-time {
  font-size: 1.1em;
  font-weight: bold;
  color: var(--accent);
  min-width: 80px;
}

.epg-details {
  flex: 1;
}

.epg-title {
  font-size: 1.2em;
  font-weight: bold;
  margin-bottom: 8px;
  color: var(--text-primary);
}

.epg-desc {
  font-size: 0.95em;
  color: var(--text-secondary);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.epg-program-item.focused .epg-desc {
  -webkit-line-clamp: 4;
  /* Expand on focus */
}

.epg-help {
  padding: 15px;
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.9rem;
  border-top: 1px solid var(--border);
}

/* Loading State for EPG */
.epg-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100vh;
  width: 100%;
}

.epg-loading p {
  margin-top: 20px;
  color: var(--text-secondary);
  font-size: 1.2em;
}

/* ==================== TOAST NOTIFICATION ==================== */
.toast-notification {
  position: fixed;
  bottom: 60px;
  left: 50%;
  transform: translateX(-50%);
  padding: 16px 32px;
  background: rgba(0, 0, 0, 0.9);
  border: 1px solid var(--accent);
  border-radius: 12px;
  color: #fff;
  font-size: 1.1em;
  z-index: 9999;
  animation: toastIn 0.3s ease-out;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

/* ==================== LOADING OVERLAY ==================== */
.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 9998;
  gap: 20px;
}

.loading-overlay p {
  color: #fff;
  font-size: 1.2em;
}

/* ==================== SETTINGS PAGE ==================== */
.settings-page {
  flex: 1;
  padding: 40px;
  overflow-y: auto;
  background: var(--bg-secondary);
}

.settings-page h1 {
  font-size: 2em;
  margin-bottom: 30px;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 15px;
}

.settings-section {
  background: var(--bg-card);
  border-radius: 16px;
  padding: 24px;
  margin-bottom: 24px;
  border: 1px solid var(--border);
}

.settings-section h2 {
  font-size: 1.2em;
  margin-bottom: 20px;
  color: var(--accent);
  border-bottom: 1px solid var(--border);
  padding-bottom: 10px;
}

.settings-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 12px;
  margin-bottom: 12px;
  border: 2px solid transparent;
  transition: all 0.2s;
}

.settings-item:last-child {
  margin-bottom: 0;
}

.settings-item.focused {
  background: var(--bg-active);
  border-color: var(--accent);
  transform: translateX(10px);
  box-shadow: var(--purple-glow);
}

.settings-label {
  font-size: 1.1em;
  color: var(--text-secondary);
}

.settings-item.focused .settings-label {
  color: var(--text-primary);
}

.settings-value {
  font-size: 1.1em;
  font-weight: 600;
  color: var(--text-primary);
}

.settings-action-btn {
  width: 100%;
  padding: 16px;
  border-radius: 12px;
  font-size: 1.1em;
  font-weight: 600;
  cursor: pointer;
  border: 2px solid transparent;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
  text-align: left;
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.settings-action-btn.focused {
  background: var(--bg-active);
  border-color: var(--accent);
  box-shadow: var(--purple-glow);
}

.settings-action-btn.logout-btn {
  color: #ef4444;
  background: rgba(239, 68, 68, 0.1);
}


/* ==================== EPG PAGE (SKY STYLE) ==================== */
.epg-container {
  display: flex;
  height: 100vh;
  padding: 0;
  overflow: hidden;
  background: var(--bg-primary);
}

.epg-channels-sidebar {
  width: 35%;
  background: var(--bg-secondary);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
}

.epg-channels-header {
  padding: 20px;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  font-weight: bold;
  font-size: 1.2em;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.epg-channels-list {
  flex: 1;
  overflow-y: auto;
  padding: 10px;
}

.epg-channel-item {
  display: flex;
  align-items: center;
  padding: 15px;
  border-radius: 12px;
  margin-bottom: 8px;
  transition: all 0.2s;
  border: 2px solid transparent;
}

.epg-channel-item.focused {
  background: var(--bg-active);
  border-color: var(--accent);
  box-shadow: var(--purple-glow);
}

.epg-channel-logo {
  width: 50px;
  height: 50px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 15px;
}

.epg-channel-logo img {
  max-width: 40px;
  max-height: 40px;
}

.epg-channel-info {
  flex: 1;
}

.epg-channel-name {
  font-weight: bold;
  font-size: 1.1em;
}

.epg-programs-panel {
  flex: 1;
  background: var(--bg-primary);
  display: flex;
  flex-direction: column;
  padding: 0;
  /* Padding inside list */
}

.epg-programs-header {
  padding: 20px 30px;
  background: rgba(0, 0, 0, 0.2);
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.epg-program-list {
  flex: 1;
  overflow-y: auto;
  padding: 20px 30px;
}

.epg-program-item {
  padding: 20px;
  background: var(--bg-card);
  border-radius: 12px;
  margin-bottom: 15px;
  border-left: 4px solid transparent;
  display: flex;
  gap: 20px;
  transition: all 0.2s;
  border: 2px solid transparent;
  /* Prepare for focus border */
}

.epg-program-item.current {
  background: linear-gradient(90deg, rgba(139, 92, 246, 0.1), var(--bg-card));
  border-left-color: var(--accent);
}

.epg-program-item.focused {
  transform: scale(1.02);
  border-color: var(--accent);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  z-index: 10;
  background: var(--bg-active);
}

.epg-time {
  font-size: 1.2em;
  font-weight: bold;
  color: var(--accent);
  min-width: 100px;
}

.epg-details {
  flex: 1;
}

.epg-title {
  font-size: 1.3em;
  font-weight: bold;
  margin-bottom: 8px;
}

.epg-desc {
  color: var(--text-secondary);
  font-size: 1em;
  display: -webkit-box;
  line-clamp: 2;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.epg-help {
  padding: 15px;
  text-align: center;
  color: var(--text-secondary);
  border-top: 1px solid var(--border);
  background: var(--bg-secondary);
}

/* ====================
   SIDEBAR AUTO-HIDE
   ==================== */
.app-layout {
  transition: all 0.1s ease;
}

.main-sidebar {
  transition: width 0.1s ease, padding 0.1s ease;
  width: 280px;
  /* Ensure fixed width for transition */
  opacity: 1;
  transform: translateX(0);
}

.app-layout.sidebar-hidden .main-sidebar {
  width: 80px;
  /* Show icons */
  padding: 0;
  opacity: 1;
  transform: translateX(0);
}

.app-layout.sidebar-hidden .nav-label,
.app-layout.sidebar-hidden .nav-help,
.app-layout.sidebar-hidden .logo-text {
  opacity: 0;
  width: 0;
  overflow: hidden;
  display: none;
}

.app-layout.sidebar-hidden .sidebar-header {
  padding: 20px 0;
  justify-content: center;
}

.app-layout.sidebar-hidden .logo-icon {
  margin-right: 0;
  font-size: 2rem;
}

.app-layout.sidebar-hidden .nav-item {
  justify-content: center;
  padding: 0;
}

.app-layout.sidebar-hidden .nav-icon {
  margin-right: 0;
  font-size: 1.5rem;
}

/* ====================
   CENTRALIZED LOADING
   ==================== */
.loading-overlay-central {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(10, 10, 15, 0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  animation: fadeIn 0.3s ease;
}

.loading-content {
  text-align: center;
}

.loading-spinner-large {
  width: 60px;
  height: 60px;
  border: 4px solid rgba(139, 92, 246, 0.3);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 20px;
}

.loading-message {
  font-size: 1.2rem;
  color: var(--text-primary);
  margin-bottom: 10px;
  font-weight: 500;
}

.loading-progress-bar {
  width: 300px;
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  overflow: hidden;
  margin: 0 auto;
}

.loading-progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 3px;
  transition: width 0.3s ease;
}

.loading-percentage {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-top: 8px;
}

/* ==================== EPG CARD STYLES ==================== */
.card-epg {
  font-size: 0.75em;
  color: var(--text-secondary);
  margin-top: 4px;
  line-height: 1.3;
  max-height: 3.2em;
  overflow: hidden;
}

.card-epg .epg-time {
  color: var(--accent);
  font-weight: 500;
  font-size: 0.9em;
}

.card-epg .epg-title {
  color: var(--text-secondary);
  word-wrap: break-word;
}

.card-epg.no-epg {
  opacity: 0.6;
}

.epg-no-data {
  font-style: italic;
  color: var(--text-secondary);
  font-size: 0.85em;
}

/* New detailed EPG card styles - Agora + A Seguir format */
.card-epg-detailed {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 6px;
  padding: 6px 8px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 6px;
  border-left: 3px solid var(--accent);
}

.card-epg-now,
.card-epg-next {
  font-size: 0.75em;
  line-height: 1.3;
}

.epg-now-badge {
  color: #ef4444;
  font-weight: 600;
  font-size: 0.9em;
  display: block;
  margin-bottom: 2px;
}

.epg-next-badge {
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 0.85em;
  display: block;
  margin-bottom: 2px;
}

.epg-now-title,
.epg-next-title {
  color: var(--text-primary);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.epg-next-title {
  color: var(--text-secondary);
  font-weight: 400;
}

.epg-now-time,
.epg-next-time {
  color: var(--accent);
  font-size: 0.9em;
  font-weight: 500;
}

.epg-progress-bar {
  width: 100%;
  height: 3px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
  margin-top: 4px;
  overflow: hidden;
}

.epg-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), #a855f7);
  border-radius: 2px;
  transition: width 0.5s ease;
}

/* ==================== EPG CARD GRID (NEW) ==================== */
.epg-card-grid {
  display: grid;
  /* Responsive grid that fits within screen - min 200px, max 1fr */
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
  padding: 20px 30px;
  overflow-y: auto;
  overflow-x: hidden;
  flex: 1;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.epg-card {
  background: var(--bg-card);
  border-radius: 16px;
  padding: 20px;
  border: 2px solid transparent;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.epg-card:hover {
  background: var(--bg-hover);
}

.epg-card.focused {
  border-color: var(--accent);
  box-shadow: var(--purple-glow);
  transform: scale(1.02);
  background: var(--bg-active);
}

.epg-card-header {
  display: flex;
  align-items: center;
  gap: 15px;
}

.epg-card-logo {
  width: 50px;
  height: 50px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}

.epg-card-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.epg-card-logo span {
  font-size: 1.5em;
}

.epg-card-info {
  flex: 1;
  min-width: 0;
}

.epg-card-name {
  font-size: 1.1em;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.epg-card-category {
  font-size: 0.85em;
  color: var(--text-secondary);
  margin-top: 2px;
}

.epg-card-now {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 8px;
  padding: 12px;
}

.epg-card-now.no-data {
  opacity: 0.6;
}

.epg-now-badge {
  color: #ef233c;
  font-weight: 600;
  font-size: 0.85em;
  display: block;
  margin-bottom: 6px;
}

.epg-program-title {
  font-size: 1em;
  font-weight: 500;
  color: var(--text-primary);
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.epg-program-time {
  font-size: 0.85em;
  color: var(--accent);
  margin-top: 4px;
}

.epg-card-next {
  background: rgba(0, 0, 0, 0.15);
  border-radius: 8px;
  padding: 10px 12px;
  border-left: 3px solid var(--border);
}

.epg-next-badge {
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 0.8em;
  display: block;
  margin-bottom: 4px;
}

.epg-next-title {
  font-size: 0.9em;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.epg-next-time {
  font-size: 0.8em;
  color: var(--text-secondary);
  opacity: 0.7;
  margin-top: 2px;
}

.epg-card-hint {
  font-size: 0.85em;
  color: var(--accent);
  text-align: center;
  padding-top: 8px;
  border-top: 1px solid var(--border);
  font-weight: 500;
}

.epg-footer {
  padding: 16px 30px;
  background: rgba(0, 0, 0, 0.5);
  text-align: center;
  font-size: 0.9em;
  color: var(--text-secondary);
  border-top: 1px solid var(--border);
}

/* EPG Card Name - Prevent Truncation */
.epg-card-name {
  white-space: normal !important;
  overflow: visible !important;
  text-overflow: clip !important;
  word-wrap: break-word;
  height: auto !important;
  line-height: 1.2;
  margin-bottom: 5px;
  font-size: 14px;
  font-weight: bold;
}

/* ==================== NEW EPG LAYOUT (SIDEBAR + GRID) ==================== */
.epg-page-with-sidebar {
  display: flex;
  height: 100vh;
  width: 100vw;
  background: var(--bg-primary);
  overflow: hidden;
}

.epg-sidebar {
  width: 280px;
  background: var(--bg-secondary);
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--border);
  z-index: 10;
}

.epg-sidebar-header {
  padding: 20px;
  font-weight: bold;
  font-size: 1.2rem;
  border-bottom: 1px solid var(--border);
  color: var(--text-primary);
}

.epg-sidebar-list {
  flex: 1;
  overflow-y: auto;
  padding: 10px;
}

.epg-sidebar-item {
  padding: 15px;
  border-radius: 10px;
  margin-bottom: 8px;
  cursor: pointer;
  transition: all 0.2s;
  color: var(--text-secondary);
  font-size: 1.05rem;
  border: 2px solid transparent;
}

.epg-sidebar-item:hover {
  background: rgba(255, 255, 255, 0.05);
}

.epg-sidebar-item.focused {
  background: var(--bg-active);
  color: var(--text-primary);
  border-color: var(--accent);
  box-shadow: var(--purple-glow);
  transform: translateX(5px);
}

.epg-sidebar-item.active {
  color: var(--accent);
  font-weight: bold;
  background: rgba(139, 92, 246, 0.1);
}

.epg-main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--bg-primary);
  position: relative;
}

.epg-header {
  padding: 20px 30px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(10, 10, 20, 0.95);
  backdrop-filter: blur(10px);
  z-index: 5;
}

.epg-header h1 {
  font-size: 1.5rem;
  margin: 0;
  color: var(--text-primary);
}

/* Ensure settings page covers full screen and scrolls */
.settings-page {
  height: 100vh;
  width: 100vw;
  box-sizing: border-box;
  overflow-y: auto;
  padding-bottom: 80px;
  /* Space for bottom content if needed */
}

/* ===========================
   Home Page
   =========================== */
.home-page {
  flex: 1;
  overflow-y: auto;
  padding: 40px;
  background: var(--bg-primary);
}

.home-featured-loading,
.home-section-loading {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 60px 20px;
}

.home-featured {
  margin-bottom: 60px;
}

.home-featured-banner {
  width: 100%;
  min-height: 500px;
  background: var(--bg-secondary);
  border-radius: 20px;
  overflow: hidden;
  background-size: cover;
  background-position: center;
  position: relative;
}

.home-featured-content {
  display: flex;
  align-items: center;
  gap: 40px;
  padding: 60px;
  height: 100%;
  min-height: 500px;
}

.home-featured-poster {
  flex-shrink: 0;
  width: 300px;
  height: 450px;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
}

.home-featured-poster img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.home-featured-info {
  flex: 1;
  max-width: 700px;
}

.home-featured-title {
  font-size: 3em;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 20px;
  line-height: 1.2;
}

.home-featured-meta {
  display: flex;
  gap: 20px;
  margin-bottom: 20px;
  align-items: center;
}

.home-featured-year,
.home-featured-rating {
  font-size: 1.2em;
  color: var(--text-secondary);
}

.home-featured-rating {
  color: #fbbf24;
}

.home-featured-genre {
  font-size: 1.1em;
  color: var(--accent);
  margin-bottom: 20px;
}

.home-featured-plot {
  font-size: 1.1em;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 30px;
}

.home-featured-buttons {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}

.home-featured-play-btn,
.home-featured-favorite-btn {
  padding: 16px 32px;
  border-radius: 12px;
  font-size: 1.1em;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
}

.home-featured-play-btn {
  background: var(--accent);
  color: white;
}

.home-featured-play-btn:hover,
.home-featured-play-btn.focused {
  background: linear-gradient(135deg, #9333ea, #a855f7);
  box-shadow: 0 0 30px rgba(139, 92, 246, 0.6);
  transform: scale(1.03);
}

.home-featured-favorite-btn {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
  border: 2px solid var(--border);
}

.home-featured-favorite-btn:hover,
.home-featured-favorite-btn.focused {
  background: rgba(255, 255, 255, 0.15);
  border-color: var(--accent);
  box-shadow: 0 0 20px rgba(139, 92, 246, 0.4);
}

.home-streaming-section {
  margin-bottom: 60px;
}

.home-section {
  margin-bottom: 60px;
}

.home-section-title {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 1.8em;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 30px;
}

.home-section-icon {
  font-size: 1.2em;
}

.home-streaming-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  max-width: 90%;
  margin: 0 auto;
  justify-content: flex-start;
}

.home-streaming-button {
  padding: 20px 38px;
  border-radius: 12px;
  font-size: 1.15em;
  font-weight: 600;
  cursor: pointer;
  background: var(--bg-card);
  border: 2px solid var(--border);
  transition: all 0.2s;
  min-width: 170px;
  flex: 0 1 auto;
  text-align: center;
}

.home-streaming-button:hover,
.home-streaming-button.focused {
  background: var(--bg-hover);
  border-color: var(--accent);
  box-shadow: 0 0 20px rgba(139, 92, 246, 0.4);
  transform: translateY(-2px);
}

.home-content-grid {
  display: flex;
  gap: 24px;
  overflow-x: auto;
  padding-bottom: 20px;
  scrollbar-width: thin;
  scrollbar-color: var(--accent) var(--bg-secondary);
}

.home-content-grid::-webkit-scrollbar {
  height: 8px;
}

.home-content-grid::-webkit-scrollbar-track {
  background: var(--bg-secondary);
  border-radius: 4px;
}

.home-content-grid::-webkit-scrollbar-thumb {
  background: var(--accent);
  border-radius: 4px;
}

.home-content-card {
  flex-shrink: 0;
  width: 200px;
  cursor: pointer;
  transition: all 0.2s;
  border-radius: 12px;
  overflow: hidden;
  background: var(--bg-card);
}

.home-content-card:hover,
.home-content-card.focused {
  transform: scale(1.02);
  box-shadow: 0 4px 12px rgba(139, 92, 246, 0.2);
}

.home-content-card-poster {
  width: 100%;
  height: 300px;
  background: var(--bg-secondary);
  overflow: hidden;
}

.home-content-card-poster img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.home-content-card-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 60px;
  background: var(--bg-secondary);
}

.home-content-card-info {
  padding: 16px;
}

.home-content-card-title {
  font-size: 1em;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.home-content-card-year {
  font-size: 0.9em;
  color: var(--text-secondary);
}

/* Home Page Focus Styles */
.home-featured-play-btn.focused,
.home-featured-favorite-btn.focused {
  outline: 3px solid var(--accent);
  box-shadow: 0 0 20px rgba(139, 92, 246, 0.6);
  transform: scale(1.05);
}

.home-streaming-button.focused {
  outline: 3px solid var(--accent);
  box-shadow: 0 0 20px rgba(139, 92, 246, 0.6);
  transform: translateY(-4px);
  border-color: var(--accent);
}

.home-content-card.focused {
  transform: scale(1.08);
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.6), var(--purple-glow);
  z-index: 10;
}

/* Continue Assistindo Cards */
.continue-watching-card {
  position: relative;
}

.continue-watching-card .home-content-card-poster {
  position: relative;
}

.continue-watching-progress-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 8px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.continue-watching-progress-bar {
  width: 100%;
  height: 4px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 2px;
  overflow: hidden;
}

.continue-watching-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), #a855f7);
  border-radius: 2px;
  transition: width 0.3s ease;
}

.continue-watching-progress-text {
  font-size: 0.75em;
  color: #fff;
  font-weight: 600;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}

/* ===========================
   Preview Modal (Video + EPG)
   =========================== */
.preview-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  backdrop-filter: blur(6px);
}

.preview-modal {
  width: 82vw;
  max-width: 1100px;
  max-height: 90vh;
  background: #0f121b;
  border-radius: 16px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
}

.preview-video-wrap {
  position: relative;
  width: 100%;
  padding-top: 56.25%;
  background: #000;
}

.preview-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.preview-video-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 16px;
  pointer-events: none;
}

.preview-live-badge {
  background: #e11d48;
  color: #fff;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.preview-logo-overlay {
  width: 72px;
  height: 72px;
  object-fit: contain;
  background: rgba(0, 0, 0, 0.45);
  border-radius: 12px;
  padding: 6px;
}

.preview-loading,
.preview-error {
  position: absolute;
  left: 16px;
  bottom: 16px;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  font-size: 12px;
  padding: 6px 10px;
  border-radius: 8px;
}

.preview-info {
  padding: 16px 20px 0 20px;
}

.preview-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.preview-title {
  font-size: 28px;
  font-weight: 700;
  color: #fff;
}

.preview-badges {
  display: flex;
  gap: 8px;
}

.preview-badge {
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 16px;
  font-weight: 600;
  color: #93c5fd;
  border: 1px solid rgba(59, 130, 246, 0.4);
  background: rgba(59, 130, 246, 0.18);
}

.preview-category {
  color: #9aa3b2;
  font-size: 18px;
  margin-top: 6px;
}

.preview-epg {
  display: flex;
  gap: 16px;
  padding: 16px 20px 0 20px;
  flex-wrap: wrap;
}

.preview-epg-now {
  flex: 1 1 280px;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.35);
  border-radius: 12px;
  padding: 12px;
}

.preview-epg-upcoming {
  flex: 2 1 360px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 12px;
  padding: 12px;
}

.preview-epg-label {
  font-size: 16px;
  color: #9ad2b4;
  font-weight: 600;
  text-transform: uppercase;
}

.preview-epg-title {
  font-size: 22px;
  color: #fff;
  font-weight: 600;
  margin-top: 8px;
}

.preview-epg-time {
  font-size: 18px;
  color: #9aa3b2;
  margin-top: 6px;
}

.preview-epg-progress {
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  margin-top: 8px;
  overflow: hidden;
}

.preview-epg-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #10b981, #22c55e);
  width: 0%;
}

.preview-epg-list {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-top: 6px;
}

.preview-epg-card {
  min-width: 140px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 10px;
  padding: 10px;
}

.preview-epg-card-time {
  font-size: 16px;
  color: #60a5fa;
  font-weight: 600;
}

.preview-epg-card-title {
  font-size: 18px;
  color: #e5e7eb;
  margin-top: 6px;
}

.preview-epg-empty {
  font-size: 18px;
  color: #94a3b8;
  margin-top: 8px;
}

.preview-actions {
  display: flex;
  gap: 12px;
  padding: 16px 20px 20px 20px;
}

.preview-btn {
  flex: 1;
  padding: 16px;
  border-radius: 10px;
  font-size: 20px;
  font-weight: 600;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  color: #fff;
  cursor: pointer;
}

.preview-btn.primary {
  background: linear-gradient(90deg, #22d3ee, #3b82f6);
  color: #0b1220;
  border: none;
}

.preview-btn.focused {
  outline: 2px solid #fff;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.4);
}

.preview-btn.focused {
  outline: 2px solid #fff;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.4);
}

/* ==================== PREVIEW FULLSCREEN MODE ==================== */
.preview-modal-backdrop.preview-fullscreen {
  background: #000;
}

.preview-modal-backdrop.preview-fullscreen .preview-modal {
  width: 100vw;
  height: 100vh;
  max-width: none;
  max-height: none;
  border-radius: 0;
  background: #000;
}

.preview-modal-backdrop.preview-fullscreen .preview-video-wrap {
  width: 100vw;
  height: 100vh;
  aspect-ratio: auto;
}

.preview-modal-backdrop.preview-fullscreen .preview-video {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.preview-modal-backdrop.preview-fullscreen .preview-info,
.preview-modal-backdrop.preview-fullscreen .preview-epg,
.preview-modal-backdrop.preview-fullscreen .preview-actions {
  display: none;
}

.preview-modal-backdrop.preview-fullscreen .preview-video-overlay {
  opacity: 0;
  transition: opacity 0.3s;
}

.preview-modal-backdrop.preview-fullscreen:hover .preview-video-overlay,
.preview-modal-backdrop.preview-fullscreen:focus-within .preview-video-overlay {
  opacity: 1;
}

.fullscreen-exit-hint {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 16px;
  opacity: 0.8;
  animation: hint-fade 4s ease-in-out forwards;
}

@keyframes hint-fade {
  0% {
    opacity: 0.9;
  }

  70% {
    opacity: 0.9;
  }

  100% {
    opacity: 0;
  }
}

/* ==================== FAVORITES BUTTON ==================== */
.favorite-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 28px;
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
  background: linear-gradient(135deg, var(--bg-card), var(--bg-secondary));
  border: 2px solid var(--border);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.25s ease;
  margin-top: 16px;
  outline: none;
}

.favorite-btn:hover,
.favorite-btn:focus,
.favorite-btn.focused {
  background: linear-gradient(135deg, #e11d48, #f43f5e);
  border-color: #f43f5e;
  box-shadow: 0 0 25px rgba(244, 63, 94, 0.5);
  transform: scale(1.03);
  color: #fff;
}

.favorite-btn:active {
  transform: scale(0.97);
}

/* Search Input Improvements */
.search-input {
  width: 100%;
  padding: 18px 22px;
  font-size: 24px;
  border: 2px solid var(--border);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
  outline: none;
  transition: all 0.2s ease;
  caret-color: var(--accent);
}

.search-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.25);
  background: rgba(255, 255, 255, 0.12);
}

.search-input::placeholder {
  color: var(--text-secondary);
  opacity: 0.7;
}

.search-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 12px;
}

.search-btn {
  padding: 12px 20px;
  font-size: 16px;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(135deg, var(--accent), #7c3aed);
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.search-btn:hover,
.search-btn:focus,
.search-btn.focused {
  transform: scale(1.02);
  box-shadow: var(--purple-glow);
}

.search-btn:disabled,
.search-btn.loading {
  opacity: 0.6;
  cursor: wait;
}

.spinner-small {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* Detail Page Buttons */
.detail-buttons {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 20px;
}

.play-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 16px 32px;
  font-size: 20px;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(135deg, var(--accent), #7c3aed);
  border: 2px solid transparent;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.25s ease;
  outline: none;
}

.play-btn:hover,
.play-btn:focus,
.play-btn.focused {
  background: linear-gradient(135deg, #9333ea, #a855f7);
  box-shadow: 0 0 30px rgba(139, 92, 246, 0.6);
  transform: scale(1.03);
}

.play-btn:active {
  transform: scale(0.97);
}

/* FIX: Category Item Focused State */
.category-item.focused {
  background: rgba(139, 92, 246, 0.4);
  color: var(--text-primary);
  border-left-color: var(--border-active);
}

/* Ensure active+focused is distinct */
.category-item.active.focused {
  background: var(--accent);
  color: #fff;
  border-left-color: #fff;
  box-shadow: 0 0 15px rgba(139, 92, 246, 0.5);
}

/* ==================== PLATFORM CONTENT PAGE ==================== */
.platform-content-page {
  width: 100vw;
  height: 100vh;
  display: flex;
  flex-direction: column;
  background: linear-gradient(135deg, #0a0a0f, #1a1a2e, #16213e);
  overflow: hidden;
}

.platform-header {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 20px 32px;
  background: rgba(20, 20, 30, 0.95);
  border-bottom: 2px solid var(--accent);
  flex-shrink: 0;
}

.platform-back {
  padding: 12px 24px;
  background: rgba(139, 92, 246, 0.2);
  border: 2px solid rgba(139, 92, 246, 0.4);
  border-radius: 10px;
  color: var(--text-primary);
  font-size: 1em;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.platform-back:hover,
.platform-back.focused {
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: var(--purple-glow);
}

.platform-title {
  flex: 1;
  font-size: 1.5em;
  font-weight: 700;
  color: var(--text-primary);
}

.platform-count {
  font-size: 1em;
  color: var(--accent);
  font-weight: 500;
}

.platform-content-page .content-grid,
.platform-content-grid {
  flex: 1;
  overflow-y: auto;
  padding: 16px 24px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
  align-content: start;
  width: 100%;
  padding-bottom: 40px;
}

/* Responsive platform grid for larger screens */
@media (min-width: 1920px) {

  .platform-content-page .content-grid,
  .platform-content-grid {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 24px;
  }
}

@media (min-width: 3000px) {

  .platform-content-page .content-grid,
  .platform-content-grid {
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 32px;
  }
}

.platform-content-page .content-card.focused {
  transform: scale(1.02);
  border-color: var(--accent);
  box-shadow: var(--purple-glow);
  z-index: 2;
}

/* CRITICAL: Force fixed aspect ratio on platform pages - ignore flex context */
.platform-content-page .card-image-wrapper,
.platform-content-grid .card-image-wrapper {
  width: 100% !important;
  height: 270px !important;
  /* Fixed height - 2:3 ratio at 180px width */
  min-height: 270px !important;
  /* Extra force */
  max-height: 270px !important;
  /* Extra force */
  padding-bottom: 0 !important;
  /* Remove % padding that breaks in flex */
  padding-top: 0 !important;
  position: relative !important;
  overflow: hidden !important;
  background: var(--bg-secondary) !important;
  display: block !important;
  flex: none !important;
  /* Prevent flex from shrinking */
}

.platform-content-page .card-image,
.platform-content-grid .card-image {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
}

/* Responsive heights for different screen sizes */
@media (min-width: 1920px) {

  .platform-content-page .card-image-wrapper,
  .platform-content-grid .card-image-wrapper {
    height: 300px !important;
    /* 2:3 ratio at 200px min width */
    min-height: 300px !important;
    max-height: 300px !important;
  }
}

@media (min-width: 3000px) {

  .platform-content-page .card-image-wrapper,
  .platform-content-grid .card-image-wrapper {
    height: 450px !important;
    /* 2:3 ratio at 300px min width */
    min-height: 450px !important;
    max-height: 450px !important;
  }
}

@media (max-width: 1279px) {

  .platform-content-page .card-image-wrapper,
  .platform-content-grid .card-image-wrapper {
    height: 210px !important;
    /* 2:3 ratio at 140px min width */
    min-height: 210px !important;
    max-height: 210px !important;
  }
}

/* Smaller screens for platform pages - match normal content pages */
@media (max-width: 1279px) {

  .platform-content-page .content-grid,
  .platform-content-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 14px;
  }
}

.platform-content-page .card-title {
  padding: 10px;
  font-size: 0.85em;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text-primary);
}

.platform-help {
  padding: 14px 32px;
  text-align: center;
  background: rgba(20, 20, 30, 0.98);
  border-top: 2px solid var(--accent);
  color: var(--text-secondary);
  font-size: 0.9em;
  flex-shrink: 0;
}

.platform-content-page .content-loading,
.platform-content-page .content-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  color: var(--text-secondary);
}