*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --bg: #080a0f; --surface: #0e1118; --surface2: #141820;
  --border: #1e2330; --border2: #252d3d;
  --accent: #4f9eff; --accent2: #2a7de0; --accent-glow: rgba(79,158,255,0.15);
  --hot: #ff5c3a; --text: #e8edf5; --text-muted: #6b7a96; --text-dim: #323d52;
  --font-display: 'Bebas Neue', sans-serif;
  --font-mono: 'DM Mono', monospace;
  --font-body: 'DM Sans', sans-serif;
  --radius: 2px;
}
html { scroll-behavior: smooth; }
body { background: var(--bg); color: var(--text); font-family: var(--font-body); font-weight: 300; line-height: 1.7; overflow-x: hidden; }
body::after { content: ''; position: fixed; inset: 0; background-image: linear-gradient(rgba(79,158,255,0.03) 1px, transparent 1px), linear-gradient(90deg, rgba(79,158,255,0.03) 1px, transparent 1px); background-size: 80px 80px; pointer-events: none; z-index: 0; }
a { color: inherit; text-decoration: none; }

/* NAV */
nav { position: fixed; top: 0; left: 0; right: 0; z-index: 100; display: flex; align-items: center; justify-content: space-between; padding: 1.2rem 3rem; transition: background 0.3s, border-color 0.3s; border-bottom: 1px solid transparent; background: rgba(8,10,15,0.9); backdrop-filter: blur(20px); border-color: var(--border); }
.nav-logo { font-family: var(--font-display); font-size: 1.4rem; letter-spacing: 0.05em; }
.nav-logo span { color: var(--accent); }
.nav-links { display: flex; gap: 2rem; list-style: none; }
.nav-links a { font-family: var(--font-mono); font-size: 0.68rem; letter-spacing: 0.15em; text-transform: uppercase; color: var(--text-muted); transition: color 0.2s; }
.nav-links a:hover { color: var(--accent); }
.admin-link { color: var(--hot) !important; }
.nav-right { display: flex; align-items: center; gap: 0.8rem; }
.nav-user { font-family: var(--font-mono); font-size: 0.65rem; color: var(--text-muted); letter-spacing: 0.1em; }

/* BUTTONS */
.btn-primary { display: inline-block; font-family: var(--font-mono); font-size: 0.7rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--bg); background: var(--accent); padding: 0.85rem 1.8rem; border: none; cursor: pointer; transition: background 0.2s, box-shadow 0.2s; }
.btn-primary:hover { background: var(--accent2); box-shadow: 0 0 24px var(--accent-glow); }
.btn-primary.completed { background: #2d6a2d; }
.btn-ghost { display: inline-block; font-family: var(--font-mono); font-size: 0.7rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-muted); border: 1px solid var(--border2); padding: 0.85rem 1.8rem; cursor: pointer; background: none; transition: border-color 0.2s, color 0.2s; }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn-primary-sm { font-family: var(--font-mono); font-size: 0.62rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--bg); background: var(--accent); padding: 0.45rem 1rem; border: none; cursor: pointer; transition: background 0.2s; }
.btn-ghost-sm { font-family: var(--font-mono); font-size: 0.62rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-muted); border: 1px solid var(--border2); padding: 0.45rem 1rem; cursor: pointer; background: none; transition: border-color 0.2s, color 0.2s; }
.btn-full { width: 100%; text-align: center; }

/* FLASH */
.flash-messages { position: fixed; top: 5rem; right: 1.5rem; z-index: 200; display: flex; flex-direction: column; gap: 0.5rem; }
.flash { font-family: var(--font-mono); font-size: 0.7rem; letter-spacing: 0.1em; padding: 0.8rem 1.5rem; border-left: 3px solid var(--accent); background: var(--surface); animation: slideIn 0.3s ease; }
.flash-error { border-color: var(--hot); }
.flash-success { border-color: #4caf50; }
@keyframes slideIn { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: none; } }

/* HERO */
.hero { min-height: 100vh; display: flex; flex-direction: column; justify-content: flex-end; padding: 0 3rem 5rem; position: relative; overflow: hidden; border-bottom: 1px solid var(--border); }
.hero-bg { position: absolute; inset: 0; background: radial-gradient(ellipse 60% 60% at 70% 50%, rgba(79,158,255,0.06) 0%, transparent 70%); }
.hero-scan { position: absolute; left: 0; right: 0; height: 1px; background: linear-gradient(90deg, transparent, var(--accent), transparent); opacity: 0; animation: scan 4s 1s infinite; }
@keyframes scan { 0% { top: 0; opacity: 0; } 10% { opacity: 0.4; } 90% { opacity: 0.4; } 100% { top: 100%; opacity: 0; } }
.hero-label { font-family: var(--font-mono); font-size: 0.65rem; letter-spacing: 0.25em; text-transform: uppercase; color: var(--accent); margin-bottom: 1.2rem; position: relative; z-index: 1; }
.hero-label::before { content: '// '; opacity: 0.5; }
.hero-title { font-family: var(--font-display); font-size: clamp(5rem, 12vw, 13rem); line-height: 0.9; color: var(--text); margin-bottom: 0.1em; position: relative; z-index: 1; }
.hero-title .accent { color: var(--accent); }
.hero-title .dim { color: var(--text-dim); }
.hero-bottom { display: flex; align-items: flex-end; justify-content: space-between; margin-top: 3rem; position: relative; z-index: 1; }
.hero-desc { max-width: 400px; font-size: 0.95rem; color: var(--text-muted); line-height: 1.8; border-left: 2px solid var(--accent); padding-left: 1.5rem; }
.hero-actions { display: flex; gap: 1rem; }

/* PAGE HERO */
.page-hero { padding: 10rem 3rem 5rem; border-bottom: 1px solid var(--border); position: relative; z-index: 1; }
.page-hero-title { font-family: var(--font-display); font-size: clamp(4rem, 10vw, 10rem); line-height: 0.9; color: var(--text); margin-bottom: 1.5rem; }
.page-hero-title span { color: var(--accent); }
.page-hero-desc { font-size: 1rem; color: var(--text-muted); max-width: 500px; line-height: 1.8; border-left: 2px solid var(--accent); padding-left: 1.5rem; }
.section-tag { font-family: var(--font-mono); font-size: 0.62rem; letter-spacing: 0.25em; text-transform: uppercase; color: var(--accent); margin-bottom: 0.8rem; }
.section-tag::before { content: '// '; }
.section-heading { font-family: var(--font-display); font-size: clamp(3rem, 6vw, 6rem); line-height: 0.9; color: var(--text); }

/* COURSES */
.courses-section { padding: 6rem 3rem; position: relative; z-index: 1; }
.courses-section.dark { background: var(--surface); }
.section-header { margin-bottom: 3rem; }
.course-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--border); }
.course-card { background: var(--bg); display: flex; flex-direction: column; transition: background 0.2s; position: relative; }
.course-card:hover { background: var(--surface); }
.course-thumb { width: 100%; aspect-ratio: 16/9; overflow: hidden; background: var(--surface2); }
.course-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s; filter: brightness(0.85); }
.course-card:hover .course-thumb img { transform: scale(1.04); filter: brightness(1); }
.thumb-placeholder { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; font-family: var(--font-display); font-size: 4rem; color: var(--text-dim); }
.course-info { padding: 1.8rem; flex: 1; display: flex; flex-direction: column; gap: 0.5rem; }
.course-badge { font-family: var(--font-mono); font-size: 0.58rem; letter-spacing: 0.15em; text-transform: uppercase; padding: 0.25rem 0.65rem; width: fit-content; }
.course-badge.free { border: 1px solid var(--border2); color: var(--text-muted); }
.course-badge.paid { background: var(--accent); color: var(--bg); }
.course-title { font-family: var(--font-display); font-size: 1.5rem; color: var(--text); line-height: 1.2; }
.course-desc { font-size: 0.83rem; color: var(--text-muted); line-height: 1.7; flex: 1; }
.course-meta { display: flex; gap: 1.5rem; font-family: var(--font-mono); font-size: 0.6rem; letter-spacing: 0.1em; color: var(--text-dim); margin-top: auto; padding-top: 1rem; border-top: 1px solid var(--border); }
.empty-state { padding: 4rem; text-align: center; color: var(--text-muted); grid-column: 1/-1; display: flex; flex-direction: column; align-items: center; gap: 1.5rem; }

/* COURSE DETAIL */
.course-detail-hero { padding: 10rem 3rem 5rem; border-bottom: 1px solid var(--border); display: grid; grid-template-columns: 1fr 1fr; gap: 4rem; align-items: center; position: relative; z-index: 1; }
.course-detail-title { font-family: var(--font-display); font-size: clamp(3rem, 6vw, 6rem); line-height: 0.95; color: var(--text); margin-bottom: 1rem; }
.course-detail-desc { font-size: 1rem; color: var(--text-muted); line-height: 1.8; margin-bottom: 1.5rem; }
.course-detail-meta { display: flex; gap: 2rem; font-family: var(--font-mono); font-size: 0.65rem; letter-spacing: 0.1em; color: var(--text-dim); margin-bottom: 2rem; }
.course-detail-thumb img { width: 100%; border: 1px solid var(--border); }
.course-detail-body { display: grid; grid-template-columns: 1fr 1fr; gap: 4rem; padding: 5rem 3rem; position: relative; z-index: 1; }
.course-detail-body h2 { font-family: var(--font-display); font-size: 2rem; color: var(--text); margin-bottom: 1.5rem; }
.content-body { font-size: 0.9rem; color: var(--text-muted); line-height: 1.9; }
.lesson-list { display: flex; flex-direction: column; gap: 1px; background: var(--border); }
.lesson-row { background: var(--bg); padding: 1rem 1.5rem; display: flex; align-items: center; justify-content: space-between; transition: background 0.2s; }
.lesson-row:hover { background: var(--surface); }
.lesson-row-left { display: flex; align-items: center; gap: 1rem; }
.lesson-num { font-family: var(--font-mono); font-size: 0.65rem; color: var(--text-dim); width: 20px; }
.lesson-title { font-size: 0.9rem; color: var(--text); }
.preview-badge { font-family: var(--font-mono); font-size: 0.55rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent); border: 1px solid var(--accent); padding: 0.15rem 0.4rem; }
.lesson-row-right { display: flex; align-items: center; gap: 1rem; }
.lesson-duration { font-family: var(--font-mono); font-size: 0.62rem; color: var(--text-dim); }
.lesson-link { font-family: var(--font-mono); font-size: 0.62rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent); }
.lesson-lock { color: var(--text-dim); }

/* LESSON PLAYER */
.lesson-layout { display: grid; grid-template-columns: 300px 1fr; min-height: calc(100vh - 0px); margin-top: 4rem; }
.lesson-sidebar { background: var(--surface); border-right: 1px solid var(--border); overflow-y: auto; position: sticky; top: 4rem; height: calc(100vh - 4rem); }
.sidebar-header { padding: 1.5rem; border-bottom: 1px solid var(--border); }
.back-link { font-family: var(--font-mono); font-size: 0.65rem; letter-spacing: 0.1em; color: var(--text-muted); display: block; margin-bottom: 1rem; transition: color 0.2s; }
.back-link:hover { color: var(--accent); }
.progress-bar-wrap { height: 3px; background: var(--border); margin-bottom: 0.4rem; }
.progress-bar { height: 100%; background: var(--accent); transition: width 0.5s ease; }
.progress-label { font-family: var(--font-mono); font-size: 0.6rem; color: var(--text-dim); letter-spacing: 0.1em; }
.lesson-nav { display: flex; flex-direction: column; }
.lesson-nav-item { padding: 1rem 1.5rem; display: flex; align-items: center; gap: 0.8rem; border-bottom: 1px solid var(--border); transition: background 0.2s; }
.lesson-nav-item:hover { background: var(--surface2); }
.lesson-nav-item.active { background: var(--surface2); border-left: 2px solid var(--accent); }
.lesson-nav-num { font-family: var(--font-mono); font-size: 0.6rem; color: var(--text-dim); width: 16px; flex-shrink: 0; }
.lesson-nav-title { font-size: 0.82rem; color: var(--text-muted); flex: 1; line-height: 1.4; }
.lesson-nav-item.active .lesson-nav-title { color: var(--text); }
.check { color: #4caf50; font-size: 0.8rem; margin-left: auto; }
.lesson-main { padding: 3rem; position: relative; z-index: 1; }
.lesson-header { margin-bottom: 2rem; }
.lesson-title { font-family: var(--font-display); font-size: 3rem; color: var(--text); line-height: 1; margin-bottom: 0.5rem; }
.lesson-duration-badge { font-family: var(--font-mono); font-size: 0.62rem; letter-spacing: 0.1em; color: var(--text-dim); border: 1px solid var(--border); padding: 0.2rem 0.5rem; }
.video-wrap { width: 100%; aspect-ratio: 16/9; background: #000; margin-bottom: 3rem; }
.video-wrap iframe { width: 100%; height: 100%; }
.lesson-content { margin-bottom: 3rem; }
.lesson-footer { border-top: 1px solid var(--border); padding-top: 2rem; }
.lesson-nav-btns { display: flex; gap: 1rem; align-items: center; }

/* AUTH */
.auth-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 8rem 1.5rem 4rem; position: relative; z-index: 1; }
.auth-card { width: 100%; max-width: 420px; background: var(--surface); border: 1px solid var(--border); padding: 3rem; }
.auth-title { font-family: var(--font-display); font-size: 3rem; color: var(--text); margin-bottom: 0.5rem; }
.auth-sub { font-size: 0.9rem; color: var(--text-muted); margin-bottom: 2.5rem; }
.auth-form { display: flex; flex-direction: column; gap: 1.5rem; margin-bottom: 1.5rem; }
.form-group { display: flex; flex-direction: column; gap: 0.5rem; }
.form-group label { font-family: var(--font-mono); font-size: 0.65rem; letter-spacing: 0.15em; text-transform: uppercase; color: var(--text-muted); }
.form-group input, .form-group textarea, .form-group select { background: var(--bg); border: 1px solid var(--border); color: var(--text); padding: 0.8rem 1rem; font-family: var(--font-body); font-size: 0.9rem; width: 100%; transition: border-color 0.2s; }
.form-group input:focus, .form-group textarea:focus { outline: none; border-color: var(--accent); }
.auth-switch { font-size: 0.85rem; color: var(--text-muted); text-align: center; }
.auth-switch a { color: var(--accent); }

/* ADMIN */
.admin-page { padding: 8rem 3rem 5rem; position: relative; z-index: 1; max-width: 1200px; margin: 0 auto; }
.admin-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 3rem; }
.admin-header h1 { font-family: var(--font-display); font-size: 3rem; color: var(--text); }
.admin-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--border); margin-bottom: 3rem; }
.stat-card { background: var(--surface); padding: 2rem; text-align: center; }
.stat-num { font-family: var(--font-display); font-size: 3rem; color: var(--accent); line-height: 1; }
.stat-label { font-family: var(--font-mono); font-size: 0.65rem; letter-spacing: 0.15em; text-transform: uppercase; color: var(--text-muted); margin-top: 0.3rem; }
.admin-table { width: 100%; border-collapse: collapse; }
.admin-table th { font-family: var(--font-mono); font-size: 0.62rem; letter-spacing: 0.15em; text-transform: uppercase; color: var(--text-dim); padding: 0.8rem 1rem; border-bottom: 1px solid var(--border); text-align: left; }
.admin-table td { padding: 1rem; border-bottom: 1px solid var(--border); font-size: 0.88rem; color: var(--text-muted); }
.admin-table a { color: var(--accent); font-family: var(--font-mono); font-size: 0.65rem; letter-spacing: 0.1em; margin-right: 1rem; }
.status { font-family: var(--font-mono); font-size: 0.6rem; letter-spacing: 0.1em; text-transform: uppercase; padding: 0.2rem 0.5rem; }
.status.published { background: rgba(76,175,80,0.15); color: #4caf50; }
.status.draft { background: rgba(103,119,148,0.15); color: var(--text-dim); }
.admin-form { display: flex; flex-direction: column; gap: 1.5rem; max-width: 700px; margin-bottom: 3rem; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.form-checks { display: flex; gap: 2rem; }
.check-label { display: flex; align-items: center; gap: 0.6rem; font-family: var(--font-mono); font-size: 0.68rem; letter-spacing: 0.1em; color: var(--text-muted); cursor: pointer; }
.admin-subheader { display: flex; align-items: center; justify-content: space-between; margin: 2rem 0 1rem; }
.admin-subheader h2 { font-family: var(--font-display); font-size: 2rem; color: var(--text); }
.admin-lessons { margin-top: 3rem; }
.admin-courses h2 { font-family: var(--font-display); font-size: 2rem; color: var(--text); margin-bottom: 1rem; }

/* CTA */
.cta-section { padding: 8rem 3rem; text-align: center; border-top: 1px solid var(--border); position: relative; z-index: 1; }
.cta-heading { font-family: var(--font-display); font-size: clamp(3rem, 6vw, 7rem); line-height: 0.95; color: var(--text); margin-bottom: 1.5rem; }
.cta-heading span { color: var(--accent); }
.cta-sub { font-size: 1rem; color: var(--text-muted); max-width: 500px; margin: 0 auto 3rem; line-height: 1.8; }

/* FOOTER */
footer { padding: 2rem 3rem; display: flex; align-items: center; justify-content: space-between; border-top: 1px solid var(--border); position: relative; z-index: 1; }
.footer-brand { font-family: var(--font-display); font-size: 1.1rem; color: var(--text-dim); }
.footer-brand span { color: var(--accent); }
.footer-copy { font-family: var(--font-mono); font-size: 0.62rem; color: var(--text-dim); }
.footer-links { display: flex; gap: 1.5rem; }
.footer-links a { font-family: var(--font-mono); font-size: 0.62rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-dim); transition: color 0.2s; }
.footer-links a:hover { color: var(--accent); }

/* RESPONSIVE */
@media (max-width: 900px) {
  nav { padding: 1.2rem 1.5rem; }
  .nav-links { display: none; }
  .hero { padding: 0 1.5rem 4rem; }
  .hero-bottom { flex-direction: column; align-items: flex-start; gap: 2rem; }
  .course-grid { grid-template-columns: 1fr; }
  .courses-section { padding: 4rem 1.5rem; }
  .course-detail-hero, .course-detail-body { grid-template-columns: 1fr; padding: 8rem 1.5rem 3rem; }
  .lesson-layout { grid-template-columns: 1fr; }
  .lesson-sidebar { position: static; height: auto; }
  .page-hero { padding: 8rem 1.5rem 3rem; }
  .admin-page { padding: 8rem 1.5rem 3rem; }
  .admin-stats { grid-template-columns: 1fr; }
  footer { padding: 1.5rem; flex-direction: column; gap: 1rem; text-align: center; }
}

/* MEDIA LIBRARY */
.media-section { margin-bottom: 4rem; }
.media-section h2 { font-family: var(--font-display); font-size: 2rem; color: var(--text); margin-bottom: 1.5rem; }
.media-note { font-family: var(--font-mono); font-size: 0.65rem; letter-spacing: 0.1em; color: var(--accent); margin-bottom: 1rem; }
.upload-box { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; padding: 2rem; background: var(--surface); border: 1px solid var(--border); margin-bottom: 1rem; }
.upload-box input[type="file"] { font-family: var(--font-mono); font-size: 0.7rem; color: var(--text-muted); }
.upload-box input[type="text"] { background: var(--bg); border: 1px solid var(--border); color: var(--text); padding: 0.6rem 1rem; font-family: var(--font-body); font-size: 0.85rem; min-width: 200px; }
.upload-status { font-family: var(--font-mono); font-size: 0.68rem; color: var(--text-muted); }
.url-result { padding: 1rem 1.5rem; background: var(--surface); border: 1px solid var(--border); border-left: 3px solid var(--accent); }
.url-result label { font-family: var(--font-mono); font-size: 0.62rem; letter-spacing: 0.15em; text-transform: uppercase; color: var(--text-dim); display: block; margin-bottom: 0.5rem; }
.url-result input { width: 100%; background: var(--bg); border: 1px solid var(--border); color: var(--accent); padding: 0.7rem 1rem; font-family: var(--font-mono); font-size: 0.75rem; cursor: pointer; }
.media-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--border); }
.media-card { background: var(--bg); transition: background 0.2s; }
.media-card:hover { background: var(--surface); }
.media-thumb { width: 100%; aspect-ratio: 16/9; background: var(--surface2); position: relative; overflow: hidden; }
.media-thumb img { width: 100%; height: 100%; object-fit: cover; }
.media-overlay { position: absolute; bottom: 0.5rem; right: 0.5rem; }
.media-duration { font-family: var(--font-mono); font-size: 0.6rem; background: rgba(0,0,0,0.8); color: var(--text); padding: 0.2rem 0.4rem; }
.media-info { padding: 1rem; }
.media-name { font-size: 0.82rem; color: var(--text); margin-bottom: 0.4rem; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.media-status { font-family: var(--font-mono); font-size: 0.58rem; letter-spacing: 0.1em; text-transform: uppercase; margin-bottom: 0.8rem; }
.media-status.ready { color: #4caf50; }
.media-status.processing { color: var(--accent); }
.media-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }
@media (max-width: 900px) { .media-grid { grid-template-columns: repeat(2, 1fr); } .upload-box { flex-direction: column; align-items: flex-start; } }
