/* ==========================================================================
   OurTV+ Lite • Ultra-Fast Xbox Series S Edition Stylesheet
   Pure Black OLED Theme • Zero Blur • High-Performance Hardware Acceleration
   ========================================================================== */

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

body {
  background: #000000;
  color: #ffffff;
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  overflow-x: hidden;
  overflow-y: auto;
  min-height: 100vh;
}

/* ==========================================================================
   TOP NAVIGATION & SEARCH BAR
   ========================================================================== */
.top-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: #0a0a0a;
  border-bottom: 2px solid #1f1f1f;
  padding: 14px 28px;
  display: flex;
  align-items: center;
  gap: 20px;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.brand-logo {
  width: 36px;
  height: 36px;
  border-radius: 8px;
}

.brand-title {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.brand-tag {
  background: #107c10;
  color: #ffffff;
  font-size: 11px;
  font-weight: 900;
  padding: 2px 7px;
  border-radius: 4px;
  margin-left: 4px;
}

/* Search Bar (Prominent & Center Stage) */
.search-container {
  flex: 1;
  max-width: 650px;
  position: relative;
  display: flex;
  align-items: center;
}

.search-input {
  width: 100%;
  height: 48px;
  background: #181818;
  border: 2px solid #2a2a2a;
  border-radius: 8px;
  color: #ffffff;
  font-size: 18px;
  font-weight: 600;
  padding: 0 46px 0 16px;
  outline: none;
  transition: border-color 0.15s, background 0.15s;
}

.search-input:focus,
.search-input.focused {
  border-color: #107c10;
  background: #202020;
  box-shadow: 0 0 0 3px rgba(16, 124, 16, 0.4);
}

.btn-clear {
  position: absolute;
  right: 12px;
  background: #333333;
  color: #aaaaaa;
  border: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-clear:focus,
.btn-clear.focused {
  background: #e50914;
  color: #ffffff;
  outline: 2px solid #ffffff;
}

/* Category Filter Tabs */
.filter-tabs {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.tab-btn {
  background: #181818;
  border: 2px solid #2a2a2a;
  color: #cccccc;
  font-size: 15px;
  font-weight: 700;
  padding: 10px 18px;
  border-radius: 8px;
  cursor: pointer;
  outline: none;
}

.tab-btn.active {
  background: #107c10;
  border-color: #107c10;
  color: #ffffff;
}

.tab-btn:focus,
.tab-btn.focused {
  border-color: #ffffff;
  outline: 3px solid #107c10;
  outline-offset: 2px;
  transform: scale(1.04);
}

/* ==========================================================================
   STATUS & CONTROLLER HINTS
   ========================================================================== */
.status-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 28px;
  color: #888888;
  font-size: 14px;
  font-weight: 600;
  border-bottom: 1px solid #141414;
}

.results-count {
  color: #107c10;
  font-weight: 700;
}

.controller-hint {
  font-size: 13px;
  color: #999999;
}

.controller-hint strong {
  color: #ffffff;
}

/* ==========================================================================
   MEDIA GRID
   ========================================================================== */
.grid-container {
  padding: 20px 28px 60px;
}

.media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 16px;
  content-visibility: auto;
}

.media-card {
  position: relative;
  background: #141414;
  border-radius: 8px;
  overflow: hidden;
  border: 2px solid transparent;
  cursor: pointer;
  outline: none;
  display: flex;
  flex-direction: column;
}

.media-card:focus,
.media-card.focused {
  outline: 4px solid #107c10 !important;
  outline-offset: 2px !important;
  border-color: #ffffff;
  transform: scale3d(1.05, 1.05, 1);
  z-index: 10;
}

.card-poster-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 2 / 3;
  background: #202020;
  overflow: hidden;
}

.card-poster-wrap.is-live {
  aspect-ratio: 16 / 9;
  background: #182218;
  display: flex;
  align-items: center;
  justify-content: center;
}

.card-poster {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.card-poster.logo-fit {
  object-fit: contain;
  padding: 12px;
}

.card-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  font-size: 10px;
  font-weight: 900;
  padding: 3px 6px;
  border-radius: 4px;
  text-transform: uppercase;
}

.badge-live {
  background: #e50914;
  color: #ffffff;
}

.badge-series {
  background: #0078d7;
  color: #ffffff;
}

.badge-movie {
  background: #333333;
  color: #ffffff;
}

.card-info {
  padding: 10px;
  background: #141414;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

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

.card-subline {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: #888888;
}

.card-rating {
  color: #e5a00d;
  font-weight: 700;
}

/* ==========================================================================
   SERIES EPISODES MODAL
   ========================================================================== */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.92);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 30px;
}

.modal.hidden {
  display: none !important;
}

.modal-card {
  background: #141414;
  border: 2px solid #2a2a2a;
  border-radius: 12px;
  width: 100%;
  max-width: 900px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.modal-header {
  padding: 18px 24px;
  border-bottom: 2px solid #222222;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-back-btn {
  background: #252525;
  border: 2px solid #3a3a3a;
  color: #ffffff;
  font-size: 15px;
  font-weight: 800;
  padding: 8px 18px;
  border-radius: 6px;
  cursor: pointer;
}

.modal-back-btn:focus,
.modal-back-btn.focused {
  background: #e50914;
  border-color: #ffffff;
  outline: 3px solid #107c10;
  outline-offset: 2px;
  transform: scale(1.05);
}

.modal-header h2 {
  font-size: 22px;
  font-weight: 800;
}



.btn-close {
  background: #252525;
  color: #ffffff;
  border: none;
  width: 38px;
  height: 38px;
  border-radius: 8px;
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
}

.btn-close:focus,
.btn-close.focused {
  background: #e50914;
  outline: 3px solid #ffffff;
}

.seasons-bar {
  display: flex;
  gap: 10px;
  padding: 16px 24px;
  border-bottom: 1px solid #202020;
  overflow-x: auto;
}

.season-btn {
  background: #202020;
  border: 2px solid #333333;
  color: #cccccc;
  font-size: 15px;
  font-weight: 700;
  padding: 8px 18px;
  border-radius: 6px;
  cursor: pointer;
  white-space: nowrap;
}

.season-btn.active {
  background: #107c10;
  border-color: #107c10;
  color: #ffffff;
}

.season-btn:focus,
.season-btn.focused {
  border-color: #ffffff;
  outline: 3px solid #107c10;
  outline-offset: 2px;
}

.episodes-grid {
  padding: 20px 24px;
  overflow-y: auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 12px;
}

.ep-btn {
  background: #222222;
  border: 2px solid #333333;
  color: #ffffff;
  font-size: 15px;
  font-weight: 700;
  padding: 16px 10px;
  border-radius: 8px;
  cursor: pointer;
  text-align: center;
}

.ep-btn:focus,
.ep-btn.focused {
  background: #107c10;
  border-color: #ffffff;
  outline: 3px solid #107c10;
  outline-offset: 2px;
  transform: scale(1.06);
}

/* ==========================================================================
   FULLSCREEN VIDEO PLAYER
   ========================================================================== */
.player-modal {
  position: fixed;
  inset: 0;
  z-index: 500;
  background: #000000;
}

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

.tv-video-element {
  width: 100vw;
  height: 100vh;
  object-fit: contain;
  background: #000000;
  transform: translateZ(0);
  backface-visibility: hidden;
}

.custom-subtitles {
  position: absolute;
  bottom: 90px;
  left: 5%;
  right: 5%;
  text-align: center;
  font-size: 28px;
  font-weight: 800;
  color: #ffffff;
  text-shadow: 0 2px 8px #000000, 0 0 12px #000000;
  pointer-events: none;
  z-index: 510;
}

.player-modal.hide-cursor,
.player-modal.hide-cursor * {
  cursor: none !important;
}

.player-hud {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 30px 40px;
  background: linear-gradient(180deg, rgba(0,0,0,0.88) 0%, transparent 22%, transparent 72%, rgba(0,0,0,0.94) 100%);
  opacity: 1;
  transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: auto;
  z-index: 520;
}

.player-hud.hidden-hud {
  opacity: 0;
  pointer-events: none;
}

.hud-top {
  display: flex;
  align-items: center;
  gap: 18px;
}

.player-back-btn,
.hud-btn {
  background: rgba(28, 28, 28, 0.92);
  color: #ffffff;
  border: 2px solid rgba(255, 255, 255, 0.35);
  padding: 10px 22px;
  font-size: 16px;
  font-weight: 800;
  border-radius: 8px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  outline: none;
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.player-back-btn:focus,
.player-back-btn.focused,
.hud-btn:focus,
.hud-btn.focused,
.player-back-btn:hover,
.hud-btn:hover {
  background: #e50914 !important;
  border-color: #ffffff !important;
  outline: 3px solid #107c10 !important;
  outline-offset: 2px;
  transform: scale(1.06);
}

.hud-title {
  font-size: 22px;
  font-weight: 800;
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hud-badge {
  background: #107c10;
  color: #ffffff;
  font-size: 12px;
  font-weight: 900;
  padding: 4px 10px;
  border-radius: 4px;
}

.hud-bottom {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.hud-progress-row {
  display: flex;
  align-items: center;
  gap: 16px;
}

.hud-time {
  font-size: 15px;
  font-weight: 700;
  min-width: 65px;
  font-variant-numeric: tabular-nums;
}

.seek-track {
  flex: 1;
  position: relative;
  height: 8px;
  background: #333333;
  border-radius: 4px;
  display: flex;
  align-items: center;
}

.seek-progress {
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  width: 0%;
  background: #107c10;
  border-radius: 4px;
  pointer-events: none;
}

.seek-slider {
  width: 100%;
  height: 8px;
  opacity: 0;
  cursor: pointer;
}

.seek-slider:focus + .seek-progress,
.seek-slider.focused + .seek-progress {
  background: #1ed760;
  box-shadow: 0 0 10px #1ed760;
}

.hud-controls-row {
  display: flex;
  gap: 12px;
}

.hud-ctrl-btn {
  background: #252525;
  border: 2px solid #3a3a3a;
  color: #ffffff;
  font-size: 15px;
  font-weight: 700;
  padding: 10px 20px;
  border-radius: 8px;
  cursor: pointer;
}

.hud-ctrl-btn:focus,
.hud-ctrl-btn.focused {
  background: #107c10;
  border-color: #ffffff;
  outline: 3px solid #107c10;
  outline-offset: 2px;
}

.hidden {
  display: none !important;
}
