:root {
  --bg-color: #111111;
  --card-bg: #1c1c1c;
  --text-main: #ffffff;
  --text-muted: #a3a3a3;
  --accent-red: #e50914;
  --accent-red-hover: #f40612;
  --focus-border: #ffffff;
  --safe-padding-x: 54px;
  --transition: all 0.25s cubic-bezier(0.2, 0, 0, 1);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: "Netflix Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background-color: var(--bg-color);
  color: var(--text-main);
  min-height: 100vh;
  overflow-x: hidden;
  user-select: none;
}

/* Scrollbar invisible para look nativo de TV */
::-webkit-scrollbar {
  display: none;
}
* {
  scrollbar-width: none;
}

/* Header / Navbar */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 80px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 var(--safe-padding-x);
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.85) 0%, rgba(17, 17, 17, 0) 100%);
  z-index: 50;
  transition: background 0.3s ease;
}

.brand {
  font-size: 2.2rem;
  font-weight: 900;
  color: var(--accent-red);
  text-decoration: none;
  letter-spacing: 3px;
  text-transform: uppercase;
  text-shadow: 0 2px 10px rgba(229, 9, 20, 0.4);
}

.nav-links {
  display: flex;
  gap: 24px;
  align-items: center;
}

.nav-item {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 1.1rem;
  font-weight: 500;
  padding: 8px 16px;
  border-radius: 4px;
  outline: none;
  transition: var(--transition);
}

.nav-item:hover, .nav-item:focus {
  color: #fff;
  background-color: rgba(255, 255, 255, 0.15);
  transform: scale(1.05);
}

.btn-upload-nav {
  background-color: rgba(229, 9, 20, 0.85);
  color: #fff;
  font-weight: 600;
}

.btn-upload-nav:focus, .btn-upload-nav:hover {
  background-color: var(--accent-red);
  box-shadow: 0 0 15px rgba(229, 9, 20, 0.7);
}

/* HERO BILLBOARD (Aspecto Cinematográfico Netflix) */
.hero-billboard {
  position: relative;
  width: 100vw;
  height: 68vh;
  min-height: 480px;
  max-height: 750px;
  overflow: hidden;
  background-color: #0d0d0d;
}

.hero-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 25%;
  opacity: 0.65;
  transition: opacity 0.5s ease-in-out, transform 0.8s ease-out;
  transform: scale(1.02);
}

.hero-vignette {
  position: absolute;
  inset: 0;
  background: 
    linear-gradient(77deg, rgba(17, 17, 17, 0.95) 0%, rgba(17, 17, 17, 0.8) 35%, rgba(17, 17, 17, 0.2) 75%, rgba(17, 17, 17, 0) 100%),
    linear-gradient(0deg, rgba(17, 17, 17, 1) 0%, rgba(17, 17, 17, 0.4) 25%, transparent 60%);
  pointer-events: none;
}

.hero-content {
  position: absolute;
  bottom: 12%;
  left: var(--safe-padding-x);
  max-width: 680px;
  z-index: 10;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.hero-title {
  font-size: 3.2rem;
  font-weight: 800;
  line-height: 1.1;
  text-shadow: 0 3px 12px rgba(0, 0, 0, 0.9);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.hero-meta {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 1.05rem;
  color: #ddd;
}

.badge-pill {
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(8px);
  padding: 3px 10px;
  border-radius: 4px;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 1px;
}

.badge-hd {
  border: 1px solid rgba(255, 255, 255, 0.6);
  padding: 1px 6px;
  border-radius: 3px;
  font-size: 0.75rem;
  font-weight: 700;
}

.hero-description {
  font-size: 1.15rem;
  line-height: 1.5;
  color: #d1d1d1;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.8);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.hero-actions {
  display: flex;
  gap: 16px;
  margin-top: 8px;
}

.btn-hero {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 14px 28px;
  border-radius: 6px;
  font-size: 1.15rem;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  outline: none;
  border: 3px solid transparent;
  transition: var(--transition);
}

.btn-hero-play {
  background-color: #ffffff;
  color: #000000;
}

.btn-hero-play:focus, .btn-hero-play:hover {
  background-color: #e6e6e6;
  border-color: var(--accent-red);
  transform: scale(1.08);
  box-shadow: 0 0 25px rgba(255, 255, 255, 0.6);
}

.btn-hero-info {
  background-color: rgba(109, 109, 110, 0.7);
  color: #ffffff;
  backdrop-filter: blur(10px);
}

.btn-hero-info:focus, .btn-hero-info:hover {
  background-color: rgba(109, 109, 110, 0.95);
  border-color: #fff;
  transform: scale(1.08);
}

/* FILAS TEMÁTICAS (Swimlanes / Rows) */
.content-section {
  position: relative;
  margin-top: -60px;
  padding-bottom: 60px;
  z-index: 20;
}

.category-row {
  margin-bottom: 42px;
}

.row-header {
  padding: 0 var(--safe-padding-x);
  margin-bottom: 14px;
}

.row-title {
  font-size: 1.45rem;
  font-weight: 700;
  color: #e5e5e5;
  letter-spacing: 0.5px;
}

.cards-slider {
  display: flex;
  gap: 20px;
  overflow-x: auto;
  padding: 24px var(--safe-padding-x);
  scroll-behavior: smooth;
}

/* TARJETAS DE VIDEO (Optimizado para 10-Foot UI) */
.media-card {
  flex: 0 0 280px;
  height: 165px;
  background-color: var(--card-bg);
  border-radius: 8px;
  overflow: hidden;
  position: relative;
  cursor: pointer;
  outline: none;
  border: 3px solid transparent;
  transition: transform 0.25s cubic-bezier(0.2, 0, 0, 1), border-color 0.25s, box-shadow 0.25s;
  will-change: transform;
}

.media-poster {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.card-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, rgba(0, 0, 0, 0.85) 0%, rgba(0, 0, 0, 0) 55%);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 14px;
  opacity: 0.9;
  transition: opacity 0.25s ease;
}

.card-overlay-title {
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-overlay-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* FOCO PARA CONTROL REMOTO (D-PAD) */
.media-card:focus, .media-card:hover {
  transform: scale(1.18);
  border-color: #ffffff;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.95);
  z-index: 30;
}

.media-card:focus .card-overlay, .media-card:hover .card-overlay {
  opacity: 1;
}

.media-card:focus .media-poster, .media-card:hover .media-poster {
  transform: scale(1.06);
}

/* CINEMA PLAYER OSD (Smart TV Video Player) */
.cinema-container {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  background: #000;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

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

/* Overlay de Controles (OSD) */
.osd-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 40px var(--safe-padding-x);
  background: linear-gradient(180deg, rgba(0,0,0,0.8) 0%, transparent 20%, transparent 70%, rgba(0,0,0,0.9) 100%);
  opacity: 1;
  transition: opacity 0.4s ease;
  pointer-events: none;
  z-index: 100;
}

.osd-overlay.hidden {
  opacity: 0;
}

.osd-top {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 20px;
}

.btn-back-osd {
  background: rgba(0, 0, 0, 0.5);
  border: 2px solid rgba(255, 255, 255, 0.3);
  color: #fff;
  font-size: 1.1rem;
  padding: 10px 20px;
  border-radius: 6px;
  cursor: pointer;
  outline: none;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: var(--transition);
}

.btn-back-osd:focus, .btn-back-osd:hover {
  border-color: #fff;
  background: rgba(229, 9, 20, 0.85);
  transform: scale(1.08);
}

.osd-video-title {
  font-size: 1.8rem;
  font-weight: 800;
  text-shadow: 0 2px 8px rgba(0,0,0,0.8);
}

/* Indicador central de Play/Pause/Seek */
.osd-center-feedback {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.8);
  width: 90px;
  height: 90px;
  background: rgba(0, 0, 0, 0.7);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  color: #fff;
  opacity: 0;
  transition: all 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  pointer-events: none;
  box-shadow: 0 0 30px rgba(0, 0, 0, 0.8);
}

.osd-center-feedback.show {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1.1);
}

.osd-bottom {
  pointer-events: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* Barra de Tiempo / Scrubber */
.progress-track {
  position: relative;
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.25);
  border-radius: 4px;
  cursor: pointer;
  outline: none;
  transition: height 0.2s ease;
}

.progress-track:focus, .progress-track:hover {
  height: 12px;
}

.progress-buffer {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  background: rgba(255, 255, 255, 0.4);
  border-radius: 4px;
  width: 0%;
}

.progress-current {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  background: var(--accent-red);
  border-radius: 4px;
  width: 0%;
}

.progress-thumb {
  position: absolute;
  right: -8px;
  top: 50%;
  transform: translateY(-50%) scale(0);
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 8px rgba(0,0,0,0.8);
  transition: transform 0.2s;
}

.progress-track:focus .progress-thumb, .progress-track:hover .progress-thumb {
  transform: translateY(-50%) scale(1);
}

.osd-controls-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 1.15rem;
  color: #e5e5e5;
  font-weight: 600;
}

.osd-hints {
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.6);
  display: flex;
  gap: 20px;
}

.key-badge {
  background: rgba(255, 255, 255, 0.2);
  padding: 2px 7px;
  border-radius: 3px;
  font-size: 0.8rem;
  color: #fff;
}

/* ESTILOS PARA FORMULARIO DE CARGA (UPLOAD) */
.upload-container {
  max-width: 680px;
  margin: 120px auto 60px auto;
  padding: 0 24px;
}

.form-card {
  background-color: var(--card-bg);
  padding: 36px;
  border-radius: 8px;
  border: 1px solid #2a2a2a;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
}

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

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-size: 0.95rem;
  font-weight: 600;
  color: #e5e5e5;
}

.form-control {
  width: 100%;
  padding: 12px 14px;
  background-color: #121212;
  border: 1px solid #333;
  border-radius: 4px;
  color: #fff;
  font-size: 1rem;
  transition: var(--transition);
}

.form-control:focus {
  outline: none;
  border-color: var(--accent-red);
}

textarea.form-control {
  min-height: 90px;
  resize: vertical;
}

.file-dropzone {
  border: 2px dashed #444;
  border-radius: 6px;
  padding: 24px;
  text-align: center;
  background-color: #171717;
  cursor: pointer;
  transition: var(--transition);
}

.file-dropzone:hover {
  border-color: var(--accent-red);
}

.file-dropzone input[type="file"] {
  display: none;
}

.btn-submit-upload {
  width: 100%;
  padding: 14px;
  background: var(--accent-red);
  color: #fff;
  border: none;
  border-radius: 4px;
  font-size: 1.05rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
}

.btn-submit-upload:hover {
  background: var(--accent-red-hover);
}

.progress-container {
  margin-top: 20px;
  display: none;
}

.progress-bar-bg {
  background: #2a2a2a;
  height: 10px;
  border-radius: 5px;
  overflow: hidden;
}

.progress-bar-fill {
  background: var(--accent-red);
  height: 100%;
  width: 0%;
  transition: width 0.2s ease;
}

/* Boton Pantalla Completa OSD */
.btn-fullscreen {
  background: rgba(255, 255, 255, 0.15);
  border: 2px solid rgba(255, 255, 255, 0.3);
  color: #ffffff;
  padding: 8px 16px;
  border-radius: 6px;
  cursor: pointer;
  outline: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.95rem;
  font-weight: 600;
  transition: var(--transition);
}

.btn-fullscreen:focus, .btn-fullscreen:hover {
  background: #ffffff;
  color: #000000;
  border-color: #ffffff;
  transform: scale(1.08);
  box-shadow: 0 0 20px rgba(255, 255, 255, 0.6);
}
