/* ─── Sovra LMS — Design System ───────────────────────────────────────────── */
:root {
  --primary: #CF0C49;
  --primary-dark: #a30a3b;
  --accent: #F58657;
  --bg: #0f0f13;
  --bg-card: #1a1a22;
  --bg-card2: #22222e;
  --border: #2e2e3e;
  --text: #f0f0f5;
  --text-muted: #888899;
  --success: #22c55e;
  --warning: #f59e0b;
  --error: #ef4444;
  --radius: 10px;
  --shadow: 0 4px 24px rgba(0,0,0,0.4);
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
}

/* ─── Layout ─────────────────────────────────────────────────────────────── */
.app-layout { display: flex; flex-direction: column; min-height: 100vh; }

.navbar {
  background: var(--bg-card);
  border-bottom: 2px solid var(--primary);
  padding: 0 24px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky; top: 0; z-index: 100;
  box-shadow: 0 2px 16px rgba(207,12,73,0.15);
}

.navbar-brand {
  font-size: 1.5rem;
  font-weight: 900;
  letter-spacing: 3px;
  color: var(--primary);
  text-decoration: none;
}
.navbar-brand span { color: var(--accent); }

.navbar-nav { display: flex; align-items: center; gap: 8px; }
.navbar-nav a {
  color: var(--text-muted); text-decoration: none;
  padding: 6px 14px; border-radius: 6px;
  font-size: 0.9rem; transition: all 0.2s;
}
.navbar-nav a:hover, .navbar-nav a.active { color: var(--text); background: var(--border); }

.navbar-user {
  display: flex; align-items: center; gap: 12px;
}
.user-badge {
  background: var(--primary); color: white;
  padding: 4px 12px; border-radius: 20px;
  font-size: 0.8rem; font-weight: 600;
}

main { flex: 1; padding: 32px 24px; max-width: 1200px; margin: 0 auto; width: 100%; }

/* ─── Cards ──────────────────────────────────────────────────────────────── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
}
.card-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 20px; padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}
.card-title { font-size: 1.1rem; font-weight: 700; color: var(--text); }

/* ─── Buttons ────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 18px; border-radius: 7px; border: none;
  font-size: 0.9rem; font-weight: 600; cursor: pointer;
  transition: all 0.2s; text-decoration: none;
}
.btn:hover { opacity: 0.88; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn-primary { background: var(--primary); color: white; }
.btn-dark { background: var(--primary-dark); color: white; }
.btn-accent { background: var(--accent); color: #1a0f00; }
.btn-ghost { background: var(--border); color: var(--text); }
.btn-success { background: var(--success); color: white; }
.btn-danger { background: var(--error); color: white; }
.btn-sm { padding: 5px 12px; font-size: 0.8rem; }
.btn-lg { padding: 12px 28px; font-size: 1rem; }

/* ─── Forms ──────────────────────────────────────────────────────────────── */
.form-group { margin-bottom: 18px; }
.form-label { display: block; font-size: 0.85rem; color: var(--text-muted); margin-bottom: 6px; font-weight: 600; }
.form-control {
  width: 100%; background: var(--bg-card2); border: 1px solid var(--border);
  color: var(--text); padding: 10px 14px; border-radius: 7px;
  font-size: 0.95rem; transition: border-color 0.2s;
}
.form-control:focus { outline: none; border-color: var(--primary); }
textarea.form-control { min-height: 100px; resize: vertical; }

/* ─── Grid ───────────────────────────────────────────────────────────────── */
.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(auto-fill, minmax(380px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }

/* ─── Path Card ──────────────────────────────────────────────────────────── */
.path-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  transition: all 0.2s;
  cursor: pointer;
}
.path-card:hover { border-color: var(--primary); box-shadow: 0 0 20px rgba(207,12,73,0.2); }
.path-card-name { font-size: 1.2rem; font-weight: 700; color: var(--text); margin-bottom: 8px; }
.path-card-desc { font-size: 0.9rem; color: var(--text-muted); margin-bottom: 16px; }
.path-meta { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px; border-radius: 12px; font-size: 0.78rem; font-weight: 600;
}
.badge-primary { background: rgba(207,12,73,0.2); color: var(--primary); border: 1px solid var(--primary); }
.badge-accent { background: rgba(245,134,87,0.2); color: var(--accent); border: 1px solid var(--accent); }
.badge-success { background: rgba(34,197,94,0.2); color: var(--success); border: 1px solid var(--success); }
.badge-muted { background: var(--border); color: var(--text-muted); }

/* ─── Progress Bar ───────────────────────────────────────────────────────── */
.progress-bar-wrap { background: var(--border); border-radius: 8px; height: 8px; overflow: hidden; }
.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  border-radius: 8px; transition: width 0.4s ease;
}

/* ─── Table ──────────────────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { background: var(--bg-card2); color: var(--text-muted); font-size: 0.8rem; font-weight: 700; padding: 10px 14px; text-align: left; text-transform: uppercase; letter-spacing: 0.5px; }
td { padding: 12px 14px; border-bottom: 1px solid var(--border); font-size: 0.9rem; }
tr:hover td { background: var(--bg-card2); }

/* ─── Auth ───────────────────────────────────────────────────────────────── */
.auth-page {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: radial-gradient(circle at 30% 30%, rgba(207,12,73,0.08), transparent 60%),
              radial-gradient(circle at 70% 70%, rgba(245,134,87,0.05), transparent 60%), var(--bg);
}
.auth-box { width: 100%; max-width: 420px; padding: 40px; background: var(--bg-card); border: 1px solid var(--border); border-radius: 14px; }
.auth-logo { text-align: center; font-size: 2rem; font-weight: 900; letter-spacing: 4px; color: var(--primary); margin-bottom: 6px; }
.auth-subtitle { text-align: center; color: var(--text-muted); font-size: 0.85rem; margin-bottom: 28px; }
.auth-divider { text-align: center; color: var(--text-muted); font-size: 0.85rem; margin: 16px 0; }
.auth-link { color: var(--accent); text-decoration: none; }
.auth-link:hover { text-decoration: underline; }

/* ─── Alerts ─────────────────────────────────────────────────────────────── */
.alert {
  padding: 12px 16px; border-radius: 7px; margin-bottom: 16px;
  font-size: 0.9rem; display: flex; align-items: center; gap: 8px;
}
.alert-error { background: rgba(239,68,68,0.15); border: 1px solid var(--error); color: #fca5a5; }
.alert-success { background: rgba(34,197,94,0.15); border: 1px solid var(--success); color: #86efac; }
.alert-info { background: rgba(207,12,73,0.1); border: 1px solid var(--primary); color: #f9a8c9; }

/* ─── Modal ──────────────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.75);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000; padding: 20px;
}
.modal {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 14px; padding: 28px; width: 100%; max-width: 560px;
  max-height: 90vh; overflow-y: auto;
}
.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.modal-title { font-size: 1.1rem; font-weight: 700; }
.modal-close { background: none; border: none; color: var(--text-muted); cursor: pointer; font-size: 1.4rem; line-height: 1; }
.modal-close:hover { color: var(--text); }
.modal-footer { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--border); }

/* ─── Course Detail ──────────────────────────────────────────────────────── */
.course-list { display: flex; flex-direction: column; gap: 12px; }
.course-item {
  background: var(--bg-card2); border: 1px solid var(--border);
  border-radius: 8px; padding: 16px 20px;
  display: flex; align-items: center; gap: 16px;
  transition: all 0.2s;
}
.course-item:hover { border-color: var(--primary); }
.course-check {
  width: 24px; height: 24px; border-radius: 50%;
  border: 2px solid var(--border); flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s;
}
.course-check.done { background: var(--success); border-color: var(--success); color: white; }
.course-item-info { flex: 1; }
.course-item-title { font-weight: 600; margin-bottom: 2px; }
.course-item-meta { font-size: 0.8rem; color: var(--text-muted); }

/* ─── Video ──────────────────────────────────────────────────────────────── */
.video-container { position: relative; padding-bottom: 56.25%; height: 0; overflow: hidden; border-radius: 8px; background: #000; }
.video-container iframe, .video-container video { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }

/* ─── Hero ───────────────────────────────────────────────────────────────── */
.hero {
  text-align: center; padding: 60px 20px 40px;
  background: radial-gradient(circle at 50% 0%, rgba(207,12,73,0.12), transparent 60%);
  border-radius: 14px; margin-bottom: 32px;
}
.hero-logo { font-size: 3rem; font-weight: 900; letter-spacing: 6px; color: var(--primary); }
.hero-tagline { font-size: 1rem; color: var(--accent); letter-spacing: 2px; margin-bottom: 12px; }
.hero-desc { color: var(--text-muted); max-width: 500px; margin: 0 auto 24px; }

/* ─── Tabs ───────────────────────────────────────────────────────────────── */
.tabs { display: flex; gap: 2px; border-bottom: 2px solid var(--border); margin-bottom: 24px; }
.tab {
  padding: 10px 20px; border: none; background: none; color: var(--text-muted);
  cursor: pointer; font-size: 0.9rem; font-weight: 600; border-bottom: 2px solid transparent;
  margin-bottom: -2px; transition: all 0.2s;
}
.tab.active { color: var(--primary); border-bottom-color: var(--primary); }
.tab:hover:not(.active) { color: var(--text); }
.tab-content { display: none; }
.tab-content.active { display: block; }

/* ─── Drag Handle ────────────────────────────────────────────────────────── */
.drag-handle { cursor: grab; color: var(--text-muted); padding: 0 8px; }
.drag-handle:hover { color: var(--text); }

/* ─── Empty State ────────────────────────────────────────────────────────── */
.empty-state { text-align: center; padding: 60px 20px; color: var(--text-muted); }
.empty-state-icon { font-size: 3rem; margin-bottom: 12px; }
.empty-state-text { font-size: 1rem; }

/* ─── Scrollbar ──────────────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--primary); }

/* ─── Responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  main { padding: 16px; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .navbar { padding: 0 16px; }
  .navbar-brand { font-size: 1.2rem; }
}
