/* ==============================================================================
   💃 APRENDE SALSA - SISTEMA DE DISEÑO "LUZ & CALIDEZ"
   Inspirado en la paleta limpia, accesible y moderna de SismosRD.
   ============================================================================== */

:root {
  /* Lienzo y Superficies Principales */
  --bg-app: #f8fafc;
  --bg-surface: #ffffff;
  --bg-surface-glass: rgba(255, 255, 255, 0.94);
  --bg-card: #ffffff;
  --bg-subtle: #f1f5f9;

  /* Bordes y Líneas */
  --border-subtle: #e2e8f0;
  --border-color: #e2e8f0;
  --border-focus: #e11d48;

  /* Textos de Alto Contraste (WCAG AAA) */
  --text-main: #0f172a;       /* Slate 900 */
  --text-muted: #475569;      /* Slate 600 */
  --text-light: #64748b;      /* Slate 500 */
  --text-inverse: #ffffff;

  /* Identidad Salsa & Acentos SismosRD */
  --primary-salsa: #e11d48;    /* Rojo carmesí vibrante */
  --primary-hover: #be123c;
  --primary-light: #ffe4e6;    /* Fondo suave rosado/rojo */
  --primary-border: #fecdd3;

  --sismos-blue: #0284c7;      /* Azul Caribe de SismosRD */
  --sismos-blue-hover: #0369a1;
  --sismos-blue-light: #e0f2fe;

  --gold-accent: #d97706;      /* Ámbar cálido */
  --gold-light: #fef3c7;       /* Fondo suave ámbar */
  --gold-border: #fde68a;

  --emerald-accent: #059669;   /* Verde tranquilidad / WhatsApp */
  --emerald-light: #d1fae5;
  --emerald-text: #065f46;

  --cyan-accent: #0284c7;

  /* Sombras Multidimensionales */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 14px rgba(15, 23, 42, 0.07);
  --shadow-lg: 0 10px 25px -4px rgba(15, 23, 42, 0.1);
  --shadow-float: 0 14px 34px rgba(15, 23, 42, 0.12);

  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 20px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

body {
  background-color: var(--bg-app);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding-bottom: 85px; /* Espacio para el footer toolbar */
  -webkit-font-smoothing: antialiased;
}

/* ================= ENCABEZADO CON LOGO CONFIGURABLE ================= */
.header-escuela {
  background: var(--bg-surface-glass);
  border-bottom: 1px solid var(--border-subtle);
  padding: 0.85rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
}

.brand-wrapper {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  text-decoration: none;
  color: var(--text-main);
}

.brand-logo-img {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  object-fit: cover;
  border: 2px solid var(--primary-salsa);
  box-shadow: 0 2px 8px rgba(225, 29, 72, 0.25);
}

.brand-text h1 {
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-main);
}

.brand-text p {
  font-size: 0.75rem;
  color: var(--text-light);
  font-weight: 500;
}

.btn-admin-gear {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  padding: 0.45rem 0.85rem;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: var(--shadow-sm);
}

.btn-admin-gear:hover {
  background: var(--primary-salsa);
  color: white;
  border-color: var(--primary-salsa);
  box-shadow: 0 2px 8px rgba(225, 29, 72, 0.25);
}

/* ================= BOTONES DE CABECERA (UNIFORMES & DISTINTIVOS) ================= */
.btn-header-nav {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  width: 104px;
  min-width: 104px;
  max-width: 104px;
  height: 36px;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 700;
  text-decoration: none;
  box-sizing: border-box;
  white-space: nowrap;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.btn-header-nav:hover {
  transform: translateY(-1px);
}

.btn-header-login {
  background: var(--sismos-blue, #0284c7);
  color: #ffffff !important;
  border: 1.5px solid var(--sismos-blue, #0284c7);
  box-shadow: 0 2px 6px rgba(2, 132, 199, 0.25);
}

.btn-header-login:hover {
  background: var(--sismos-blue-hover, #0369a1);
  border-color: var(--sismos-blue-hover, #0369a1);
  color: #ffffff !important;
  box-shadow: 0 4px 10px rgba(2, 132, 199, 0.35);
}

.btn-header-registro {
  background: var(--primary-salsa, #e11d48);
  color: #ffffff !important;
  border: 1.5px solid var(--primary-salsa, #e11d48);
  box-shadow: 0 2px 6px rgba(225, 29, 72, 0.25);
}

.btn-header-registro:hover {
  background: var(--primary-hover, #be123c);
  border-color: var(--primary-hover, #be123c);
  color: #ffffff !important;
  box-shadow: 0 4px 10px rgba(225, 29, 72, 0.35);
}

.btn-header-admin {
  background: #0f172a;
  color: #38bdf8 !important;
  border: 1.5px solid #38bdf8;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.2);
}

.btn-header-admin:hover {
  background: #1e293b;
  border-color: #7dd3fc;
  color: #7dd3fc !important;
  box-shadow: 0 4px 10px rgba(15, 23, 42, 0.35);
}

/* ================= CONTENEDOR PRINCIPAL ================= */
.main-wrapper {
  max-width: 980px;
  margin: 1.5rem auto;
  padding: 0 1rem;
  width: 100%;
  flex: 1;
}

/* ================= REPRODUCTOR DE VIDEO 16:9 ================= */
.video-card {
  background: var(--bg-surface);
  border-radius: var(--radius);
  border: 1.5px solid var(--border-subtle);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  margin-bottom: 1.5rem;
  transition: box-shadow 0.25s ease;
}

.video-card:hover {
  box-shadow: var(--shadow-lg);
}

.video-container {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000000;
}

.video-container iframe,
.video-container video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
}

/* ================= BARRA DE CONTROLES EXCLUSIVA DE LA ACADEMIA ================= */
.salsa-custom-player-bar {
  background: var(--bg-surface);
  border-top: 1.5px solid var(--border-subtle);
  border-bottom: 1.5px solid var(--border-subtle);
  padding: 0.75rem 1.25rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.player-bar-left,
.player-bar-right {
  display: flex;
  align-items: center;
}

.player-bar-center {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.slowmo-badge-title {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-main);
  white-space: nowrap;
}

.btn-player-action {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.95rem;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  border: 1.5px solid var(--border-subtle);
  background: var(--bg-surface);
  color: var(--text-main);
  transition: all 0.2s ease;
}

.btn-player-action:hover {
  background: var(--bg-subtle);
  border-color: #94a3b8;
}

.btn-play-pause {
  background: var(--primary-salsa);
  color: #ffffff;
  border-color: var(--primary-salsa);
}

.btn-play-pause:hover {
  background: #be123c;
  border-color: #be123c;
}

.btn-play-pause.is-playing {
  background: #0284c7;
  border-color: #0284c7;
}

.btn-fullscreen {
  background: #1e293b;
  color: #ffffff;
  border-color: #334155;
}

.btn-fullscreen:hover {
  background: #0f172a;
}

.btn-fullscreen.active-fullscreen {
  background: #e11d48;
  border-color: #e11d48;
}

/* Escudo superior antifuga de YouTube */
.video-top-shield {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 58px;
  z-index: 4;
  background: transparent;
  cursor: pointer;
}

/* Botón flotante central Play */
.video-center-play-btn {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 68px;
  height: 68px;
  border-radius: 50%;
  background: rgba(225, 29, 72, 0.9);
  color: #ffffff;
  border: 2px solid rgba(255, 255, 255, 0.85);
  font-size: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  transition: all 0.2s ease;
  z-index: 5;
  padding-left: 4px; /* Centrar triángulo visualmente */
}

.video-center-play-btn:hover {
  transform: translate(-50%, -50%) scale(1.1);
  background: #be123c;
}

/* Pantalla completa para el reproductor */
.video-card:fullscreen,
.video-card:-webkit-full-screen {
  background: #000000 !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: center !important;
  align-items: center !important;
  width: 100vw !important;
  height: 100vh !important;
  padding: 0 !important;
  margin: 0 !important;
  border-radius: 0 !important;
}

.video-card:fullscreen .video-container,
.video-card:-webkit-full-screen .video-container {
  width: 100% !important;
  height: calc(100vh - 75px) !important;
  max-height: 100vh !important;
  aspect-ratio: auto !important;
}

.video-card:fullscreen .salsa-custom-player-bar,
.video-card:-webkit-full-screen .salsa-custom-player-bar {
  width: 100% !important;
  max-width: 960px !important;
  background: rgba(15, 23, 42, 0.95) !important;
  backdrop-filter: blur(8px) !important;
  border-color: #334155 !important;
  padding: 0.5rem 1rem !important;
  border-radius: 12px !important;
  margin-bottom: 0.5rem !important;
  z-index: 9999 !important;
}

.video-card:fullscreen .slowmo-badge-title,
.video-card:-webkit-full-screen .slowmo-badge-title {
  color: #ffffff !important;
}

.video-card:fullscreen .clase-info,
.video-card:-webkit-full-screen .clase-info {
  display: none !important;
}

.slowmo-buttons {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.btn-speed {
  background: var(--bg-surface);
  border: 1.5px solid #cbd5e1;
  color: var(--text-muted);
  padding: 0.4rem 0.8rem;
  border-radius: 9999px; /* Formato pill-chip como en SismosRD */
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.18s ease;
  box-shadow: var(--shadow-sm);
}

.btn-speed:hover {
  background: var(--primary-light);
  border-color: var(--primary-salsa);
  color: var(--primary-salsa);
  transform: translateY(-1px);
}

.btn-speed.active {
  background: var(--primary-salsa);
  border-color: var(--primary-salsa);
  color: white;
  box-shadow: 0 2px 10px rgba(225, 29, 72, 0.35);
}

/* ================= DETALLES DE LA CLASE ================= */
.clase-info {
  padding: 1.5rem;
}

.clase-header-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.badge-nivel {
  background: var(--emerald-light);
  color: var(--emerald-text);
  border: 1px solid #a7f3d0;
  padding: 0.25rem 0.65rem;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.clase-num {
  color: var(--gold-accent);
  font-weight: 800;
  font-size: 0.9rem;
}

.clase-titulo {
  font-size: 1.55rem;
  font-weight: 800;
  margin-bottom: 0.75rem;
  color: var(--text-main);
  letter-spacing: -0.02em;
  line-height: 1.25;
}

.clase-descripcion {
  font-size: 0.96rem;
  line-height: 1.65;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
}

.clase-tips-box {
  background: var(--gold-light);
  border-left: 4px solid var(--gold-accent);
  padding: 0.95rem 1.2rem;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 0.9rem;
  color: #78350f;
  margin-bottom: 1.25rem;
  line-height: 1.55;
  border: 1px solid var(--gold-border);
  border-left: 4px solid var(--gold-accent);
}

.clase-tips-box strong {
  color: #92400e;
}

/* ================= BOTONES DE NAVEGACIÓN ENTRE CLASES ================= */
.nav-clases-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-top: 1rem;
}

.btn-nav-clase {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--bg-surface);
  border: 1.5px solid var(--border-color);
  color: var(--text-main);
  padding: 0.75rem 1.4rem;
  border-radius: 10px;
  font-weight: 700;
  text-decoration: none;
  font-size: 0.92rem;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: var(--shadow-sm);
}

.btn-nav-clase:hover:not(.disabled) {
  border-color: #cbd5e1;
  background: var(--bg-subtle);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn-nav-clase.disabled {
  opacity: 0.45;
  background: var(--bg-subtle);
  color: var(--text-light);
  border-color: var(--border-subtle);
  cursor: not-allowed;
  pointer-events: none;
}

/* ================= FOOTER TOOLBAR FIJO INFERIOR ================= */
.footer-toolbar {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background: var(--bg-surface-glass);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--border-subtle);
  display: flex;
  justify-content: space-around;
  padding: 0.65rem 0.5rem;
  z-index: 200;
  box-shadow: 0 -4px 20px rgba(15, 23, 42, 0.08);
}

.tool-btn {
  background: none;
  border: none;
  color: var(--text-light);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0.4rem 0.85rem;
  border-radius: 8px;
  transition: all 0.18s;
  text-decoration: none;
}

.tool-btn .icon {
  font-size: 1.3rem;
}

.tool-btn:hover,
.tool-btn.active {
  color: var(--primary-salsa);
  background: var(--primary-light);
}

.tool-btn.highlight {
  color: var(--gold-accent);
}

/* ================= MODALES ================= */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 500;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  max-width: 650px;
  width: 100%;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: var(--shadow-float);
  animation: modalFadeIn 0.2s ease;
}

@keyframes modalFadeIn {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: scale(1); }
}

.modal-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-surface);
}

.modal-header h3 {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--text-main);
}

.btn-close-modal {
  background: none;
  border: none;
  color: var(--text-light);
  font-size: 1.5rem;
  cursor: pointer;
  line-height: 1;
  border-radius: 6px;
  padding: 0 4px;
}

.btn-close-modal:hover { 
  color: var(--text-main); 
}

.modal-body {
  padding: 1.5rem;
  overflow-y: auto;
  background: var(--bg-surface);
}

/* ================= MÓDULO RITMO DEL "1" EN LA SALSA ================= */
.rhythm-container {
  text-align: center;
}

.beat-display-box {
  margin: 1.5rem 0;
  min-height: 40px;
}

.beats-grid {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 0.5rem;
  margin: 1.5rem 0;
}

.beat-circle {
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--bg-subtle);
  border: 2px solid #cbd5e1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1rem;
  color: var(--text-light);
  transition: all 0.12s ease;
  box-shadow: var(--shadow-sm);
}

.beat-circle.beat-uno {
  border-color: var(--gold-accent);
  color: var(--gold-accent);
  background: var(--gold-light);
}

.beat-circle.beat-quiebre {
  border-color: var(--emerald-accent);
  color: var(--emerald-accent);
  background: rgba(16, 185, 129, 0.12);
  border-width: 2.5px;
  font-weight: 900;
}

.beat-circle.beat-cinco {
  border-color: var(--cyan-accent);
  color: var(--cyan-accent);
  background: var(--sismos-blue-light);
}

.beat-circle.beat-pausa {
  opacity: 0.45;
  border-style: dashed;
}

.beat-circle.active {
  transform: scale(1.18);
  background: var(--primary-salsa);
  border-color: var(--primary-salsa);
  color: #fff;
  box-shadow: 0 0 16px rgba(225, 29, 72, 0.7);
}

.beat-circle.beat-uno.active {
  background: var(--gold-accent);
  border-color: var(--gold-accent);
  color: #fff;
  box-shadow: 0 0 20px rgba(217, 119, 6, 0.8);
}

.beat-circle.beat-quiebre.active {
  background: var(--emerald-accent);
  border-color: var(--emerald-accent);
  color: #fff;
  box-shadow: 0 0 22px rgba(16, 185, 129, 0.9);
}

.btn-estilo {
  padding: 0.4rem 0.9rem;
  border-radius: 9999px;
  font-size: 0.78rem;
  font-weight: 700;
  border: 1.5px solid var(--border-subtle);
  background: var(--bg-surface);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-estilo:hover {
  border-color: var(--primary-salsa);
  color: var(--primary-salsa);
}

.btn-estilo.active {
  background: var(--primary-salsa);
  border-color: var(--primary-salsa);
  color: #fff;
  box-shadow: var(--shadow-sm);
}

/* ================= TARJETAS DE PROFESORES ================= */
.profesores-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.25rem;
}

.profesor-card {
  background: var(--bg-surface);
  border-radius: 12px;
  border: 1px solid var(--border-subtle);
  padding: 1.25rem;
  text-align: center;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.profesor-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: #cbd5e1;
}

.profesor-foto {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  object-fit: cover;
  margin: 0 auto 0.75rem;
  border: 3px solid var(--primary-salsa);
  box-shadow: 0 2px 8px rgba(225, 29, 72, 0.25);
}

.profesor-nombre {
  font-size: 1.1rem;
  font-weight: 800;
  margin-bottom: 0.2rem;
  color: var(--text-main);
}

.profesor-rol {
  font-size: 0.8rem;
  color: var(--primary-salsa);
  font-weight: 700;
  margin-bottom: 0.6rem;
}

.profesor-bio {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 1rem;
}

.btn-whatsapp {
  background: #25d366;
  color: #fff;
  font-weight: 700;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  text-decoration: none;
  font-size: 0.85rem;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  box-shadow: 0 2px 6px rgba(37, 211, 102, 0.3);
  transition: all 0.15s ease;
}

.btn-whatsapp:hover { 
  background: #20ba5a;
  transform: translateY(-1px);
}

/* ================= DRAG AND DROP ADMIN & TARJETAS ================= */
.admin-card-clase {
  background: var(--bg-surface);
  border: 1.5px solid var(--border-subtle);
  border-radius: 12px;
  padding: 0.95rem 1.15rem;
  margin-bottom: 0.75rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  cursor: grab;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: var(--shadow-sm);
  width: 100%;
  box-sizing: border-box;
}

.admin-card-clase:hover {
  border-color: #cbd5e1;
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.admin-card-clase:active { 
  cursor: grabbing; 
}

.admin-card-clase.drag-over {
  border-color: var(--primary-salsa);
  background: var(--primary-light);
  transform: translateY(-2px);
}

.admin-card-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex: 1;
  min-width: 0;
}

.clase-drag-handle {
  color: var(--text-light);
  font-size: 1.3rem;
  line-height: 1;
  cursor: grab;
  user-select: none;
  padding: 0.25rem 0.4rem;
  flex-shrink: 0;
}

.admin-card-text {
  flex: 1;
  min-width: 0;
}

.clase-num-badge {
  color: var(--gold-accent);
  font-weight: 800;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.admin-clase-titulo {
  font-size: 1.02rem;
  font-weight: 700;
  margin: 0.2rem 0 0.35rem 0;
  color: var(--text-main);
  line-height: 1.3;
}

.admin-clase-meta {
  display: flex;
  gap: 0.45rem;
  align-items: center;
  flex-wrap: wrap;
}

.meta-chip {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  padding: 0.2rem 0.55rem;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.admin-card-actions {
  display: flex;
  gap: 0.4rem;
  align-items: center;
  flex-shrink: 0;
}

.btn-card-action {
  padding: 0.42rem 0.8rem;
  font-size: 0.82rem;
  border-radius: 8px;
}

.btn-edit-card {
  background: var(--sismos-blue-light);
  color: var(--sismos-blue);
  border: 1px solid #bae6fd;
}

.btn-edit-card:hover {
  background: #bae6fd;
  color: #0369a1;
}

/* ================= BOTONES Y CONTROLES ================= */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 1.1rem;
  border-radius: 8px;
  font-weight: 700;
  font-size: 0.88rem;
  cursor: pointer;
  border: none;
  text-decoration: none;
  transition: all 0.18s ease;
  box-shadow: var(--shadow-sm);
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-emerald { 
  background: var(--emerald-accent); 
  color: white; 
}
.btn-emerald:hover { 
  background: #047857; 
}

.btn-danger { 
  background: #ef4444; 
  color: white; 
}
.btn-danger:hover { 
  background: #dc2626; 
}

.btn-primary { 
  background: var(--primary-salsa); 
  color: white; 
}
.btn-primary:hover { 
  background: var(--primary-hover); 
  box-shadow: 0 4px 12px rgba(225, 29, 72, 0.3);
}

.btn-secondary {
  background: var(--bg-surface);
  color: var(--text-main);
  border: 1.5px solid var(--border-color);
}
.btn-secondary:hover {
  background: var(--bg-subtle);
  border-color: #cbd5e1;
}

/* ================= FORMULARIOS E INPUTS ================= */
input[type="text"],
input[type="password"],
input[type="file"],
select,
textarea {
  font-family: inherit;
  font-size: 0.9rem;
  color: var(--text-main) !important;
  background-color: var(--bg-surface) !important;
  border: 1.5px solid var(--border-color) !important;
  border-radius: var(--radius-sm);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

input[type="text"]:focus,
input[type="password"]:focus,
input[type="file"]:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--primary-salsa) !important;
  box-shadow: 0 0 0 3px rgba(225, 29, 72, 0.15);
}

/* ==============================================================================
   6. BOTÓN FAVORITO & GESTIÓN DE CLASES DE INTERÉS (UX LOCAL)
   ============================================================================== */
.btn-favorito {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: var(--bg-surface);
  border: 1.5px solid #cbd5e1;
  color: var(--text-muted);
  padding: 0.28rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: var(--shadow-sm);
  outline: none;
}

.btn-favorito:hover {
  background: var(--gold-light);
  border-color: var(--gold-border);
  color: #92400e;
  transform: translateY(-1px);
}

.btn-favorito .fav-icon {
  font-size: 0.95rem;
  line-height: 1;
  color: #94a3b8;
  transition: transform 0.2s ease, color 0.2s ease;
}

.btn-favorito.active {
  background: #fef3c7;
  border-color: #f59e0b;
  color: #b45309;
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.25);
}

.btn-favorito.active .fav-icon {
  color: #d97706;
  transform: scale(1.15);
}

.fav-device-notice {
  font-size: 0.76rem;
  color: #92400e;
  background: #fffbeb;
  border: 1px solid #fde68a;
  padding: 0.35rem 0.75rem;
  border-radius: 6px;
  margin-top: 0.5rem;
  display: inline-block;
  animation: fadeInNotice 0.25s ease-out;
}

@keyframes fadeInNotice {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ================= BANNER: CONTINUAR VIENDO ================= */
.banner-continuar {
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  color: #ffffff;
  padding: 0.65rem 1.25rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.15);
  position: relative;
  z-index: 90;
  animation: slideDownBanner 0.3s ease-out;
}

@keyframes slideDownBanner {
  from { transform: translateY(-100%); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.banner-continuar-inner {
  max-width: 900px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.banner-continuar-info {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-size: 0.88rem;
}

.badge-continuar {
  background: var(--primary-salsa);
  color: #ffffff;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 0.2rem 0.55rem;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.banner-continuar-text strong {
  color: #fde047;
}

.banner-continuar-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-continuar-link {
  background: var(--emerald-accent);
  color: #ffffff;
  text-decoration: none;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 0.35rem 0.85rem;
  border-radius: 6px;
  transition: all 0.15s ease;
  box-shadow: 0 2px 6px rgba(5, 150, 105, 0.3);
}

.btn-continuar-link:hover {
  background: #047857;
  transform: translateY(-1px);
}

.btn-close-banner {
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
  transition: color 0.15s ease;
}

.btn-close-banner:hover {
  color: #ffffff;
}

/* ================= PESTAÑAS Y ELEMENTOS DEL MODAL CATÁLOGO ================= */
.catalogo-tabs-bar {
  display: flex;
  gap: 0.5rem;
  background: var(--bg-subtle);
  padding: 0.3rem;
  border-radius: 10px;
  margin-bottom: 0.65rem;
}

.tab-cat-btn {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.84rem;
  font-weight: 700;
  padding: 0.55rem 0.75rem;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.18s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
}

.tab-cat-btn.active {
  background: var(--bg-surface);
  color: var(--text-main);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-subtle);
}

.tab-cat-btn:hover:not(.active) {
  color: var(--text-main);
}

.catalogo-disclaimer {
  font-size: 0.76rem;
  color: var(--text-light);
  margin-bottom: 0.85rem;
  padding: 0.35rem 0.65rem;
  background: #f8fafc;
  border-left: 3px solid var(--gold-accent);
  border-radius: 0 4px 4px 0;
}

.badge-ultima-vista {
  position: absolute;
  top: 6px;
  left: 6px;
  background: rgba(2, 132, 199, 0.94);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.4);
  font-size: 0.62rem;
  font-weight: 800;
  padding: 0.15rem 0.42rem;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 4;
  line-height: 1.1;
  pointer-events: none;
}

.badge-fav-tag {
  position: absolute;
  top: 6px;
  right: 6px;
  background: rgba(245, 158, 11, 0.94);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.4);
  font-size: 0.65rem;
  font-weight: 800;
  padding: 0.15rem 0.38rem;
  border-radius: 4px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 4;
  line-height: 1.1;
  pointer-events: none;
}

.empty-favoritos-state {
  text-align: center;
  padding: 2.5rem 1.5rem;
  background: #fcfcfd;
  border: 1.5px dashed var(--border-subtle);
  border-radius: var(--radius-sm);
  margin: 0.5rem 0;
}

/* ==============================================================================
   7. DISEÑO RESPONSIVE MÓVIL (PANTALLAS <= 640px)
   Asegura visualización perfecta en celulares Android / iOS.
   ============================================================================== */
@media (max-width: 640px) {
  body {
    padding-bottom: 95px;
  }

  .main-wrapper {
    padding: 0.85rem 0.65rem !important;
  }

  .header-escuela {
    padding: 0.65rem 0.85rem;
  }

  .brand-text h1 {
    font-size: 1.05rem;
  }

  .brand-text p {
    font-size: 0.72rem;
  }

  .header-user-actions {
    gap: 0.3rem !important;
  }

  .btn-header-nav {
    width: 94px !important;
    min-width: 94px !important;
    max-width: 94px !important;
    height: 34px !important;
    font-size: 0.76rem !important;
    padding: 0 0.25rem !important;
  }

  /* Barra superior Admin */
  .admin-top-bar {
    flex-direction: column;
    align-items: stretch !important;
    gap: 0.85rem !important;
  }

  .admin-top-title {
    font-size: 1.3rem !important;
  }

  .admin-top-actions {
    display: grid !important;
    grid-template-columns: 1fr 1fr;
    gap: 0.4rem !important;
  }

  .admin-top-actions button:last-child {
    grid-column: 1 / -1;
  }

  /* Contenedor de la lista de clases */
  .admin-section-box {
    padding: 0.85rem 0.65rem !important;
    border-radius: 10px !important;
  }

  /* Tarjeta de clase en móvil: flujo vertical con botones 100% visibles */
  .admin-card-clase {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
    padding: 0.85rem;
  }

  .admin-card-header {
    align-items: flex-start;
    width: 100%;
  }

  .clase-drag-handle {
    margin-top: 0.15rem;
    font-size: 1.4rem;
    padding: 0.2rem 0.35rem;
  }

  .admin-clase-titulo {
    font-size: 0.96rem;
    line-height: 1.35;
    word-break: break-word;
  }

  .admin-clase-meta {
    gap: 0.35rem;
    margin-top: 0.35rem;
  }

  .meta-chip {
    font-size: 0.72rem;
    padding: 0.18rem 0.45rem;
  }

  .admin-card-actions {
    width: 100%;
    padding-top: 0.65rem;
    border-top: 1px dashed var(--border-subtle);
    display: flex;
    gap: 0.45rem;
  }

  .btn-card-action {
    flex: 1;
    justify-content: center;
    text-align: center;
    padding: 0.52rem 0.4rem;
    font-size: 0.82rem;
  }

  form:has(.btn-del) {
    flex: 0 0 46px;
  }

  .btn-card-action.btn-del {
    flex: 0 0 46px;
    width: 46px;
    padding: 0.52rem 0;
  }

  /* Toolbar inferior fija: prevenir que la barra de navegación de Android recorte el texto */
  .footer-toolbar {
    padding: 0.45rem 0.2rem calc(0.55rem + env(safe-area-inset-bottom, 0px));
  }

  .tool-btn {
    padding: 0.25rem 0.35rem;
    font-size: 0.68rem;
    gap: 0.18rem;
    flex: 1;
    text-align: center;
  }

  .tool-btn .icon {
    font-size: 1.2rem;
  }

  /* Responsive para el reproductor limpio de video */
  .salsa-custom-player-bar {
    padding: 0.6rem 0.75rem;
    gap: 0.6rem;
  }

  .player-bar-left {
    order: 1;
    flex: 1;
  }

  .player-bar-right {
    order: 2;
    flex: 1;
    justify-content: flex-end;
  }

  .player-bar-center {
    order: 3;
    width: 100%;
    justify-content: center;
    padding-top: 0.4rem;
    border-top: 1px dashed var(--border-subtle);
  }

  .btn-player-action {
    width: 100%;
    justify-content: center;
    padding: 0.42rem 0.5rem;
    font-size: 0.8rem;
  }

  .slowmo-buttons {
    justify-content: center;
    width: 100%;
  }

  .btn-speed {
    padding: 0.35rem 0.65rem;
    font-size: 0.76rem;
  }
}

/* ==============================================================================
   8. HINT FLOTANTE DE PANTALLA COMPLETA
   ============================================================================== */
.fullscreen-hint {
  position: absolute;
  top: 15px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(15, 23, 42, 0.94);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: #ffffff;
  padding: 0.6rem 1rem;
  border-radius: 9999px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.5), 0 8px 10px -6px rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  z-index: 10000;
  max-width: 90%;
  animation: slideDownHint 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  pointer-events: auto;
}

.fullscreen-hint.hint-closing {
  animation: fadeOutHint 0.3s ease-out forwards;
}

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

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

.fullscreen-hint-content {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: -0.01em;
}

.fullscreen-hint-icon {
  font-size: 1rem;
  flex-shrink: 0;
}

.fullscreen-hint-text {
  color: #f8fafc;
}

.btn-close-hint {
  background: rgba(255, 255, 255, 0.15);
  border: none;
  color: #ffffff;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  transition: background 0.15s, transform 0.15s;
  flex-shrink: 0;
}

.btn-close-hint:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: scale(1.1);
}

/* ==============================================================================
   9. TARJETAS DEL CATÁLOGO DE CLASES (ALTURA UNIFORME Y MINIATURA COMPACTA)
   ============================================================================== */
.catalogo-page-container {
  max-width: 1040px;
  margin: 0 auto;
  padding-bottom: 2rem;
}

.catalogo-page-header {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.25rem;
  box-shadow: var(--shadow-sm);
}

.catalogo-header-title {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.catalogo-header-icon {
  font-size: 2rem;
}

.catalogo-header-title h2 {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text-main);
  margin: 0;
}

.catalogo-header-title p {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin: 0.2rem 0 0 0;
}

.catalogo-page-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 0.85rem;
}

.lista-clases-catalogo {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

/* Tarjeta individual con altura uniforme estricta de 102px */
.card-clase-catalogo {
  display: flex !important;
  align-items: stretch !important;
  height: 102px !important;
  min-height: 102px !important;
  max-height: 102px !important;
  background: var(--bg-surface);
  border: 1.5px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  overflow: hidden;
  text-decoration: none;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-sizing: border-box;
}

.card-clase-catalogo:hover {
  border-color: var(--primary-salsa);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.card-cat-thumb {
  width: 96px;
  min-width: 96px;
  max-width: 96px;
  height: 100%;
  position: relative;
  background: #0f172a;
  overflow: hidden;
  flex-shrink: 0;
}

.card-cat-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease;
}

.card-clase-catalogo:hover .card-cat-thumb img {
  transform: scale(1.08);
}

.thumb-play-tag {
  position: absolute;
  bottom: 6px;
  right: 6px;
  background: rgba(15, 23, 42, 0.85);
  color: #ffffff;
  font-size: 0.65rem;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.card-cat-content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 0.55rem 0.85rem 0.55rem 0.75rem;
  box-sizing: border-box;
}

.card-cat-badges {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  white-space: nowrap;
  overflow: hidden;
  line-height: 1;
}

.badge-cat-num {
  color: var(--gold-accent);
  font-weight: 800;
  font-size: 0.75rem;
  text-transform: uppercase;
}

.badge-cat-nivel {
  background: #f1f5f9;
  color: #475569;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
}

.card-cat-titulo {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-main);
  margin: 0.15rem 0;
  line-height: 1.25;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
}

.card-cat-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 600;
}

.card-cat-duracion {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.card-cat-action {
  color: var(--primary-salsa);
  font-weight: 700;
  font-size: 0.75rem;
  opacity: 0.85;
}

.card-clase-catalogo:hover .card-cat-action {
  opacity: 1;
  transform: translateX(2px);
}

/* ==============================================================================
   10. TARJETAS BLOQUEADAS Y CONTROL DE ACCESO
   ============================================================================== */
.card-clase-catalogo.card-bloqueada {
  border-color: #cbd5e1;
  background: #f8fafc;
}

.card-clase-catalogo.card-bloqueada:hover {
  border-color: #e11d48;
  background: #ffffff;
}

.thumb-lock-overlay {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.65);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  backdrop-filter: blur(1.5px);
  -webkit-backdrop-filter: blur(1.5px);
}

.lock-center-icon {
  font-size: 1.4rem;
  color: #ffffff;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.6));
}

.badge-tag-bloqueo {
  font-size: 0.64rem;
  font-weight: 800;
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  line-height: 1.1;
  text-transform: uppercase;
  letter-spacing: 0.01em;
}

.badge-tag-app {
  background: #e0f2fe;
  color: #0369a1;
  border: 1px solid #bae6fd;
}

.badge-tag-mensual {
  background: #f3e8ff;
  color: #7e22ce;
  border: 1px solid #e9d5ff;
}

.badge-tag-taller {
  background: #fef3c7;
  color: #b45309;
  border: 1px solid #fde68a;
}

.badge-tag-desbloqueado {
  background: #ecfdf5;
  color: #065f46;
  border: 1px solid #a7f3d0;
  font-size: 0.64rem;
  font-weight: 700;
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
}

.card-action-lock {
  color: #e11d48 !important;
  font-weight: 800 !important;
}

/* Pantalla de bloqueo sobre el video player */
.video-locked-cover {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at center, #1e293b 0%, #0f172a 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  text-align: center;
  z-index: 5;
}

.locked-cover-inner {
  max-width: 480px;
}
