/* ================================================================
   RUMBA SALSA STUDIO — global.css
   Mobile-First fixes: login, catálogo, grids, formularios
   Incluir en TODAS las páginas:
   <link rel="stylesheet" href="/assets/css/global.css">
   ================================================================ */

/* ── VARIABLES ── */
:root {
  --teal:     #00d4d4;
  --teal-dim: rgba(0,212,212,.1);
  --teal-glow:rgba(0,212,212,.4);
  --mag:      #e91e8c;
  --mag-dim:  rgba(233,30,140,.1);
  --pur:      #7b2d8b;
  --gold:     #f5c842;
  --green:    #22c55e;
  --red:      #ef4444;
  --carbon:   #060608;
  --surface:  rgba(255,255,255,.04);
  --surface2: rgba(255,255,255,.07);
  --border:   rgba(255,255,255,.08);
  --border2:  rgba(255,255,255,.14);
  --text:     #fff;
  --muted:    rgba(255,255,255,.55);
  --dim:      rgba(255,255,255,.28);
  --font:     'Outfit', sans-serif;
  --display:  'Bebas Neue', sans-serif;
  --r:        10px;
  --tap:      44px; /* touch target mínimo */
}

/* ── RESET MOBILE-SAFE ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { background: var(--carbon); color: var(--text); font-family: var(--font); overflow-x: hidden; }
img, video { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; -webkit-tap-highlight-color: transparent; }
button { font-family: var(--font); cursor: pointer; -webkit-tap-highlight-color: transparent; touch-action: manipulation; }

/* ── 1. LOGIN — FIX BOTÓN CORTADO EN MÓVIL ── */
.login-body {
  /* min-height:100vh falla en Chrome móvil (barra de URL) */
  min-height: 100%;
  min-height: 100dvh; /* dynamic viewport — correcto */
  display: flex;
  align-items: flex-start; /* no center: evita que el form quede debajo de la barra */
  justify-content: center;
  padding: 1.5rem 1rem;
  overflow-y: auto;           /* scroll si el form no cabe */
  -webkit-overflow-scrolling: touch;
  background: var(--carbon);
}
/* Padding seguro para iPhone con notch */
@supports (padding: max(0px)) {
  .login-body {
    padding-top:    max(1.5rem, env(safe-area-inset-top));
    padding-bottom: max(1.5rem, env(safe-area-inset-bottom));
  }
}
.login-card {
  width: 100%;
  max-width: 420px;
  margin: auto 0; /* centrado vertical cuando hay espacio */
}
/* Inputs de login: 16px+ evita zoom en iOS */
.login-card input {
  font-size: 16px !important;
  min-height: var(--tap);
  -webkit-appearance: none;
}
/* Botón siempre visible */
.login-btn {
  width: 100%;
  min-height: 50px;
  font-size: 16px;
  margin-bottom: 1.25rem;
  touch-action: manipulation;
}

/* ── 2. FORMULARIOS — INPUTS TOUCH-FRIENDLY ── */
input, select, textarea {
  font-size: 16px; /* ≥16px evita zoom en iOS */
  font-family: var(--font);
  -webkit-appearance: none;
  appearance: none;
}
input, select { min-height: var(--tap); }
/* Select con flecha custom */
select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='rgba(255,255,255,.4)' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

/* Grids de formulario — colapsan a 1 col en móvil */
.f-row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.f-row3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }
@media (max-width: 560px) {
  .f-row2, .f-row3 { grid-template-columns: 1fr !important; }
}

/* ── 3. VIDEO GRID — 2 COLUMNAS EN MÓVIL ── */
.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 10px;
}
/* Thumbnail 16/9 siempre */
.v-thumb {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #0a0810;
}
.v-thumb img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
@media (max-width: 540px) {
  .video-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }
  .v-body    { padding: 5px 7px; }
  .v-title   { font-size: 10px; }
  .v-tag     { font-size: 8px; padding: 1px 5px; }
}

/* ── 4. DATE STRIP — SCROLL HORIZONTAL TÁCTIL ── */
.cal-strip, .date-strip {
  display: flex;
  gap: 5px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding-bottom: 4px;
  scroll-snap-type: x mandatory;
}
.cal-strip::-webkit-scrollbar { display: none; }
.cal-day { scroll-snap-align: start; flex-shrink: 0; }

/* ── 5. STATS GRID — 2 COLUMNAS EN MÓVIL ── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
}
@media (max-width: 600px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
}

/* ── 6. BOTONES TÁCTILES ── */
.btn-primary, .btn-secondary, .btn-primary-admin, .btn-secondary-admin {
  min-height: var(--tap);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 18px;
  border-radius: var(--r);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: .04em;
  transition: transform .15s, opacity .15s;
  touch-action: manipulation;
  white-space: nowrap;
}
.btn-primary, .btn-primary-admin {
  background: linear-gradient(135deg, var(--teal), #008080);
  color: #060608;
  border: none;
  box-shadow: 0 0 16px var(--teal-glow);
}
.btn-secondary, .btn-secondary-admin {
  background: var(--surface2);
  border: 1px solid var(--border2);
  color: var(--muted);
}
.btn-primary:hover, .btn-primary-admin:hover { transform: translateY(-1px); opacity: .92; }

/* Botones pequeños — nunca desbordan */
.btn-sm {
  min-height: 36px;
  padding: 5px 11px;
  border-radius: 6px;
  font-size: 12px;
  border: 1px solid var(--border2);
  background: var(--surface);
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all .15s;
  white-space: nowrap;
}
.btn-sm:hover { background: var(--surface2); color: var(--text); }
.btn-sm.danger { border-color: rgba(239,68,68,.3); color: #f87171; }

/* Contenedores de acciones — no desbordan en móvil */
.ic-actions, .td-actions, .ev-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

/* ── 7. MODALES — BOTTOM SHEET EN MÓVIL ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.8);
  z-index: 200;
  display: none;
  align-items: flex-end;
  justify-content: center;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.modal-overlay.open { display: flex; }
.modal {
  background: #0d0b18;
  border: 1px solid var(--border2);
  border-radius: 18px 18px 0 0;
  padding: 1.75rem 1.25rem calc(1.75rem + env(safe-area-inset-bottom));
  width: 100%;
  max-height: 92vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  animation: slideUp .3s cubic-bezier(.4,0,.2,1);
}
@keyframes slideUp { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
@media (min-width: 600px) {
  .modal-overlay { align-items: center; padding: 1rem; }
  .modal { border-radius: 18px; max-width: 520px; }
}

/* ── 8. TABLA ADMIN → CARDS EN MÓVIL ── */
@media (max-width: 640px) {
  .admin-table thead            { display: none; }
  .admin-table, .admin-table tbody,
  .admin-table tr, .admin-table td { display: block; width: 100%; }
  .admin-table tr {
    border: 1px solid var(--border);
    border-radius: var(--r);
    background: var(--surface);
    margin-bottom: 8px;
    padding: .75rem 1rem;
  }
  .admin-table td {
    padding: .25rem 0;
    border: none;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
  }
  .admin-table td[data-label]::before {
    content: attr(data-label);
    font-size: 9px;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--dim);
    min-width: 70px;
    flex-shrink: 0;
  }
}

/* ── 9. SIDEBAR ADMIN — HAMBURGER EN MÓVIL ── */
@media (max-width: 900px) {
  .admin-sidebar {
    display: none;
    position: fixed;
    inset-block: 0;
    left: 0;
    z-index: 380;
    width: 250px;
    background: rgba(6,6,8,.98);
    border-right: 1px solid var(--border);
    backdrop-filter: blur(20px);
  }
  .admin-sidebar.open { display: flex; flex-direction: column; }
  .sb-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.65); z-index: 370; }
  .sb-overlay.open { display: block; }
  .sb-hamburger { display: flex !important; }
  .admin-main  { padding-top: 3.5rem !important; }
}

/* ── 10. SAFE AREA iOS NOTCH ── */
@supports (padding: max(0px)) {
  .navbar         { padding-top: max(.7rem, env(safe-area-inset-top)); }
  body            { padding-bottom: env(safe-area-inset-bottom); }
  .admin-sidebar  { padding-bottom: env(safe-area-inset-bottom); }
}

/* ── 11. CATEGORÍAS DE BAILE — solo 4 ── */
/* Los filtros deben mostrar SOLO: Cumbia, Bachata, Salsa Cubana, Salsa */
/* Ocultar Zouk y Kizomba si aún existen en el DOM */
[data-genre="zouk"],
[data-genre="kizomba"],
option[value="zouk"],
option[value="kizomba"] {
  display: none !important;
}

/* ── 12. NEON GLOW EFFECTS ── */
.glow-teal { box-shadow: 0 0 20px var(--teal-glow); }
.glow-mag  { box-shadow: 0 0 20px rgba(233,30,140,.4); }
.text-teal { color: var(--teal); }
.text-mag  { color: var(--mag); }
.grad-text {
  background: linear-gradient(135deg, var(--teal), var(--mag));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ── 13. ALERTAS ── */
.alert       { padding: 10px 16px; border-radius: 8px; font-size: 13px; margin-bottom: 1rem; line-height: 1.5; }
.alert-ok    { background: rgba(34,197,94,.08); border: 1px solid rgba(34,197,94,.25); color: #4ade80; }
.alert-err   { background: rgba(239,68,68,.08); border: 1px solid rgba(239,68,68,.25); color: #f87171; }
.alert-warn  { background: rgba(245,200,66,.08); border: 1px solid rgba(245,200,66,.25); color: #f5c842; }

/* ── 14. SCROLL SUAVE GLOBAL ── */
::-webkit-scrollbar       { width: 4px; height: 4px; }
::-webkit-scrollbar-track  { background: transparent; }
::-webkit-scrollbar-thumb  { background: rgba(255,255,255,.12); border-radius: 2px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,.2); }

/* ── 15. PAGINACIÓN ── */
.pagination { display: flex; gap: 5px; margin-top: 1.25rem; flex-wrap: wrap; }
.page-btn   {
  padding: 6px 12px; border-radius: 6px; border: 1px solid var(--border);
  background: var(--surface); color: var(--muted); font-size: 12px;
  text-decoration: none; transition: all .15s;
}
.page-btn.active { background: var(--teal-dim); border-color: rgba(0,212,212,.4); color: var(--teal); }
.page-btn:hover  { color: var(--text); }

/* ════════════════════════════════════════════════════════════
   RESPONSIVE FRONTEND — TABLET · LAPTOP · DESKTOP
   Solo afecta pantallas > 768px. Móvil intacto.
   ════════════════════════════════════════════════════════════ */

/* ── Variables responsive ── */
@media (min-width: 768px) {
  :root {
    --nav-h: 58px;
    --content-max: 1200px;
    --section-pad: 2rem;
  }
}
@media (min-width: 1200px) {
  :root {
    --content-max: 1320px;
    --section-pad: 2.5rem;
  }
}

/* ── Contenedor central máximo ── */
.container,
.page-wrap,
.content-wrap {
  width: 100%;
  max-width: var(--content-max, 1200px);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--section-pad, 1rem);
  padding-right: var(--section-pad, 1rem);
  box-sizing: border-box;
}

/* ── Catálogo de videos en tablet/desktop ── */
@media (min-width: 768px) {
  .video-grid {
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)) !important;
    gap: 14px;
  }
}
@media (min-width: 1024px) {
  .video-grid {
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)) !important;
    gap: 16px;
  }
}
@media (min-width: 1280px) {
  .video-grid {
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)) !important;
  }
}

/* ── Stats grid frontend ── */
@media (min-width: 768px) {
  .stats-grid {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)) !important;
    gap: 14px;
  }
}
@media (min-width: 1200px) {
  .stats-grid {
    grid-template-columns: repeat(4, 1fr) !important;
  }
}

/* ── Formularios en 2 columnas en tablet+ ── */
@media (min-width: 640px) {
  .f-row2 { grid-template-columns: 1fr 1fr !important; }
  .f-row3 { grid-template-columns: 1fr 1fr 1fr !important; }
}

/* ── Navbar desktop ── */
@media (min-width: 900px) {
  .navbar {
    padding-left: 2rem;
    padding-right: 2rem;
  }
  /* Ocultar hamburger */
  .nav-hamburger,
  .sb-hamburger { display: none !important; }
}

/* ── Dashboard alumno desktop ── */
@media (min-width: 900px) {
  /* Sidebar del alumno siempre visible */
  .sidebar,
  .dash-sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
  }

  /* Layout del dashboard en 2 columnas */
  .dash-layout {
    display: grid;
    grid-template-columns: 240px 1fr;
    min-height: 100vh;
  }

  /* Contenido principal más ancho */
  .dash-main {
    padding: 1.5rem 2rem;
    overflow-y: auto;
    max-height: 100vh;
  }
}
@media (min-width: 1200px) {
  .dash-layout {
    grid-template-columns: 260px 1fr;
  }
  .dash-main {
    padding: 1.75rem 2.5rem;
  }
}

/* ── Cards y paneles en desktop ── */
@media (min-width: 768px) {
  .panel-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
  }
  .panel-grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
  }
}
@media (max-width: 767px) {
  .panel-grid-2,
  .panel-grid-3 {
    display: flex;
    flex-direction: column;
    gap: 10px;
  }
}

/* ── Tabla admin → responsive en tablet ── */
@media (min-width: 641px) and (max-width: 900px) {
  .admin-table th:nth-child(n+5),
  .admin-table td:nth-child(n+5) { display: none; }
}

/* ── Modales centrados en desktop ── */
@media (min-width: 600px) {
  .modal-overlay {
    align-items: center !important;
    padding: 1rem;
  }
  .modal {
    border-radius: 16px !important;
    max-width: 500px !important;
    padding: 2rem !important;
  }
}

/* ── Fix general: evitar scroll horizontal ── */
@media (min-width: 768px) {
  body { overflow-x: hidden; }
  .admin-main,
  .dash-main,
  .main-content { overflow-x: hidden; }
}

/* ── Tipografía escalada para desktop ── */
@media (min-width: 1200px) {
  html { font-size: 16px; }
}
@media (min-width: 768px) and (max-width: 1200px) {
  html { font-size: 15px; }
}
