/* Marca "Método Invisible": oscuro premium, acentos rojo neón, dragón. */

:root {
  --bg: #0a0a0f;
  --bg-2: #12121a;
  --card: #16161f;
  --border: #242430;
  --text: #f5f5f7;
  --muted: #9a9aa5;
  --red: #ff2d2d;
  --red-deep: #e50914;
  --glow: rgba(255, 45, 45, 0.35);
  --ok: #2ecc71;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background:
    radial-gradient(1200px 600px at 50% -10%, rgba(229, 9, 20, 0.12), transparent 60%),
    var(--bg);
  color: var(--text);
  font-family: 'Inter', system-ui, Arial, sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

h1, h2 { font-family: 'Rajdhani', system-ui, sans-serif; letter-spacing: 0.5px; }

.accent { color: var(--red); text-shadow: 0 0 18px var(--glow); }

/* --- Barra superior --- */
.nav {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 20px; border-bottom: 1px solid var(--border);
  background: rgba(10, 10, 15, 0.8); backdrop-filter: blur(8px);
  position: sticky; top: 0; z-index: 10;
}
.brand { font-family: 'Rajdhani', sans-serif; font-weight: 700; font-size: 20px;
  color: var(--text); text-decoration: none; display: inline-flex; align-items: center; gap: 9px; }
.brand-logo { height: 32px; width: auto; display: block;
  filter: drop-shadow(0 0 6px var(--glow)); }
.login-logo { width: 120px; height: auto; display: block; margin: 0 auto 4px;
  filter: drop-shadow(0 0 22px var(--glow)); }
.poster-logo { width: 74px; height: auto; opacity: .85; filter: drop-shadow(0 0 12px var(--glow)); }
.nav-right { display: flex; align-items: center; gap: 16px; }
.nav-email { color: var(--muted); font-size: 13px; }
.nav-link { color: var(--text); text-decoration: none; font-size: 14px;
  padding: 6px 12px; border: 1px solid var(--border); border-radius: 8px; }
.nav-link:hover { border-color: var(--red); color: var(--red); }

/* --- Contenedor --- */
.main { flex: 1; width: 100%; max-width: 920px; margin: 0 auto; padding: 32px 20px; }
.page-head { margin-bottom: 28px; }
.page-head h1 { font-size: 34px; margin: 0 0 6px; }
.sub { color: var(--muted); font-size: 15px; line-height: 1.5; margin: 0; }

.footer { text-align: center; color: var(--muted); font-size: 12px;
  padding: 24px; border-top: 1px solid var(--border); }

/* --- Tarjetas --- */
.card {
  background: var(--card); border: 1px solid var(--border); border-radius: 16px;
  padding: 28px; margin-bottom: 20px;
}

/* --- Login --- */
.login { max-width: 420px; margin: 8vh auto 0; text-align: center; }
.login h1 { font-size: 30px; margin: 8px 0 4px; }
.dragon { font-size: 52px; filter: drop-shadow(0 0 20px var(--glow)); }
.form { display: flex; flex-direction: column; gap: 12px; margin-top: 20px; }
input, textarea {
  background: var(--bg-2); border: 1px solid var(--border); color: var(--text);
  padding: 13px 15px; border-radius: 10px; font-size: 15px; font-family: inherit; width: 100%;
}
input:focus, textarea:focus { outline: none; border-color: var(--red); box-shadow: 0 0 0 3px var(--glow); }
button {
  background: linear-gradient(135deg, var(--red), var(--red-deep));
  color: #fff; border: none; padding: 13px 18px; border-radius: 10px;
  font-size: 15px; font-weight: 600; cursor: pointer; font-family: inherit;
  box-shadow: 0 6px 20px -6px var(--glow);
}
button:hover { filter: brightness(1.08); }
.hint { color: var(--muted); font-size: 13px; margin-top: 16px; }
.hint a { color: var(--red); }
.alert { background: rgba(255,45,45,.1); border: 1px solid rgba(255,45,45,.3);
  color: #ff8a8a; padding: 10px; border-radius: 10px; font-size: 14px; }
.ok { background: rgba(46,204,113,.1); border: 1px solid rgba(46,204,113,.3);
  color: #8ef0b4; padding: 12px; border-radius: 10px; font-size: 14px; }

.devbox { background: var(--bg-2); border: 1px dashed var(--red); border-radius: 12px;
  padding: 16px; margin: 16px 0; text-align: left; font-size: 13px; }
.devlink { color: var(--red); word-break: break-all; font-size: 12px; }

/* --- Modulos y clases --- */
.module { margin-bottom: 34px; }
.module h2 { font-size: 22px; margin: 0 0 4px; }
.module-desc { color: var(--muted); font-size: 14px; margin: 0 0 16px; }
.lessons { display: grid; gap: 12px; }
.lesson-card {
  display: flex; align-items: center; gap: 16px; text-decoration: none; color: var(--text);
  background: var(--card); border: 1px solid var(--border); border-radius: 14px; padding: 16px 18px;
  transition: border-color .15s, transform .15s;
}
.lesson-card:hover { border-color: var(--red); transform: translateX(3px); }
.play {
  width: 42px; height: 42px; flex: 0 0 42px; border-radius: 50%;
  display: grid; place-items: center; font-size: 14px; color: #fff;
  background: linear-gradient(135deg, var(--red), var(--red-deep));
  box-shadow: 0 0 16px -2px var(--glow);
}
.lesson-title { font-weight: 600; font-size: 16px; }
.lesson-desc { color: var(--muted); font-size: 13px; margin-top: 2px; }
.empty { color: var(--muted); font-style: italic; }

/* --- Tarjetas estilo Netflix --- */
.module-head { display: flex; align-items: center; gap: 16px; margin-bottom: 14px; }
.module-head-text { min-width: 0; }
.module-cover {
  width: 120px; height: 120px; flex: 0 0 120px; border-radius: 16px;
  background-size: cover; background-position: center;
  border: 1px solid var(--border); box-shadow: 0 6px 20px -8px rgba(0,0,0,.6);
}
.poster-grid {
  display: grid; gap: 16px;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
}

/* Página principal: grid de módulos con portada */
.modules-grid { display: grid; gap: 20px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.module-card {
  display: block; text-decoration: none; color: var(--text);
  background: var(--card); border: 1px solid var(--border); border-radius: 16px; overflow: hidden;
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.module-card:hover { transform: translateY(-4px); border-color: var(--red); box-shadow: 0 14px 34px -12px var(--glow); }
.module-card-cover {
  width: 100%; aspect-ratio: 16 / 9; background-size: cover; background-position: center; background-color: #000;
}
.module-card-cover.no-cover {
  display: grid; place-items: center;
  background: radial-gradient(120% 120% at 50% 0%, #2a0d12, #0a0a0f 70%);
}
.module-card-cover.no-cover .poster-logo { width: 88px; }
.module-card-body { padding: 14px 16px 16px; }
.module-card-title { font-family: 'Rajdhani', sans-serif; font-weight: 700; font-size: 19px; line-height: 1.15; }
.module-card-meta { color: var(--muted); font-size: 13px; margin-top: 3px; }

/* Página de un módulo: portada 16:9 completa (igual que la tarjeta) + título debajo */
.module-cover-full {
  width: 100%; aspect-ratio: 16 / 9; background-size: cover; background-position: center;
  background-color: #000; border-radius: 16px; border: 1px solid var(--border); margin: 12px 0 18px;
}
.module-head-text h1 { margin: 0 0 6px; }
.module-lessons { margin-top: 4px; }
.poster {
  position: relative; display: block; text-decoration: none; color: var(--text);
  aspect-ratio: 16 / 9; border-radius: 14px; overflow: hidden;
  background: #000; background-size: cover; background-position: center;
  border: 1px solid var(--border);
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.poster:hover { transform: scale(1.04); border-color: var(--red); box-shadow: 0 10px 30px -8px var(--glow); z-index: 2; }
.poster.no-cover {
  background: radial-gradient(120% 120% at 50% 0%, #2a0d12, #0a0a0f 70%);
  display: grid; place-items: center;
}
.poster-dragon { font-size: 54px; opacity: .5; filter: drop-shadow(0 0 16px var(--glow)); }
.poster-play {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center;
  background: rgba(229,9,20,.9); color: #fff; font-size: 16px; opacity: 0; transition: opacity .18s;
  box-shadow: 0 0 20px -2px var(--glow);
}
.poster:hover .poster-play { opacity: 1; }
.poster-overlay {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 14px 14px 12px;
  background: linear-gradient(to top, rgba(5,5,8,.92), rgba(5,5,8,.55) 55%, transparent);
}
.poster-title { font-weight: 600; font-size: 15px; line-height: 1.2; }
.poster-sub { color: var(--muted); font-size: 12px; margin-top: 3px; }

.cover-preview { width: 100%; max-width: 420px; border-radius: 12px; border: 1px solid var(--border); margin: 6px 0 12px; display: block; }
.cover-thumb { width: 90px; height: 50px; object-fit: cover; border-radius: 8px; border: 1px solid var(--border); }
.cover-row { flex-direction: row; align-items: center; flex-wrap: wrap; margin: 10px 0; }

/* --- Pagina de clase --- */
.back { color: var(--muted); text-decoration: none; font-size: 14px; }
.back:hover { color: var(--red); }
.lesson h1 { font-size: 28px; margin: 14px 0 20px; }
/* Video real (Vturb): usa su propia proporcion, sin recortes. */
.video-wrap {
  width: 100%; border-radius: 16px; overflow: hidden;
  background: #000; border: 1px solid var(--border);
}
.video-wrap :where(iframe, video) { width: 100%; display: block; }
/* Recuadro "sin video todavia": caja fija 16:9. */
.video-placeholder {
  position: relative; width: 100%; aspect-ratio: 16 / 9; border-radius: 16px; overflow: hidden;
  background: #000; border: 1px solid var(--border);
  display: grid; place-content: center; text-align: center; gap: 6px; color: var(--muted);
}
.video-placeholder code { color: var(--red); background: var(--bg-2); padding: 2px 6px; border-radius: 6px; }
.lesson-full-desc { color: var(--text); line-height: 1.6; margin-top: 20px; }
.inline-link { color: var(--red); text-decoration: underline; word-break: break-all; }
.inline-link:hover { filter: brightness(1.2); }
.resource { display: inline-block; margin-top: 16px; color: var(--red);
  border: 1px solid var(--border); padding: 10px 16px; border-radius: 10px; text-decoration: none; }
.resource:hover { border-color: var(--red); }

/* --- Panel admin --- */
.row-between { display: flex; justify-content: space-between; align-items: center; }
.check { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 14px; }
.check input { width: auto; }
.table { width: 100%; border-collapse: collapse; margin-top: 12px; font-size: 14px; }
.table th, .table td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--border); }
.table th { color: var(--muted); font-weight: 600; }
.tag { background: var(--bg-2); border: 1px solid var(--border); border-radius: 6px;
  padding: 2px 8px; font-size: 12px; color: var(--muted); }
.inline { display: inline; margin: 0; }
.mini { padding: 7px 12px; font-size: 13px; }

/* --- Gestion de contenido (admin) --- */
.field-label { display: block; color: var(--muted); font-size: 13px; margin: 6px 0 -4px; }
.form.compact { gap: 8px; margin-top: 12px; }
.form.compact.newmodule { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--border); }
.admin-module { border: 1px solid var(--border); border-radius: 12px; padding: 16px; margin: 14px 0; background: var(--bg-2); }
.admin-module h3 { margin: 0; font-size: 18px; }
.module-card-head { align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.rename-form { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; flex: 1 1 320px; }
.rename-form input { min-width: 150px; flex: 1 1 auto; }
.admin-lessons { display: grid; gap: 8px; margin: 10px 0; }
.admin-lesson { display: flex; justify-content: space-between; align-items: center; gap: 12px;
  background: var(--card); border: 1px solid var(--border); border-radius: 10px; padding: 10px 14px; font-size: 14px; }
.admin-lesson-actions { display: flex; gap: 8px; align-items: center; }
.admin-lesson-actions a.mini { text-decoration: none; display: inline-block; }
a.mini { background: linear-gradient(135deg, var(--red), var(--red-deep)); color: #fff;
  padding: 7px 12px; border-radius: 10px; font-size: 13px; text-decoration: none; }
.mini.danger, button.danger { background: #2a2a33; color: #ff8a8a; border: 1px solid #3a3a44; box-shadow: none; }
.mini.danger:hover, button.danger:hover { border-color: var(--red); }
.mt { margin-top: 22px; }
.admin-label { color: var(--muted); font-size: 13px; font-weight: 600; margin: 14px 0 7px; }
.admin-cover-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 10px; }
.admin-cover-row .admin-label { margin: 0; }
.add-class { margin-top: 12px; padding: 14px; border: 1px dashed var(--border);
  border-radius: 12px; background: rgba(255,255,255,.02); }
.add-class .admin-label { margin-top: 0; color: var(--text); }
.newmodule-box { margin-top: 22px; padding: 18px; border: 1px solid rgba(255,45,45,.4);
  border-radius: 14px; background: rgba(229,9,20,.06); }
.newmodule-box h3 { margin: 0 0 4px; font-size: 18px; }
.admin-edit { display: inline-block; margin-bottom: 14px; }
.lesson-subtitle { color: var(--muted); font-size: 16px; margin: -8px 0 16px; }
.resources-list { margin-top: 24px; }
.resources-list h3 { font-size: 18px; margin-bottom: 10px; }
.resources-list .resource { display: block; margin: 8px 0; }
input[type="file"] { padding: 10px; color: var(--muted); }

/* Zona de arrastrar y soltar */
.dropzone {
  display: flex; align-items: center; justify-content: center; text-align: center;
  min-height: 84px; padding: 16px; cursor: pointer;
  border: 2px dashed var(--border); border-radius: 12px; background: var(--bg-2);
  color: var(--muted); font-size: 14px; transition: border-color .15s, background .15s, color .15s;
}
.dropzone:hover { border-color: var(--red); color: var(--text); }
.dropzone.drag { border-color: var(--red); background: rgba(255,45,45,.08); color: var(--text); }
.dropzone .dz-text { pointer-events: none; }
.cover-row .dropzone { min-height: 56px; flex: 1; min-width: 220px; }

@media (max-width: 560px) {
  .page-head h1 { font-size: 27px; }
  .nav-email { display: none; }
  .admin-lesson { flex-direction: column; align-items: flex-start; }
}
