/* ── TAM Academy LMS Styles ── */
@import url('https://fonts.googleapis.com/css2?family=Syne:wght@400;600;700;800&family=DM+Sans:wght@300;400;500;600&display=swap');

:root {
  --black:    #0a0a0a;
  --dark:     #111318;
  --card:     #1a1d24;
  --border:   #2a2d35;
  --gold:     #f59e0b;
  --gold-dim: rgba(245,158,11,0.12);
  --red:      #c8001e;
  --green:    #16a34a;
  --text:     #e8eaf0;
  --muted:    #6b7280;
  --white:    #ffffff;
  --radius:   12px;
}

* { margin:0; padding:0; box-sizing:border-box; }

body {
  background: var(--black);
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

h1,h2,h3,h4 { font-family: 'Syne', sans-serif; }
a { text-decoration: none; }

/* ── AUTH ── */
.auth-body {
  background: radial-gradient(ellipse at 20% 50%, rgba(245,158,11,0.08) 0%, transparent 60%),
              radial-gradient(ellipse at 80% 20%, rgba(200,0,30,0.06) 0%, transparent 50%),
              var(--black);
  display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 24px;
}

.login-box {
  width: 100%; max-width: 420px;
  background: var(--card); border: 1px solid var(--border); border-radius: 20px;
  padding: 40px 36px; position: relative; overflow: hidden;
}
.login-box::before {
  content: ''; position: absolute; top:0;left:0;right:0; height: 3px;
  background: linear-gradient(90deg, var(--red), var(--gold));
}
.login-logo {
  width: 52px; height: 52px;
  background: linear-gradient(135deg, var(--red), var(--gold));
  border-radius: 14px; display: flex; align-items: center; justify-content: center;
  font-family: 'Syne', sans-serif; font-size: 22px; font-weight: 800;
  color: #fff; margin: 0 auto 20px;
}
.login-title { font-size: 24px; font-weight: 800; text-align: center; margin-bottom: 6px; color: var(--white); }
.login-sub   { font-size: 13px; color: var(--muted); text-align: center; margin-bottom: 28px; }
.login-btn {
  width: 100%; padding: 14px;
  background: linear-gradient(135deg, var(--red), #a0001a);
  border: none; border-radius: 10px;
  color: #fff; font-family: 'Syne', sans-serif; font-size: 15px; font-weight: 700;
  cursor: pointer; margin-top: 8px; letter-spacing: 0.03em; transition: opacity 0.2s;
}
.login-btn:hover { opacity: 0.9; }
.login-badge { text-align: center; margin-top: 20px; font-size: 12px; color: var(--muted); }
.login-badge span { color: var(--gold); font-weight: 600; }

/* ── FORMS ── */
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: 12px; font-weight: 600; color: var(--muted); letter-spacing: 0.06em; text-transform: uppercase; margin-bottom: 8px; }
.form-input {
  width: 100%; padding: 12px 16px;
  background: #0f1117; border: 1px solid var(--border); border-radius: 10px;
  color: var(--text); font-family: 'DM Sans', sans-serif; font-size: 14px;
  outline: none; transition: border-color 0.2s;
}
.form-input:focus { border-color: var(--gold); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

/* ── ALERTS ── */
.alert { padding: 12px 16px; border-radius: 8px; font-size: 14px; margin-bottom: 16px; }
.alert-error   { background: rgba(200,0,30,0.12); border: 1px solid rgba(200,0,30,0.3); color: #f87171; }
.alert-success { background: rgba(22,163,74,0.12); border: 1px solid rgba(22,163,74,0.3); color: #4ade80; }

/* ── TOPBAR ── */
.topbar {
  background: var(--dark); border-bottom: 1px solid var(--border);
  padding: 0 24px; height: 60px;
  display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; z-index: 100; flex-shrink: 0;
}
.topbar-logo { font-family: 'Syne', sans-serif; font-size: 16px; font-weight: 800; display: flex; align-items: center; gap: 10px; color: var(--white); }
.dot { width: 8px; height: 8px; background: var(--gold); border-radius: 50%; }
.topbar-user { display: flex; align-items: center; gap: 12px; }
.topbar-avatar { width: 34px; height: 34px; border-radius: 50%; background: linear-gradient(135deg, var(--red), var(--gold)); display: flex; align-items: center; justify-content: center; font-family: 'Syne', sans-serif; font-size: 13px; font-weight: 700; color: #fff; }
.topbar-name   { font-size: 13px; font-weight: 500; color: var(--text); }
.topbar-role   { font-size: 11px; color: var(--muted); }
.logout-btn { background: transparent; border: 1px solid var(--border); border-radius: 8px; padding: 6px 14px; color: var(--muted); font-size: 12px; cursor: pointer; font-family: 'DM Sans', sans-serif; transition: all 0.2s; }
.logout-btn:hover { border-color: var(--red); color: var(--red); }

/* ── ADMIN LAYOUT ── */
.admin-body { display: flex; flex: 1; overflow: hidden; min-height: calc(100vh - 60px); }
.admin-sidebar {
  width: 220px; flex-shrink: 0;
  background: var(--dark); border-right: 1px solid var(--border);
  padding: 24px 16px;
}
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; border-radius: 10px;
  font-size: 13px; font-weight: 500; color: var(--muted);
  cursor: pointer; transition: all 0.15s; text-decoration: none;
  width: 100%; margin-bottom: 4px;
}
.nav-item:hover { background: var(--card); color: var(--text); }
.nav-item.active { background: var(--gold-dim); color: var(--gold); }
.nav-icon { font-size: 16px; width: 20px; text-align: center; }
.admin-main { flex: 1; overflow-y: auto; padding: 28px; }
.page-title { font-size: 22px; font-weight: 800; color: var(--white); margin-bottom: 20px; }
.section-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }

/* ── CARDS ── */
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; margin-bottom: 16px; }
.card-title { font-size: 16px; font-weight: 700; color: var(--white); margin-bottom: 16px; }

/* ── STATS ── */
.stats-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 14px; margin-bottom: 24px; }
.stat-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; }
.stat-card.gold { border-color: rgba(245,158,11,0.3); }
.stat-num { font-family: 'Syne', sans-serif; font-size: 32px; font-weight: 800; color: var(--white); line-height: 1; margin-bottom: 4px; }
.stat-card.gold .stat-num { color: var(--gold); }
.stat-label { font-size: 12px; color: var(--muted); }

/* ── TABLE ── */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { text-align: left; padding: 10px 14px; color: var(--muted); font-size: 11px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; border-bottom: 1px solid var(--border); }
td { padding: 12px 14px; border-bottom: 1px solid rgba(255,255,255,0.04); color: var(--text); vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: rgba(255,255,255,0.02); }

/* ── BADGES ── */
.badge { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 20px; font-size: 11px; font-weight: 600; }
.badge-green { background: rgba(22,163,74,0.15); color: #4ade80; }
.badge-gold  { background: rgba(245,158,11,0.15); color: var(--gold); }
.pass-badge  { font-family: monospace; background: rgba(245,158,11,0.1); color: var(--gold); padding: 2px 8px; border-radius: 4px; font-size: 12px; }

/* ── BUTTONS ── */
.btn { padding: 10px 20px; border-radius: 8px; font-family: 'DM Sans', sans-serif; font-size: 13px; font-weight: 600; cursor: pointer; border: none; transition: all 0.2s; }
.btn-primary { background: var(--gold); color: #111; }
.btn-primary:hover { background: #e08d00; }
.btn-danger { background: rgba(200,0,30,0.15); color: #f87171; border: 1px solid rgba(200,0,30,0.2); }
.btn-danger:hover { background: rgba(200,0,30,0.25); }
.btn-ghost { background: transparent; color: var(--muted); border: 1px solid var(--border); }
.btn-ghost:hover { border-color: var(--gold); color: var(--gold); }
.btn-sm { padding: 6px 14px; font-size: 12px; }

/* ── MODULE EDITOR ── */
.module-block { background: var(--dark); border: 1px solid var(--border); border-radius: 10px; padding: 18px 20px; margin-bottom: 12px; }
.module-block-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 4px; }
.module-block-title { font-size: 15px; font-weight: 700; color: var(--white); }
.video-item { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid rgba(255,255,255,0.05); margin-top: 10px; }
.video-thumb { width: 48px; height: 30px; border-radius: 4px; background: var(--border); flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-size: 14px; }

/* ── MODAL ── */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.7); z-index: 500; display: none; align-items: center; justify-content: center; padding: 20px; }
.modal-overlay.open { display: flex; }
.modal { background: var(--card); border: 1px solid var(--border); border-radius: 16px; padding: 28px; width: 100%; max-width: 480px; }
.modal-title { font-size: 18px; font-weight: 700; color: var(--white); margin-bottom: 20px; font-family: 'Syne', sans-serif; }
.modal-footer { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; }

/* ── STUDENT LAYOUT ── */
.student-body { display: flex; flex: 1; overflow: hidden; min-height: calc(100vh - 60px); }
.course-sidebar { width: 300px; flex-shrink: 0; background: var(--dark); border-right: 1px solid var(--border); overflow-y: auto; padding: 20px 0; }
.sidebar-section-title { font-size: 10px; font-weight: 700; color: var(--muted); letter-spacing: 0.1em; text-transform: uppercase; padding: 0 20px 10px; display: block; }
.module-nav { margin-bottom: 4px; }
.module-nav-header { display: flex; align-items: center; gap: 10px; padding: 10px 20px; cursor: pointer; font-size: 13px; font-weight: 600; color: var(--text); transition: background 0.15s; }
.module-nav-header:hover { background: rgba(255,255,255,0.03); }
.module-num { width: 24px; height: 24px; border-radius: 6px; background: var(--card); display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; color: var(--muted); flex-shrink: 0; }
.module-num.done { background: rgba(22,163,74,0.2); color: #4ade80; }
.mod-arrow { margin-left: auto; color: var(--muted); font-size: 18px; transition: transform 0.2s; }
.module-videos { display: none; padding: 4px 0 8px 54px; }
.module-videos.open { display: block; }
.video-nav-item { display: flex; align-items: flex-start; gap: 8px; padding: 8px 20px 8px 0; cursor: pointer; font-size: 12px; color: var(--muted); transition: color 0.15s; }
.video-nav-item:hover { color: var(--text); }
.video-nav-item.active { color: var(--gold); }
.video-nav-item.completed { color: #4ade80; }
.check-icon { width: 16px; height: 16px; border-radius: 50%; border: 1.5px solid var(--border); flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-size: 9px; margin-top: 1px; }
.check-icon.done { background: rgba(22,163,74,0.2); border-color: #4ade80; color: #4ade80; }

/* ── VIDEO AREA ── */
.video-main { flex: 1; overflow-y: auto; padding: 28px; }
.video-player-wrap { width: 100%; aspect-ratio: 16/9; background: #000; border-radius: 14px; overflow: hidden; margin-bottom: 20px; }
.video-player-wrap iframe { width: 100%; height: 100%; border: none; display: block; }
.video-title-bar { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 12px; }
.video-title-text { font-family: 'Syne', sans-serif; font-size: 20px; font-weight: 700; color: var(--white); line-height: 1.3; }
.complete-btn { padding: 10px 20px; background: var(--green); border: none; border-radius: 8px; color: #fff; font-family: 'DM Sans', sans-serif; font-size: 13px; font-weight: 600; cursor: pointer; white-space: nowrap; flex-shrink: 0; }
.complete-btn.done { background: #374151; color: var(--muted); cursor: default; }
.video-meta { margin-bottom: 16px; }

/* ── PROGRESS ── */
.progress-section { background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 18px 22px; }
.progress-label { display: flex; align-items: center; justify-content: space-between; font-size: 13px; color: var(--muted); margin-bottom: 10px; }
.progress-bar { height: 8px; background: var(--border); border-radius: 100px; overflow: hidden; }
.progress-fill { height: 100%; background: linear-gradient(90deg, var(--red), var(--gold)); border-radius: 100px; transition: width 0.5s ease; }

/* ── WELCOME ── */
.welcome-placeholder { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 400px; text-align: center; }
.welcome-icon { font-size: 52px; margin-bottom: 16px; }
.welcome-title { font-family: 'Syne', sans-serif; font-size: 24px; font-weight: 800; color: var(--white); margin-bottom: 10px; }
.welcome-sub { font-size: 14px; color: var(--muted); max-width: 340px; line-height: 1.7; }

/* ── TOAST ── */
.toast { position: fixed; bottom: 24px; right: 24px; background: var(--card); border: 1px solid var(--border); border-radius: 10px; padding: 14px 18px; font-size: 13px; color: var(--text); z-index: 9999; transform: translateY(80px); opacity: 0; transition: all 0.3s; }
.toast.show { transform: translateY(0); opacity: 1; }
.toast.success { border-color: rgba(22,163,74,0.4); }

/* ── RESPONSIVE ── */
@media (max-width: 768px) {
  .admin-sidebar { display: none; }
  .course-sidebar { width: 100%; border-right: none; border-bottom: 1px solid var(--border); max-height: 45vh; }
  .student-body { flex-direction: column; }
  .video-main { padding: 16px; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .video-title-bar { flex-direction: column; }
  .admin-main { padding: 16px; }
}
