/* ─── Variables & Reset ─────────────────────────────────────────── */
:root {
  --bg:       #0d0d09;
  --bg2:      #111110;
  --bg3:      #191917;
  --border:   #252520;
  --lime:     #c5f135;
  --lime-dim: #8aaa1f;
  --text:     #e8e4dc;
  --muted:    #5a5a50;
  --muted2:   #3a3a32;
  --red:      #e53e3e;
  --sidebar-w: 272px;
  --topbar-h:  52px;
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { height: 100%; font-size: 16px; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100%;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }

/* ─── Scrollbar ─────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #2a2a24; border-radius: 9px; }

/* ─── Login ─────────────────────────────────────────────────────── */
.auth-page { display: flex; align-items: center; justify-content: center; min-height: 100vh; }
.auth-box {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 40px;
  width: 360px;
}
.auth-title { font-size: 20px; font-weight: 700; margin-bottom: 24px; }
.auth-form { display: flex; flex-direction: column; gap: 16px; }
.auth-form label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--muted); }
.auth-form input {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 14px;
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: border-color .15s;
}
.auth-form input:focus { border-color: var(--lime-dim); }
.auth-error {
  background: rgba(229,62,62,.1);
  border: 1px solid rgba(229,62,62,.3);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 13px;
  color: #fc8181;
}
.btn-primary {
  background: var(--lime);
  color: #0d0d09;
  border: none;
  border-radius: 8px;
  padding: 11px 20px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: opacity .15s;
}
.btn-primary:hover { opacity: .88; }

/* ─── Brand ─────────────────────────────────────────────────────── */
.brand { display: flex; align-items: center; gap: 10px; }
.brand-icon { font-size: 20px; }
.brand-name { font-size: 15px; font-weight: 500; color: var(--text); }
.brand-name strong { font-weight: 800; }

/* ─── Global top bar ────────────────────────────────────────────── */
.site-header {
  height: var(--topbar-h);
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 20px;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 200;
}
.header-actions { margin-left: auto; display: flex; align-items: center; gap: 14px; }
.header-user { font-size: 13px; color: var(--muted); }
.header-link {
  font-size: 12px;
  color: var(--muted);
  padding: 5px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  transition: color .15s, border-color .15s;
}
.header-link:hover { color: var(--text); border-color: var(--muted2); }

/* ─── DASHBOARD ─────────────────────────────────────────────────── */
.dashboard-main { max-width: 960px; margin: 0 auto; padding: 48px 24px 80px; }
.dashboard-title { font-size: 26px; font-weight: 800; margin-bottom: 32px; letter-spacing: -.02em; }
.course-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; }
.course-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: border-color .2s, transform .2s;
}
.course-card:hover { border-color: var(--lime-dim); transform: translateY(-2px); }
.course-card-top {
  height: 130px;
  background: linear-gradient(135deg, #1a1f0a 0%, #0d0d09 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  border-bottom: 1px solid var(--border);
  font-size: 56px;
}
.course-card-body { padding: 20px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.course-category { font-size: 10px; font-weight: 700; color: var(--lime); text-transform: uppercase; letter-spacing: .1em; }
.course-title { font-size: 18px; font-weight: 800; letter-spacing: -.01em; }
.course-desc { font-size: 13px; color: var(--muted); line-height: 1.5; flex: 1; }
.course-meta { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted2); margin-top: 4px; }
.course-progress-bar { height: 3px; background: var(--bg3); border-radius: 99px; overflow: hidden; margin-top: 8px; }
.course-progress-fill { height: 100%; background: var(--lime); border-radius: 99px; transition: width .4s; }

/* ─── COURSE HOME ───────────────────────────────────────────────── */
.course-home-page { display: flex; height: 100vh; overflow: hidden; flex-direction: column; }
.course-home-body { display: flex; flex: 1; overflow: hidden; }

.course-sidebar {
  width: var(--sidebar-w);
  background: var(--bg2);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  flex-shrink: 0;
}
.cs-back {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 18px;
  font-size: 12px;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
  transition: color .15s;
}
.cs-back:hover { color: var(--text); }
.cs-nav-links { border-bottom: 1px solid var(--border); }
.cs-nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  transition: color .15s, background .15s;
}
.cs-nav-link:hover, .cs-nav-link.active { background: rgba(197,241,53,.06); color: var(--lime); }
.cs-modules-label {
  padding: 16px 18px 8px;
  font-size: 10px;
  font-weight: 700;
  color: var(--muted2);
  text-transform: uppercase;
  letter-spacing: .1em;
}
.cs-module-list { flex: 1; overflow-y: auto; padding-bottom: 16px; }
.cs-module-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 18px;
  font-size: 13px;
  color: var(--muted);
  transition: color .15s;
  text-decoration: none;
}
.cs-module-item:hover { color: var(--text); }
.cs-mod-num {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1.5px solid var(--muted2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 800;
  flex-shrink: 0;
  margin-top: 1px;
}
.cs-mod-info { flex: 1; min-width: 0; }
.cs-mod-title { font-weight: 600; line-height: 1.3; }
.cs-mod-meta { font-size: 11px; color: var(--muted2); margin-top: 2px; }
.cs-mod-badge {
  font-size: 10px;
  background: rgba(197,241,53,.08);
  color: var(--lime-dim);
  border: 1px solid rgba(197,241,53,.15);
  border-radius: 4px;
  padding: 2px 6px;
  font-weight: 700;
  flex-shrink: 0;
  align-self: flex-start;
  margin-top: 1px;
}

/* Course main */
.course-main { flex: 1; overflow-y: auto; }
.course-hero {
  position: relative;
  background: linear-gradient(180deg, #141a04 0%, var(--bg) 100%);
  padding: 48px 48px 40px;
  border-bottom: 1px solid var(--border);
  overflow: hidden;
}
.course-hero::after {
  content: '';
  position: absolute;
  top: -40px; right: -40px;
  width: 260px; height: 260px;
  background: radial-gradient(circle, rgba(197,241,53,.1) 0%, transparent 70%);
  pointer-events: none;
}
.hero-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  font-weight: 700;
  color: var(--lime);
  text-transform: uppercase;
  letter-spacing: .12em;
  margin-bottom: 14px;
}
.hero-dot { width: 6px; height: 6px; background: var(--lime); border-radius: 50%; animation: blink 2s infinite; }
@keyframes blink { 0%,100% { opacity:1; } 50% { opacity:.25; } }
.hero-title { font-size: 34px; font-weight: 800; letter-spacing: -.03em; line-height: 1.1; margin-bottom: 20px; max-width: 560px; }
.hero-progress-row { display: flex; align-items: center; gap: 14px; margin-bottom: 24px; }
.hero-progress-bar { flex: 1; max-width: 260px; height: 4px; background: rgba(255,255,255,.08); border-radius: 99px; overflow: hidden; }
.hero-progress-fill { height: 100%; background: var(--lime); border-radius: 99px; transition: width .5s; }
.hero-progress-label { font-size: 12px; color: var(--muted); }
.hero-cta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--lime);
  color: #0d0d09;
  border: none;
  border-radius: 10px;
  padding: 12px 24px;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  transition: opacity .15s;
  text-decoration: none;
}
.hero-cta:hover { opacity: .88; }

.modules-section { padding: 32px 48px 60px; }
.modules-title { font-size: 18px; font-weight: 800; margin-bottom: 20px; letter-spacing: -.01em; }
.modules-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 14px; }
.module-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  transition: border-color .2s, transform .2s;
  text-decoration: none;
  color: inherit;
  display: block;
}
.module-card:hover { border-color: var(--lime-dim); transform: translateY(-2px); }
.module-card-thumb {
  height: 90px;
  background: var(--bg3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  font-weight: 900;
  color: var(--muted2);
  border-bottom: 1px solid var(--border);
  letter-spacing: -.04em;
}
.module-card-body { padding: 14px; }
.module-card-num { font-size: 10px; font-weight: 700; color: var(--muted2); text-transform: uppercase; letter-spacing: .08em; margin-bottom: 4px; }
.module-card-title { font-size: 14px; font-weight: 700; margin-bottom: 6px; }
.module-card-meta { font-size: 11px; color: var(--muted); }
.module-card-badge {
  display: inline-block;
  font-size: 10px;
  background: rgba(197,241,53,.08);
  color: var(--lime);
  border: 1px solid rgba(197,241,53,.15);
  border-radius: 4px;
  padding: 2px 6px;
  font-weight: 700;
  margin-top: 6px;
}
.module-card-progress { height: 2px; background: var(--bg3); border-radius: 99px; margin-top: 10px; overflow: hidden; }
.module-card-progress-fill { height: 100%; background: var(--lime); border-radius: 99px; }

/* ─── PLAYER ────────────────────────────────────────────────────── */
.player-page { display: flex; flex-direction: column; height: 100vh; overflow: hidden; }
.lesson-topbar {
  height: var(--topbar-h);
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 16px;
  gap: 12px;
  flex-shrink: 0;
  z-index: 100;
}
.ltb-back {
  width: 32px;
  height: 32px;
  border: 1px solid var(--border);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  color: var(--muted);
  flex-shrink: 0;
  transition: color .15s, border-color .15s;
}
.ltb-back:hover { color: var(--text); border-color: var(--muted2); }
.ltb-info { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; overflow: hidden; }
.ltb-title { font-size: 14px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ltb-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 3px 8px;
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
  flex-shrink: 0;
}
.ltb-counter { font-size: 12px; color: var(--muted); white-space: nowrap; flex-shrink: 0; }
.ltb-nav { display: flex; gap: 8px; flex-shrink: 0; }
.ltb-nav-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  border: 1px solid var(--border);
  background: none;
  color: var(--muted);
  transition: all .15s;
  white-space: nowrap;
  text-decoration: none;
}
.ltb-nav-btn:hover { color: var(--text); border-color: var(--muted2); }
.ltb-nav-btn.primary { background: var(--lime); color: #0d0d09; border-color: var(--lime); }
.ltb-nav-btn.primary:hover { opacity: .88; }

.player-body { display: flex; flex: 1; overflow: hidden; }
.video-col { flex: 1; min-width: 0; display: flex; flex-direction: column; overflow-y: auto; }
.video-section { background: #000; flex-shrink: 0; }
.video-tabs { background: #0a0a08; border-bottom: 1px solid var(--border); display: flex; }
.video-tab-btn {
  padding: 10px 20px;
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: .08em;
  transition: all .15s;
}
.video-tab-btn.active { color: var(--lime); border-bottom-color: var(--lime); }
.video-tab-btn:hover:not(.active) { color: var(--text); }
.video-wrapper { position: relative; padding-top: 56.25%; background: #000; }
.video-wrapper iframe, .video-wrapper video {
  position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: none;
}
.video-placeholder {
  position: absolute; top: 0; left: 0; right: 0; bottom: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 10px; background: #0a0a08; color: var(--muted);
}
.video-placeholder .ph-icon { font-size: 40px; }
.video-placeholder .ph-title { font-size: 14px; font-weight: 600; }
.video-placeholder .ph-sub { font-size: 12px; color: var(--muted2); text-align: center; max-width: 280px; line-height: 1.5; }

.lesson-meta { padding: 20px 28px 0; flex-shrink: 0; }
.lesson-tag { font-size: 10px; font-weight: 700; color: var(--lime); text-transform: uppercase; letter-spacing: .1em; margin-bottom: 6px; }
.lesson-h1 { font-size: 22px; font-weight: 800; letter-spacing: -.02em; line-height: 1.2; }

.no-video-notice {
  margin: 16px 28px;
  background: rgba(197,241,53,.06);
  border: 1px solid rgba(197,241,53,.15);
  border-radius: 10px;
  padding: 12px 16px;
  font-size: 13px;
  color: var(--lime);
  display: flex;
  align-items: center;
  gap: 8px;
}

.complete-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 20px 28px;
  padding: 16px 20px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 12px;
  gap: 16px;
  flex-shrink: 0;
}
.complete-bar-text { font-size: 14px; font-weight: 700; }
.complete-bar-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.complete-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--lime);
  color: #0d0d09;
  border: none;
  border-radius: 8px;
  padding: 10px 18px;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
  transition: opacity .15s;
  flex-shrink: 0;
}
.complete-btn:hover { opacity: .88; }
.complete-btn.done { background: var(--bg3); color: var(--muted); border: 1px solid var(--border); opacity: 1; }

.keyboard-hints {
  padding: 10px 28px 20px;
  font-size: 11px;
  color: var(--muted2);
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
kbd {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 5px;
  font-family: inherit;
  font-size: 10px;
  color: var(--muted);
}

/* Right col: content */
.content-col {
  width: 420px;
  flex-shrink: 0;
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.content-tabs { border-bottom: 1px solid var(--border); display: flex; flex-shrink: 0; }
.content-tab-btn {
  padding: 12px 20px;
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: .08em;
  transition: all .15s;
}
.content-tab-btn.active { color: var(--lime); border-bottom-color: var(--lime); }
.content-tab-btn:hover:not(.active) { color: var(--text); }
.content-pane { display: none; flex: 1; overflow-y: auto; padding: 24px; }
.content-pane.active { display: block; }

.resumen-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 20px;
}
.resumen-card h3 { font-size: 16px; font-weight: 800; margin-bottom: 10px; }
.resumen-card p { font-size: 13px; color: var(--muted); line-height: 1.6; }

.lesson-content { font-size: 14px; line-height: 1.7; color: #c8c4bc; }
.lesson-content h1 { font-size: 17px; font-weight: 800; color: var(--text); margin: 20px 0 10px; letter-spacing: -.01em; }
.lesson-content h2 { font-size: 15px; font-weight: 700; color: var(--text); margin: 16px 0 8px; }
.lesson-content h3 { font-size: 14px; font-weight: 700; color: var(--text); margin: 14px 0 6px; }
.lesson-content p { margin: 0 0 12px; }
.lesson-content ul, .lesson-content ol { margin: 0 0 12px 18px; }
.lesson-content li { margin-bottom: 5px; }
.lesson-content strong { font-weight: 700; color: var(--text); }
.lesson-content em { font-style: italic; color: #a8a49c; }
.lesson-content code {
  background: var(--bg3); border: 1px solid var(--border); border-radius: 4px;
  padding: 1px 5px; font-family: 'SF Mono', Consolas, monospace; font-size: 12px; color: var(--lime);
}
.lesson-content pre {
  background: var(--bg2); border: 1px solid var(--border); border-radius: 8px;
  padding: 14px 16px; overflow-x: auto; margin: 14px 0;
}
.lesson-content pre code { background: none; border: none; padding: 0; font-size: 12px; color: var(--text); }
.lesson-content a { color: var(--lime); }
.lesson-content a:hover { text-decoration: underline; }
.lesson-content blockquote {
  border-left: 3px solid var(--lime-dim); padding: 8px 14px;
  background: rgba(197,241,53,.04); border-radius: 0 6px 6px 0; margin: 14px 0;
  color: var(--muted); font-style: italic;
}
.lesson-content hr { border: none; border-top: 1px solid var(--border); margin: 20px 0; }
.lesson-content table { width: 100%; border-collapse: collapse; font-size: 13px; margin: 14px 0; }
.lesson-content th { background: var(--bg2); font-weight: 700; color: var(--text); }
.lesson-content th, .lesson-content td { border: 1px solid var(--border); padding: 8px 12px; text-align: left; }
.lesson-content img { max-width: 100%; border-radius: 8px; }

/* ─── Admin ─────────────────────────────────────────────────────── */
.admin-wrap { max-width: 900px; margin: 0 auto; padding: 36px 24px; }
.admin-title { font-size: 22px; font-weight: 800; margin-bottom: 24px; }
.admin-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.admin-table th, .admin-table td { border: 1px solid var(--border); padding: 10px 14px; text-align: left; }
.admin-table th { background: var(--bg2); font-weight: 700; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.admin-table tr:hover td { background: var(--bg2); }
.badge-admin { background: rgba(197,241,53,.1); color: var(--lime); border: 1px solid rgba(197,241,53,.2); border-radius: 4px; padding: 2px 7px; font-size: 10px; font-weight: 700; }
.badge-user  { background: var(--bg3); color: var(--muted); border: 1px solid var(--border); border-radius: 4px; padding: 2px 7px; font-size: 10px; font-weight: 700; }
.admin-form { background: var(--bg2); border: 1px solid var(--border); border-radius: 12px; padding: 24px; margin-top: 28px; }
.admin-form-title { font-size: 16px; font-weight: 700; margin-bottom: 16px; }
.admin-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 16px; }
.form-field { display: flex; flex-direction: column; gap: 6px; font-size: 12px; color: var(--muted); }
.form-field input, .form-field select {
  background: var(--bg3); border: 1px solid var(--border); border-radius: 8px;
  padding: 9px 12px; color: var(--text); font-size: 13px; font-family: inherit; outline: none;
}
.form-field input:focus, .form-field select:focus { border-color: var(--lime-dim); }
.form-success { background: rgba(197,241,53,.08); border: 1px solid rgba(197,241,53,.2); border-radius: 8px; padding: 10px 14px; font-size: 13px; color: var(--lime); margin-bottom: 16px; }
.form-error  { background: rgba(229,62,62,.08); border: 1px solid rgba(229,62,62,.2); border-radius: 8px; padding: 10px 14px; font-size: 13px; color: #fc8181; margin-bottom: 16px; }

/* ─── Responsive ────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .player-body { flex-direction: column; }
  .content-col { width: 100%; border-left: none; border-top: 1px solid var(--border); max-height: 380px; }
  .ltb-title { display: none; }
  .ltb-pill { display: none; }
  .course-home-body { flex-direction: column; }
  .course-sidebar { width: 100%; border-right: none; border-bottom: 1px solid var(--border); }
  .course-hero { padding: 28px 20px; }
  .hero-title { font-size: 24px; }
  .modules-section { padding: 24px 20px 40px; }
  .admin-form-grid { grid-template-columns: 1fr; }
}
