/* ==============================================================================
   💃 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);
}

/* ================= 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 SLOW MOTION ================= */
.slowmo-bar {
  background: var(--bg-app);
  padding: 0.85rem 1.25rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  border-top: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
}

.slowmo-label {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.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 {
  background: #e0f2fe;
  color: #0369a1;
  border: 1px solid #bae6fd;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.12rem 0.45rem;
  border-radius: 4px;
  text-transform: uppercase;
}

.badge-fav-tag {
  background: #fef3c7;
  color: #b45309;
  border: 1px solid #fde68a;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.12rem 0.45rem;
  border-radius: 4px;
}

.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;
  }

  /* 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;
  }
}
