* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  color: #ffffff;
  background: #05070d;
}

/* LOGIN */

.login-body {
  min-height: 100vh;
  background:
    linear-gradient(rgba(5, 7, 13, 0.82), rgba(5, 7, 13, 0.95)),
    radial-gradient(circle at top right, #57122b, transparent 40%),
    radial-gradient(circle at bottom left, #111f4d, transparent 35%);
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-container {
  width: 100%;
  max-width: 420px;
  padding: 20px;
}

.login-card {
  background: rgba(13, 17, 27, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 22px;
  padding: 34px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.45);
}

.login-card h1 {
  margin: 0;
  letter-spacing: 4px;
  color: #ff2d55;
  font-size: 34px;
}

.login-subtitle {
  margin: 10px 0 28px;
  color: #b8bcc8;
}

.form-group {
  margin-bottom: 18px;
}

.form-group label {
  display: block;
  font-size: 14px;
  color: #c8ccd8;
  margin-bottom: 8px;
}

.form-group input,
.topbar input {
  width: 100%;
  background: #0b101a;
  color: white;
  border: 1px solid rgba(255,255,255,0.12);
  outline: none;
  border-radius: 12px;
  padding: 13px 15px;
}

.form-group input:focus,
.topbar input:focus {
  border-color: #ff2d55;
}

.login-card button,
.hero-actions button,
.sidebar-bottom button {
  border: none;
  cursor: pointer;
  background: linear-gradient(135deg, #ff1648, #8c2eff);
  color: white;
  border-radius: 12px;
  padding: 13px 18px;
  font-weight: 700;
}

.login-card button {
  width: 100%;
  margin-top: 4px;
}

.error-message {
  color: #ff6b6b;
  margin-top: 16px;
  min-height: 20px;
}

/* APP */

.app-body {
  display: flex;
  min-height: 100vh;
  background:
    radial-gradient(circle at top right, rgba(116, 24, 78, 0.35), transparent 35%),
    radial-gradient(circle at bottom left, rgba(22, 35, 84, 0.45), transparent 40%),
    #05070d;
}

.sidebar {
  width: 250px;
  min-height: 100vh;
  background: rgba(5, 8, 15, 0.96);
  border-right: 1px solid rgba(255,255,255,0.08);
  padding: 26px 18px;
  position: fixed;
  left: 0;
  top: 0;
}

.logo {
  font-size: 28px;
  font-weight: 900;
  letter-spacing: 4px;
  margin-bottom: 34px;
}

.logo span {
  color: #ff2d55;
}

.sidebar nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sidebar nav a {
  color: #d8dbe5;
  text-decoration: none;
  padding: 13px 14px;
  border-radius: 12px;
  font-size: 15px;
}

.sidebar nav a.active,
.sidebar nav a:hover {
  background: linear-gradient(135deg, rgba(255, 45, 85, 0.28), rgba(140, 46, 255, 0.18));
  color: white;
}

.sidebar-bottom {
  position: absolute;
  bottom: 24px;
  left: 18px;
  right: 18px;
}

.sidebar-bottom button {
  width: 100%;
  background: #111827;
}

.main-content {
  margin-left: 250px;
  width: calc(100% - 250px);
  padding: 24px 34px 60px;
}

.topbar {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 18px;
}

.topbar input {
  max-width: 760px;
}

.user-box {
  margin-left: auto;
  color: #d8dbe5;
  font-weight: 600;
}

.hero {
  min-height: 360px;
  border-radius: 24px;
  overflow: hidden;
  background:
    linear-gradient(90deg, rgba(5,7,13,0.96), rgba(5,7,13,0.65), rgba(5,7,13,0.18)),
    radial-gradient(circle at 75% 35%, rgba(255,45,85,0.38), transparent 28%),
    linear-gradient(135deg, #111827, #1d1025);
  display: flex;
  align-items: center;
  padding: 44px;
  border: 1px solid rgba(255,255,255,0.08);
  box-shadow: 0 20px 70px rgba(0,0,0,0.35);
}

.hero-info {
  max-width: 560px;
}

.hero-label {
  color: #ff2d55;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 1px;
}

.hero h1 {
  font-size: 54px;
  margin: 16px 0 10px;
  line-height: 1;
}

.hero p {
  color: #d3d6df;
}

.hero-actions {
  display: flex;
  gap: 12px;
  margin-top: 26px;
}

.hero-actions .secondary {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.2);
}

.chips {
  display: flex;
  gap: 12px;
  margin: 24px 0;
}

.chip {
  color: #d8dbe5;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.09);
  padding: 10px 18px;
  border-radius: 999px;
  cursor: pointer;
}

.chip.active,
.chip:hover {
  color: white;
  border-color: #ff2d55;
  background: rgba(255,45,85,0.18);
}

.content-section {
  margin-top: 22px;
}

.section-header h2 {
  font-size: 22px;
  margin: 0 0 14px;
}

.cards-row {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  padding-bottom: 10px;
}

.cards-row::-webkit-scrollbar {
  height: 8px;
}

.cards-row::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.18);
  border-radius: 999px;
}

.card {
  min-width: 220px;
  height: 135px;
  border-radius: 16px;
  overflow: hidden;
  position: relative;
  cursor: pointer;
  background: #111827;
  border: 1px solid rgba(255,255,255,0.08);
  transition: transform 0.18s ease, border-color 0.18s ease;
}

.card:hover {
  transform: scale(1.045);
  border-color: rgba(255,45,85,0.75);
}

.card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  opacity: 0.82;
}

.card-overlay {
  position: absolute;
  inset: 0;
  padding: 14px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  background: linear-gradient(180deg, transparent, rgba(0,0,0,0.85));
}

.card-type {
  font-size: 11px;
  color: #ff8aa1;
  font-weight: 800;
}

.card-title {
  font-size: 16px;
  font-weight: 800;
  margin-top: 4px;
}

.card-meta {
  font-size: 12px;
  color: #c3c7d2;
  margin-top: 2px;
}

.empty-message {
  color: #aeb4c3;
  padding: 20px 0;
}

/* DETALLE */

.detalle-body {
  min-height: 100vh;
  background:
    radial-gradient(circle at top right, rgba(255,45,85,0.22), transparent 35%),
    radial-gradient(circle at bottom left, rgba(140,46,255,0.22), transparent 35%),
    #05070d;
  color: white;
}

.detalle-header {
  height: 78px;
  padding: 0 36px;
  display: flex;
  align-items: center;
  gap: 24px;
  background: rgba(5, 7, 13, 0.82);
  border-bottom: 1px solid rgba(255,255,255,0.08);
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(10px);
}

.detalle-logo {
  font-size: 26px;
  font-weight: 900;
  letter-spacing: 4px;
  cursor: pointer;
}

.detalle-logo span {
  color: #ff2d55;
}

.btn-volver {
  margin-left: auto;
  background: rgba(255,255,255,0.08);
  color: white;
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 12px;
  padding: 11px 18px;
  cursor: pointer;
}

.btn-volver:hover {
  border-color: #ff2d55;
}

.detalle-container {
  padding: 28px 38px 70px;
}

.detalle-hero {
  min-height: 420px;
  border-radius: 26px;
  padding: 48px;
  display: flex;
  align-items: flex-end;
  background:
    linear-gradient(90deg, rgba(5,7,13,0.96), rgba(5,7,13,0.72), rgba(5,7,13,0.18)),
    radial-gradient(circle at 75% 35%, rgba(255,45,85,0.30), transparent 30%),
    linear-gradient(135deg, #111827, #1d1025);
  border: 1px solid rgba(255,255,255,0.08);
  box-shadow: 0 22px 70px rgba(0,0,0,0.45);
  overflow: hidden;
}

.detalle-info {
  max-width: 720px;
}

.detalle-label {
  color: #ff2d55;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 1.3px;
}

.detalle-info h1 {
  font-size: 58px;
  margin: 14px 0 10px;
  line-height: 1;
}

.detalle-meta {
  color: #d7dae3;
  font-size: 15px;
  margin-bottom: 18px;
}

.detalle-descripcion {
  color: #d7dae3;
  line-height: 1.55;
  max-width: 620px;
}

.detalle-actions {
  display: flex;
  gap: 14px;
  margin-top: 28px;
}

.detalle-actions button {
  border: none;
  cursor: pointer;
  background: linear-gradient(135deg, #ff1648, #8c2eff);
  color: white;
  border-radius: 13px;
  padding: 14px 22px;
  font-weight: 800;
  font-size: 15px;
}

.detalle-actions .secondary {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.20);
}

.player-section,
.temporadas-section {
  margin-top: 34px;
}

.player-section h2,
.temporadas-section h2 {
  font-size: 24px;
  margin-bottom: 16px;
}

.video-wrapper {
  width: 100%;
  background: #000;
  border-radius: 22px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.10);
  box-shadow: 0 22px 70px rgba(0,0,0,0.42);
}

.video-wrapper video {
  width: 100%;
  max-height: 720px;
  display: block;
  background: #000;
}

.hidden {
  display: none !important;
}

.temporada-card {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 18px;
  padding: 18px;
  margin-bottom: 18px;
}

.temporada-card h3 {
  margin: 0 0 14px;
}

.episodio-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 13px;
  border-radius: 14px;
  background: rgba(0,0,0,0.22);
  margin-bottom: 10px;
}

.episodio-numero {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,45,85,0.22);
  color: #ff8aa1;
  font-weight: 900;
}

.episodio-info {
  flex: 1;
}

.episodio-info strong {
  display: block;
  margin-bottom: 4px;
}

.episodio-info span {
  color: #bfc4d0;
  font-size: 13px;
}

.episodio-actions {
  display: flex;
  gap: 10px;
}

.episodio-actions button {
  border: none;
  cursor: pointer;
  border-radius: 11px;
  padding: 10px 14px;
  background: rgba(255,255,255,0.10);
  color: white;
}

.episodio-actions button:hover {
  background: rgba(255,45,85,0.35);
}

/* ADMIN */

.admin-container {
  padding: 30px 38px 70px;
  max-width: 1280px;
  margin: 0 auto;
}

.admin-card {
  background: rgba(13, 17, 27, 0.92);
  border: 1px solid rgba(255,255,255,0.09);
  border-radius: 24px;
  padding: 28px;
  margin-bottom: 26px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.35);
}

.admin-header h1 {
  margin: 0;
  font-size: 34px;
}

.admin-header p {
  color: #bfc4d0;
  margin-top: 8px;
}

.admin-form {
  margin-top: 24px;
}

.form-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.admin-form .form-group {
  margin-bottom: 18px;
}

.admin-form label {
  display: block;
  color: #d7dae3;
  font-size: 14px;
  margin-bottom: 8px;
}

.admin-form input,
.admin-form select,
.admin-form textarea {
  width: 100%;
  background: #0b101a;
  color: white;
  border: 1px solid rgba(255,255,255,0.12);
  outline: none;
  border-radius: 12px;
  padding: 13px 15px;
  font-family: Arial, Helvetica, sans-serif;
}

.admin-form textarea {
  resize: vertical;
}

.admin-form input:focus,
.admin-form select:focus,
.admin-form textarea:focus {
  border-color: #ff2d55;
}

.admin-form input[type="file"] {
  padding: 11px;
}

.admin-form small {
  display: block;
  color: #8fd6a3;
  margin-top: 8px;
  word-break: break-all;
}

.checks-row {
  grid-template-columns: repeat(2, max-content);
  align-items: center;
}

.check-label {
  display: flex !important;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}

.check-label input {
  width: auto;
}

.admin-actions {
  display: flex;
  gap: 12px;
  margin-top: 8px;
}

.admin-actions button {
  border: none;
  cursor: pointer;
  background: linear-gradient(135deg, #ff1648, #8c2eff);
  color: white;
  border-radius: 13px;
  padding: 14px 22px;
  font-weight: 800;
}

.admin-actions .secondary {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.20);
}

.admin-message {
  min-height: 22px;
  margin-top: 18px;
  color: #8fd6a3;
}

.admin-message.error {
  color: #ff6b6b;
}

.admin-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.admin-item {
  display: grid;
  grid-template-columns: 90px 1fr auto;
  gap: 16px;
  align-items: center;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 16px;
  padding: 12px;
}

.admin-thumb {
  width: 90px;
  height: 58px;
  border-radius: 12px;
  object-fit: cover;
  background: #111827;
}

.admin-item h3 {
  margin: 0 0 5px;
  font-size: 17px;
}

.admin-item p {
  margin: 0;
  color: #bfc4d0;
  font-size: 13px;
}

.admin-badge {
  display: inline-block;
  padding: 5px 9px;
  border-radius: 999px;
  background: rgba(255,45,85,0.18);
  color: #ff8aa1;
  font-size: 12px;
  font-weight: 800;
}

@media (max-width: 900px) {
  .form-row {
    grid-template-columns: 1fr;
  }

  .admin-item {
    grid-template-columns: 1fr;
  }

  .admin-thumb {
    width: 100%;
    height: 160px;
  }
}

/* CONTINUAR VIENDO */

.continuar-card {
  border-color: rgba(255, 45, 85, 0.35);
}

.progress-bar {
  width: 100%;
  height: 5px;
  background: rgba(255,255,255,0.22);
  border-radius: 999px;
  overflow: hidden;
  margin-top: 10px;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(135deg, #ff1648, #8c2eff);
  border-radius: 999px;
}

.favorito-activo {
  background: rgba(255, 45, 85, 0.28) !important;
  border-color: rgba(255, 45, 85, 0.75) !important;
  color: #ffffff !important;
}

.admin-actions .danger {
  background: rgba(255, 75, 75, 0.18);
  border: 1px solid rgba(255, 75, 75, 0.55);
  color: #ffb4b4;
}

.admin-item-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn-editar-admin {
  border: none;
  cursor: pointer;
  border-radius: 10px;
  padding: 9px 13px;
  background: rgba(255,255,255,0.10);
  color: white;
  font-weight: 700;
}

.btn-editar-admin:hover {
  background: rgba(255,45,85,0.35);
}

.admin-separator {
  border: none;
  border-top: 1px solid rgba(255,255,255,0.10);
  margin: 28px 0;
}

.series-admin-list {
  margin-top: 24px;
}

.temporada-admin-card {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 18px;
  padding: 18px;
  margin-bottom: 16px;
}

.temporada-admin-card h3 {
  margin: 0 0 12px;
}

.episodio-admin-item {
  display: grid;
  grid-template-columns: 70px 1fr auto;
  gap: 14px;
  align-items: center;
  background: rgba(0,0,0,0.25);
  border-radius: 14px;
  padding: 12px;
  margin-top: 10px;
}

.episodio-admin-numero {
  width: 46px;
  height: 46px;
  background: rgba(255,45,85,0.22);
  color: #ff8aa1;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
}

.episodio-admin-info strong {
  display: block;
  margin-bottom: 4px;
}

.episodio-admin-info span {
  color: #bfc4d0;
  font-size: 13px;
}

.episodio-admin-badge {
  display: inline-block;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(140,46,255,0.20);
  color: #d6c4ff;
  font-size: 12px;
  font-weight: 800;
}

.usuarios-admin-list {
  margin-top: 24px;
}

.usuario-admin-item {
  grid-template-columns: 56px 1fr auto;
}

.usuario-avatar {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  background: rgba(255,45,85,0.22);
  color: #ff8aa1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 20px;
}

.estado-activo {
  background: rgba(0, 200, 120, 0.18);
  color: #80ffd0;
}

.estado-inactivo {
  background: rgba(255, 75, 75, 0.18);
  color: #ffb4b4;
}

.btn-estado-usuario {
  border: none;
  cursor: pointer;
  border-radius: 10px;
  padding: 9px 13px;
  background: rgba(255,255,255,0.10);
  color: white;
  font-weight: 700;
}

.btn-estado-usuario:hover {
  background: rgba(140,46,255,0.35);
}

.admin-body-oculto {
  display: none;
}

.genero-filter {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 14px 0 24px;
}

.genero-filter label {
  color: #bfc4d0;
  font-size: 14px;
  font-weight: 700;
}

.genero-filter select {
  background: rgba(255,255,255,0.08);
  color: #ffffff;
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 999px;
  padding: 10px 16px;
  outline: none;
  min-width: 220px;
}

.genero-filter select:focus {
  border-color: rgba(255,45,85,0.70);
}

.genero-filter option {
  background: #11131a;
  color: #ffffff;
}

.detalle-badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 7px 12px;
  border-radius: 999px;
  background: rgba(255,45,85,0.22);
  color: #ff8aa1;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.12em;
  margin-bottom: 14px;
}

.detalle-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 12px 0 18px;
}

.detalle-meta span {
  padding: 7px 11px;
  border-radius: 999px;
  background: rgba(255,255,255,0.10);
  color: #d8dce7;
  font-size: 13px;
  font-weight: 700;
}

.detalle-message {
  color: #bfc4d0;
  margin-top: 12px;
  font-size: 14px;
}

.detalle-message.error {
  color: #ffb4b4;
}

.detalle-progreso-box {
  max-width: 420px;
  margin: 20px 0;
  padding: 14px;
  border-radius: 16px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.10);
}

.detalle-progreso-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #d8dce7;
  font-size: 13px;
  margin-bottom: 10px;
}

.detalle-progreso-info strong {
  color: #ffffff;
}

.detalle-progress-bar {
  margin-top: 0;
}

.temporadas-tabs {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.temporada-tab {
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.08);
  color: #ffffff;
  border-radius: 999px;
  padding: 10px 16px;
  cursor: pointer;
  font-weight: 800;
}

.temporada-tab.active,
.temporada-tab:hover {
  background: rgba(255,45,85,0.28);
  border-color: rgba(255,45,85,0.75);
}

.temporada-detalle-card {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 22px;
  padding: 20px;
}

.temporada-detalle-header h3 {
  margin: 0 0 8px;
}

.temporada-detalle-header p {
  margin: 0 0 18px;
  color: #bfc4d0;
}

.episodios-detalle-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.episodio-detalle-card {
  display: grid;
  grid-template-columns: 58px 1fr auto;
  gap: 16px;
  align-items: center;
  padding: 14px;
  border-radius: 18px;
  background: rgba(0,0,0,0.28);
  border: 1px solid rgba(255,255,255,0.08);
}

.episodio-numero {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: rgba(255,45,85,0.22);
  color: #ff8aa1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 18px;
}

.episodio-detalle-info h4 {
  margin: 0 0 6px;
}

.episodio-detalle-info p {
  margin: 0 0 6px;
  color: #bfc4d0;
  font-size: 14px;
}

.episodio-detalle-info span {
  font-size: 12px;
  color: #8f96a8;
}

.episodio-detalle-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.episodio-detalle-actions button {
  border: none;
  border-radius: 999px;
  padding: 10px 14px;
  cursor: pointer;
  font-weight: 800;
  color: #ffffff;
  background: linear-gradient(135deg, #ff1648, #8c2eff);
}

.episodio-detalle-actions button.secondary {
  background: rgba(255,255,255,0.12);
}

.episodio-detalle-actions button.disabled,
.episodio-detalle-actions button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

@media (max-width: 850px) {
  .episodio-detalle-card {
    grid-template-columns: 48px 1fr;
  }

  .episodio-detalle-actions {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }
}

.episodio-admin-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn-editar-episodio {
  border: none;
  cursor: pointer;
  border-radius: 10px;
  padding: 9px 13px;
  background: rgba(255,255,255,0.10);
  color: white;
  font-weight: 700;
}

.btn-editar-episodio:hover {
  background: rgba(255,45,85,0.35);
}

.temporada-admin-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 14px;
}

.temporada-admin-header p {
  margin: 6px 0 0;
  color: #bfc4d0;
  font-size: 14px;
}

.temporada-admin-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn-editar-temporada {
  border: none;
  cursor: pointer;
  border-radius: 10px;
  padding: 9px 13px;
  background: rgba(255,255,255,0.10);
  color: white;
  font-weight: 700;
}

.btn-editar-temporada:hover {
  background: rgba(255,45,85,0.35);
}

@media (max-width: 750px) {
  .temporada-admin-header {
    flex-direction: column;
  }

  .temporada-admin-actions {
    width: 100%;
    justify-content: flex-start;
  }
}

.admin-filters {
  display: grid;
  grid-template-columns: 1fr 220px 220px;
  gap: 16px;
  margin: 18px 0 24px;
  padding: 16px;
  border-radius: 18px;
  background: rgba(255,255,255,0.045);
  border: 1px solid rgba(255,255,255,0.08);
}

.admin-filters .form-group {
  margin-bottom: 0;
}

.admin-filters input,
.admin-filters select {
  width: 100%;
}

@media (max-width: 850px) {
  .admin-filters {
    grid-template-columns: 1fr;
  }
}

.loading-box,
.error-box,
.empty-box {
  width: 100%;
  padding: 18px 20px;
  border-radius: 18px;
  margin: 16px 0;
  font-size: 15px;
  font-weight: 700;
}

.loading-box {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.10);
  color: #d8dce7;
}

.error-box {
  background: rgba(255,75,75,0.12);
  border: 1px solid rgba(255,75,75,0.35);
  color: #ffb4b4;
}

.empty-box {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  color: #bfc4d0;
}

.btn-loading,
button:disabled {
  opacity: 0.55;
  cursor: not-allowed !important;
}

/* RESPONSIVE GENERAL */

/* Tablets y notebooks chicas */
@media (max-width: 1100px) {
  .sidebar {
    width: 210px;
    padding: 22px 14px;
  }

  .main-content {
    margin-left: 210px;
    width: calc(100% - 210px);
    padding: 22px 24px 50px;
  }

  .hero {
    min-height: 320px;
    padding: 34px;
  }

  .hero h1 {
    font-size: 44px;
  }

  .detalle-container {
    padding: 24px 28px 60px;
  }

  .detalle-hero {
    min-height: 360px;
    padding: 38px;
  }

  .detalle-info h1 {
    font-size: 46px;
  }

  .card {
    min-width: 200px;
    height: 125px;
  }
}

/* Mobile / tablets chicas */
@media (max-width: 760px) {
  body {
    overflow-x: hidden;
  }

  .app-body {
    display: block;
    min-height: 100vh;
  }

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 50;
    width: 100%;
    min-height: auto;
    padding: 14px 14px 12px;
    border-right: none;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    backdrop-filter: blur(10px);
  }

  .logo {
    font-size: 24px;
    margin-bottom: 12px;
  }

  .sidebar nav {
    flex-direction: row;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 4px;
  }

  .sidebar nav::-webkit-scrollbar {
    height: 0;
  }

  .sidebar nav a {
    flex: 0 0 auto;
    padding: 10px 13px;
    font-size: 14px;
    white-space: nowrap;
  }

  .sidebar-bottom {
    position: static;
    margin-top: 12px;
  }

  .sidebar-bottom button {
    padding: 10px 14px;
  }

  .main-content {
    margin-left: 0;
    width: 100%;
    padding: 18px 16px 50px;
  }

  .topbar {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .topbar input {
    max-width: none;
  }

  .user-box {
    margin-left: 0;
    font-size: 14px;
  }

  .hero {
    min-height: 300px;
    padding: 28px 22px;
    align-items: flex-end;
    border-radius: 20px;
    background:
      linear-gradient(0deg, rgba(5,7,13,0.98), rgba(5,7,13,0.55)),
      radial-gradient(circle at 70% 25%, rgba(255,45,85,0.32), transparent 34%),
      linear-gradient(135deg, #111827, #1d1025);
  }

  .hero-info {
    max-width: 100%;
  }

  .hero h1 {
    font-size: 36px;
    line-height: 1.05;
  }

  .hero p {
    font-size: 14px;
  }

  .hero-actions {
    flex-direction: column;
    gap: 10px;
  }

  .hero-actions button {
    width: 100%;
  }

  .chips {
    overflow-x: auto;
    padding-bottom: 4px;
    margin: 18px 0;
  }

  .chip {
    flex: 0 0 auto;
    white-space: nowrap;
  }

  .genero-filter {
    align-items: stretch;
    flex-direction: column;
    gap: 8px;
  }

  .genero-filter select {
    width: 100%;
    min-width: 0;
  }

  .section-header h2 {
    font-size: 20px;
  }

  .cards-row {
    gap: 12px;
    padding-bottom: 14px;
    scroll-snap-type: x proximity;
  }

  .card {
    min-width: 165px;
    height: 105px;
    border-radius: 14px;
    scroll-snap-align: start;
  }

  .card:hover {
    transform: none;
  }

  .card-overlay {
    padding: 11px;
  }

  .card-title {
    font-size: 14px;
  }

  .card-meta {
    font-size: 11px;
  }
}

/* Detalle mobile */
@media (max-width: 760px) {
  .detalle-header {
    height: auto;
    padding: 14px 16px;
    gap: 12px;
  }

  .detalle-logo {
    font-size: 22px;
  }

  .btn-volver {
    padding: 9px 13px;
    font-size: 13px;
  }

  .detalle-container {
    padding: 18px 16px 50px;
  }

  .detalle-hero {
    min-height: 340px;
    padding: 28px 20px;
    border-radius: 20px;
    background:
      linear-gradient(0deg, rgba(5,7,13,0.98), rgba(5,7,13,0.58)),
      radial-gradient(circle at 70% 25%, rgba(255,45,85,0.28), transparent 34%),
      linear-gradient(135deg, #111827, #1d1025);
  }

  .detalle-info {
    max-width: 100%;
  }

  .detalle-info h1 {
    font-size: 36px;
    line-height: 1.05;
  }

  .detalle-descripcion {
    font-size: 14px;
  }

  .detalle-actions {
    flex-direction: column;
    gap: 10px;
  }

  .detalle-actions button {
    width: 100%;
  }

  .detalle-progreso-box {
    max-width: 100%;
  }

  .video-wrapper {
    border-radius: 16px;
  }

  .video-wrapper video {
    max-height: 70vh;
  }

  .temporadas-tabs {
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 4px;
  }

  .temporada-tab {
    flex: 0 0 auto;
    white-space: nowrap;
  }

  .temporada-detalle-card {
    padding: 16px;
    border-radius: 18px;
  }

  .episodio-detalle-card {
    grid-template-columns: 44px 1fr;
    gap: 12px;
    padding: 12px;
  }

  .episodio-numero {
    width: 42px;
    height: 42px;
    font-size: 16px;
  }

  .episodio-detalle-actions {
    grid-column: 1 / -1;
    flex-direction: column;
    align-items: stretch;
  }

  .episodio-detalle-actions button {
    width: 100%;
  }
}

/* Admin mobile */
@media (max-width: 760px) {
  .admin-container {
    padding: 18px 14px 50px;
  }

  .admin-header h1 {
    font-size: 28px;
  }

  .admin-card {
    padding: 20px 16px;
    border-radius: 20px;
  }

  .form-row {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .checks-row {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .admin-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .admin-actions button {
    width: 100%;
  }

  .admin-item {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .admin-thumb {
    width: 100%;
    height: 180px;
  }

  .admin-item-actions {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
  }

  .admin-item-actions button,
  .btn-editar-admin,
  .btn-estado-usuario {
    width: 100%;
  }

  .usuario-admin-item {
    grid-template-columns: 1fr;
  }

  .usuario-avatar {
    width: 48px;
    height: 48px;
  }

  .episodio-admin-item {
    grid-template-columns: 48px 1fr;
    gap: 12px;
  }

  .episodio-admin-actions {
    grid-column: 1 / -1;
    align-items: stretch;
    flex-direction: column;
  }

  .episodio-admin-actions button,
  .btn-editar-episodio {
    width: 100%;
  }

  .temporada-admin-actions {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
  }

  .temporada-admin-actions button,
  .btn-editar-temporada {
    width: 100%;
  }

  .admin-filters {
    grid-template-columns: 1fr;
    padding: 14px;
  }
}

/* Celulares chicos */
@media (max-width: 430px) {
  .login-container {
    padding: 14px;
  }

  .login-card {
    padding: 26px 20px;
    border-radius: 20px;
  }

  .login-card h1 {
    font-size: 30px;
  }

  .main-content {
    padding: 16px 12px 44px;
  }

  .hero {
    min-height: 280px;
    padding: 24px 18px;
  }

  .hero h1 {
    font-size: 31px;
  }

  .card {
    min-width: 150px;
    height: 96px;
  }

  .detalle-container {
    padding: 16px 12px 44px;
  }

  .detalle-info h1 {
    font-size: 31px;
  }

  .detalle-hero {
    min-height: 310px;
    padding: 24px 18px;
  }

  .admin-container {
    padding: 16px 12px 44px;
  }

  .admin-card {
    padding: 18px 14px;
  }
}

/* TV / pantallas grandes */

@media (min-width: 1600px) {
  .sidebar {
    width: 300px;
    padding: 34px 24px;
  }

  .main-content {
    margin-left: 300px;
    width: calc(100% - 300px);
    padding: 34px 48px 80px;
  }

  .logo {
    font-size: 34px;
    margin-bottom: 44px;
  }

  .sidebar nav a {
    font-size: 18px;
    padding: 16px 18px;
  }

  .sidebar-bottom button {
    font-size: 16px;
    padding: 15px 18px;
  }

  .topbar input {
    font-size: 17px;
    padding: 16px 18px;
  }

  .user-box {
    font-size: 17px;
  }

  .hero {
    min-height: 460px;
    padding: 58px;
    border-radius: 30px;
  }

  .hero h1 {
    font-size: 68px;
  }

  .hero p {
    font-size: 18px;
    line-height: 1.55;
  }

  .hero-actions button {
    font-size: 18px;
    padding: 17px 26px;
  }

  .section-header h2 {
    font-size: 30px;
  }

  .cards-row {
    gap: 22px;
  }

  .card {
    min-width: 300px;
    height: 180px;
    border-radius: 22px;
  }

  .card-title {
    font-size: 21px;
  }

  .card-meta {
    font-size: 15px;
  }

  .card-type {
    font-size: 13px;
  }

  .chip {
    font-size: 17px;
    padding: 13px 22px;
  }

  .genero-filter label,
  .genero-filter select {
    font-size: 17px;
  }

  .genero-filter select {
    padding: 13px 20px;
    min-width: 280px;
  }
}

@media (min-width: 2200px) {
  .card {
    min-width: 360px;
    height: 215px;
  }

  .hero {
    min-height: 540px;
  }

  .hero h1 {
    font-size: 78px;
  }

  .main-content {
    padding-left: 64px;
    padding-right: 64px;
  }
}

/* Detalle en TV */

@media (min-width: 1600px) {
  .detalle-header {
    height: 92px;
    padding: 0 52px;
  }

  .detalle-logo {
    font-size: 34px;
  }

  .btn-volver {
    font-size: 17px;
    padding: 14px 22px;
  }

  .detalle-container {
    padding: 38px 56px 90px;
  }

  .detalle-hero {
    min-height: 520px;
    padding: 62px;
    border-radius: 30px;
  }

  .detalle-info h1 {
    font-size: 76px;
  }

  .detalle-descripcion {
    font-size: 19px;
    line-height: 1.65;
    max-width: 800px;
  }

  .detalle-meta span {
    font-size: 16px;
    padding: 9px 14px;
  }

  .detalle-actions button {
    font-size: 18px;
    padding: 17px 28px;
  }

  .player-section h2,
  .temporadas-section h2 {
    font-size: 32px;
  }

  .video-wrapper {
    border-radius: 28px;
  }

  .temporada-tab {
    font-size: 17px;
    padding: 13px 22px;
  }

  .temporada-detalle-card {
    padding: 28px;
  }

  .episodio-detalle-card {
    grid-template-columns: 70px 1fr auto;
    padding: 20px;
    gap: 20px;
  }

  .episodio-numero {
    width: 58px;
    height: 58px;
    font-size: 22px;
  }

  .episodio-detalle-info h4 {
    font-size: 21px;
  }

  .episodio-detalle-info p {
    font-size: 17px;
  }

  .episodio-detalle-actions button {
    font-size: 16px;
    padding: 13px 18px;
  }
}

button:focus,
a:focus,
.card:focus,
.chip:focus,
.temporada-tab:focus {
  outline: 3px solid rgba(255,45,85,0.95);
  outline-offset: 4px;
}

/* NAVEGACIÓN TECLADO / TV */

.card,
.chip,
.sidebar nav a,
.hero-actions button,
.sidebar-bottom button,
.temporada-tab,
.episodio-detalle-actions button,
.detalle-actions button,
.btn-volver {
  outline: none;
}

.card:focus,
.chip:focus,
.sidebar nav a:focus,
.hero-actions button:focus,
.sidebar-bottom button:focus,
.temporada-tab:focus,
.episodio-detalle-actions button:focus,
.detalle-actions button:focus,
.btn-volver:focus {
  outline: 3px solid rgba(255,45,85,0.95);
  outline-offset: 4px;
  box-shadow: 0 0 0 6px rgba(255,45,85,0.18);
}

.card:focus {
  transform: scale(1.055);
  border-color: rgba(255,45,85,0.95);
}

@media (max-width: 760px) {
  .card:focus {
    transform: none;
  }
}

/* NAVEGACIÓN TECLADO / TV - DETALLE */

.detalle-actions button,
.temporada-tab,
.episodio-detalle-actions button,
.btn-volver,
.video-wrapper video {
  outline: none;
}

.detalle-actions button:focus,
.temporada-tab:focus,
.episodio-detalle-actions button:focus,
.btn-volver:focus,
.video-wrapper video:focus {
  outline: 3px solid rgba(255,45,85,0.95);
  outline-offset: 4px;
  box-shadow: 0 0 0 6px rgba(255,45,85,0.18);
}

.temporada-tab:focus {
  background: rgba(255,45,85,0.28);
  border-color: rgba(255,45,85,0.75);
}

.episodio-detalle-actions button:focus,
.detalle-actions button:focus,
.btn-volver:focus {
  transform: scale(1.03);
}

/* PLAYER FULLSCREEN */

.player-body {
  margin: 0;
  background: #000;
  color: #ffffff;
  overflow: hidden;
}

.player-page {
  width: 100vw;
  height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(255,45,85,0.18), transparent 32%),
    radial-gradient(circle at bottom right, rgba(140,46,255,0.16), transparent 36%),
    #000;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.player-topbar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  padding: 26px 34px;
  display: flex;
  align-items: center;
  gap: 20px;
  z-index: 5;
  background: linear-gradient(180deg, rgba(0,0,0,0.88), transparent);
}

.player-topbar h1 {
  margin: 0;
  font-size: 24px;
}

.player-topbar p {
  margin: 5px 0 0;
  color: #bfc4d0;
  font-size: 14px;
}

.player-back {
  border: 1px solid rgba(255,255,255,0.18);
  background: rgba(255,255,255,0.10);
  color: white;
  border-radius: 999px;
  padding: 12px 18px;
  cursor: pointer;
  font-weight: 800;
}

.player-back:hover,
.player-back:focus {
  outline: 3px solid rgba(255,45,85,0.95);
  outline-offset: 4px;
  background: rgba(255,45,85,0.28);
}

.player-video {
  width: 100vw;
  height: 100vh;
  background: #000;
  object-fit: contain;
}

.player-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  text-align: center;
  color: #ffffff;
}

.player-loading p {
  margin: 0;
  font-size: 22px;
  font-weight: 900;
}

.player-loading span {
  color: #bfc4d0;
  font-size: 15px;
}

.player-spinner {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  border: 5px solid rgba(255,255,255,0.18);
  border-top-color: #ff2d55;
  animation: playerSpin 0.9s linear infinite;
}

@keyframes playerSpin {
  to {
    transform: rotate(360deg);
  }
}

.player-error {
  max-width: 620px;
  padding: 22px 26px;
  border-radius: 18px;
  background: rgba(255,75,75,0.14);
  border: 1px solid rgba(255,75,75,0.45);
  color: #ffb4b4;
  font-weight: 800;
  text-align: center;
}

@media (max-width: 760px) {
  .player-topbar {
    padding: 18px 16px;
  }

  .player-topbar h1 {
    font-size: 18px;
  }

  .player-back {
    padding: 10px 14px;
  }

  .player-loading p {
    font-size: 18px;
  }
}

/* SIGUIENTE EPISODIO */

.next-episode-overlay {
  position: absolute;
  inset: 0;
  z-index: 20;
  background:
    radial-gradient(circle at top right, rgba(255,45,85,0.18), transparent 34%),
    linear-gradient(180deg, rgba(0,0,0,0.88), rgba(0,0,0,0.96));
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.next-episode-card {
  width: min(620px, 92vw);
  background: rgba(15,18,28,0.94);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 26px;
  padding: 34px;
  box-shadow: 0 24px 70px rgba(0,0,0,0.55);
  text-align: center;
}

.next-episode-label {
  margin: 0 0 10px;
  color: #ff2d55;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 13px;
}

.next-episode-card h2 {
  margin: 0;
  font-size: 30px;
}

.next-episode-card p {
  color: #bfc4d0;
}

.next-episode-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-top: 22px;
  flex-wrap: wrap;
}

.next-episode-actions button {
  border: none;
  border-radius: 999px;
  padding: 13px 20px;
  cursor: pointer;
  font-weight: 900;
  background: #ffffff;
  color: #080a0f;
}

.next-episode-actions button.secondary {
  background: rgba(255,255,255,0.10);
  color: #ffffff;
  border: 1px solid rgba(255,255,255,0.15);
}

.next-episode-actions button:focus {
  outline: 3px solid rgba(255,45,85,0.95);
  outline-offset: 4px;
}

/* PROGRESO POR EPISODIO */

.episodio-detalle-card.episodio-visto {
  border-color: rgba(80, 220, 130, 0.35);
  background: rgba(80, 220, 130, 0.06);
}

.episodio-detalle-card.episodio-iniciado {
  border-color: rgba(255, 45, 85, 0.45);
  background: rgba(255, 45, 85, 0.06);
}

.episodio-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.episodio-title-row h4 {
  margin: 0;
}

.episodio-estado {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  border-radius: 999px;
  padding: 5px 9px;
  font-size: 11px;
  font-weight: 900;
}

.episodio-estado.visto {
  background: rgba(80, 220, 130, 0.16);
  color: #85f0aa;
  border: 1px solid rgba(80, 220, 130, 0.32);
}

.episodio-estado.iniciado {
  background: rgba(255, 45, 85, 0.16);
  color: #ff8aa1;
  border: 1px solid rgba(255, 45, 85, 0.32);
}

.episodio-estado.no-visto {
  background: rgba(255,255,255,0.08);
  color: #bfc4d0;
  border: 1px solid rgba(255,255,255,0.10);
}

.episodio-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.episodio-progress-bar {
  width: 100%;
  height: 5px;
  background: rgba(255,255,255,0.16);
  border-radius: 999px;
  overflow: hidden;
  margin-top: 9px;
}

.episodio-progress-fill {
  height: 100%;
  background: linear-gradient(135deg, #ff1648, #8c2eff);
  border-radius: 999px;
}

.btn-play-start-episodio {
  background: rgba(255,255,255,0.12) !important;
}

@media (max-width: 850px) {
  .episodio-detalle-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .episodio-detalle-actions button {
    width: 100%;
  }
}

@media (max-width: 760px) {
  .episodio-detalle-actions button:focus,
  .detalle-actions button:focus,
  .btn-volver:focus {
    transform: none;
  }
}