/* =====================================================
   Syeda Driving School LMS — Main Stylesheet
   Colorful & Modern: gradient-driven, card-based
   ===================================================== */

:root {
  --grad-start: #667eea;
  --grad-end:   #764ba2;
  --accent:     #f093fb;
  --accent2:    #f5576c;
  --success:    #11998e;
  --warning:    #f7971e;
  --danger:     #f5576c;
  --dark:       #1a1a2e;
  --card-bg:    #ffffff;
  --body-bg:    #f0f2ff;
  --text:       #2d3748;
  --muted:      #718096;
  --border:     #e2e8f0;
  --radius:     14px;
  --shadow:     0 4px 24px rgba(102,126,234,0.13);
  --shadow-lg:  0 8px 40px rgba(102,126,234,0.22);
}

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

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

/* ── Typography ── */
h1,h2,h3,h4 { font-weight: 700; line-height: 1.25; }
h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.2rem; }
a  { color: var(--grad-start); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Layout ── */
.page-wrap     { display: flex; min-height: 100vh; }
.sidebar       { width: 260px; flex-shrink: 0; background: var(--dark); display: flex; flex-direction: column; }
.main-content  { flex: 1; padding: 2rem; overflow-y: auto; }

/* ── Sidebar ── */
.sidebar-logo {
  padding: 1.8rem 1.5rem 1.2rem;
  background: linear-gradient(135deg, var(--grad-start), var(--grad-end));
}
.sidebar-logo h2 { color: #fff; font-size: 1.1rem; }
.sidebar-logo p  { color: rgba(255,255,255,0.7); font-size: 0.78rem; margin-top: 2px; }

.sidebar-nav { padding: 1rem 0; flex: 1; }
.sidebar-nav a {
  display: flex; align-items: center; gap: 10px;
  padding: 0.75rem 1.5rem;
  color: rgba(255,255,255,0.75);
  font-size: 0.92rem;
  transition: all 0.2s;
}
.sidebar-nav a:hover, .sidebar-nav a.active {
  background: rgba(255,255,255,0.1);
  color: #fff;
  text-decoration: none;
  border-left: 3px solid var(--accent);
  padding-left: calc(1.5rem - 3px);
}
.sidebar-nav .nav-icon { font-size: 1.1rem; }
.sidebar-user {
  padding: 1rem 1.5rem;
  border-top: 1px solid rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.6);
  font-size: 0.82rem;
}
.sidebar-user strong { color: #fff; display: block; font-size: 0.92rem; }

/* ── Top bar ── */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 2rem;
}
.topbar h1 { font-size: 1.6rem; background: linear-gradient(135deg, var(--grad-start), var(--accent2)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.topbar-actions { display: flex; gap: 0.75rem; align-items: center; }

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

/* ── Stat cards ── */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(180px,1fr)); gap: 1.25rem; margin-bottom: 2rem; }
.stat-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 1.4rem 1.5rem;
  box-shadow: var(--shadow);
  position: relative; overflow: hidden;
}
.stat-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 4px;
  background: linear-gradient(90deg, var(--grad-start), var(--accent));
}
.stat-card .stat-num  { font-size: 2rem; font-weight: 800; color: var(--grad-start); }
.stat-card .stat-label{ font-size: 0.82rem; color: var(--muted); margin-top: 2px; }

/* ── Course cards ── */
.courses-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(290px,1fr)); gap: 1.5rem; }
.course-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
}
.course-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.course-card-header {
  padding: 1.4rem 1.4rem 1rem;
  background: linear-gradient(135deg, var(--grad-start), var(--grad-end));
  color: #fff;
  position: relative;
}
.course-card-header h3 { font-size: 1rem; }
.course-card-header .hours-badge {
  display: inline-block; margin-top: 0.4rem;
  background: rgba(255,255,255,0.2);
  border-radius: 20px; padding: 2px 10px; font-size: 0.75rem;
}
.course-card-body { padding: 1.2rem 1.4rem; }
.course-card-body p { font-size: 0.88rem; color: var(--muted); margin-bottom: 1rem; }

/* ── Progress bar ── */
.progress-wrap { margin: 0.5rem 0 1rem; }
.progress-label { display: flex; justify-content: space-between; font-size: 0.78rem; color: var(--muted); margin-bottom: 4px; }
.progress-bar { height: 8px; background: var(--border); border-radius: 999px; overflow: hidden; }
.progress-fill {
  height: 100%; border-radius: 999px;
  background: linear-gradient(90deg, var(--grad-start), var(--accent));
  transition: width 0.6s ease;
}

/* ── Buttons ── */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 0.55rem 1.2rem; border-radius: 8px;
  font-size: 0.88rem; font-weight: 600; cursor: pointer;
  border: none; transition: all 0.2s; text-decoration: none;
}
.btn-primary {
  background: linear-gradient(135deg, var(--grad-start), var(--grad-end));
  color: #fff;
}
.btn-primary:hover { opacity: 0.9; transform: translateY(-1px); box-shadow: 0 4px 14px rgba(102,126,234,0.4); color: #fff; text-decoration: none; }
.btn-accent  { background: linear-gradient(135deg, var(--accent), var(--accent2)); color: #fff; }
.btn-accent:hover { opacity: 0.9; color: #fff; text-decoration: none; }
.btn-outline { background: transparent; border: 2px solid var(--grad-start); color: var(--grad-start); }
.btn-outline:hover { background: var(--grad-start); color: #fff; text-decoration: none; }
.btn-danger  { background: var(--danger); color: #fff; }
.btn-success { background: var(--success); color: #fff; }
.btn-sm { padding: 0.35rem 0.85rem; font-size: 0.8rem; }
.btn-block { display: flex; width: 100%; justify-content: center; }

/* ── Forms ── */
.form-group { margin-bottom: 1.2rem; }
.form-label { display: block; font-size: 0.85rem; font-weight: 600; color: var(--text); margin-bottom: 0.4rem; }
.form-control {
  width: 100%; padding: 0.65rem 0.9rem;
  border: 2px solid var(--border); border-radius: 9px;
  font-size: 0.92rem; color: var(--text);
  background: #fff; transition: border-color 0.2s;
}
.form-control:focus { outline: none; border-color: var(--grad-start); }
.form-hint { font-size: 0.78rem; color: var(--muted); margin-top: 0.3rem; }
select.form-control { appearance: none; cursor: pointer; }
textarea.form-control { resize: vertical; min-height: 90px; }

/* ── Tables ── */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
th { text-align: left; padding: 0.75rem 1rem; background: linear-gradient(135deg, var(--grad-start), var(--grad-end)); color: #fff; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.04em; }
th:first-child { border-radius: 8px 0 0 0; }
th:last-child  { border-radius: 0 8px 0 0; }
td { padding: 0.75rem 1rem; border-bottom: 1px solid var(--border); color: var(--text); vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: #f7f9ff; }

/* ── Badges ── */
.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 0.74rem; font-weight: 600; }
.badge-success { background: #d4edda; color: #155724; }
.badge-warning { background: #fff3cd; color: #856404; }
.badge-danger  { background: #f8d7da; color: #721c24; }
.badge-info    { background: #d1ecf1; color: #0c5460; }
.badge-purple  { background: #e8d5fb; color: #6f42c1; }

/* ── Alerts ── */
.alert { padding: 0.9rem 1.1rem; border-radius: 9px; margin-bottom: 1.2rem; font-size: 0.9rem; }
.alert-success { background: #d4edda; color: #155724; border-left: 4px solid #28a745; }
.alert-danger  { background: #f8d7da; color: #721c24; border-left: 4px solid #dc3545; }
.alert-info    { background: #d1ecf1; color: #0c5460; border-left: 4px solid #17a2b8; }
.alert-warning { background: #fff3cd; color: #856404; border-left: 4px solid #ffc107; }

/* ── Chapter list ── */
.chapter-list { list-style: none; }
.chapter-item {
  display: flex; align-items: center; gap: 1rem;
  padding: 1rem 1.2rem; margin-bottom: 0.75rem;
  background: var(--card-bg); border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  border-left: 4px solid var(--border);
  transition: all 0.2s;
}
.chapter-item.unlocked { border-left-color: var(--grad-start); }
.chapter-item.completed { border-left-color: var(--success); }
.chapter-item.locked    { opacity: 0.6; }
.chapter-num {
  width: 36px; height: 36px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 0.9rem; flex-shrink: 0;
  background: linear-gradient(135deg, var(--grad-start), var(--grad-end)); color: #fff;
}
.chapter-item.completed .chapter-num { background: linear-gradient(135deg, var(--success), #38ef7d); }
.chapter-item.locked    .chapter-num { background: var(--muted); }
.chapter-info { flex: 1; }
.chapter-info h4 { font-size: 0.95rem; margin-bottom: 2px; }
.chapter-info span { font-size: 0.78rem; color: var(--muted); }
.chapter-action { flex-shrink: 0; }

/* ── Video container ── */
.video-container { position: relative; padding-bottom: 56.25%; height: 0; border-radius: 12px; overflow: hidden; margin-bottom: 1.5rem; box-shadow: var(--shadow); }
.video-container iframe { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }

/* ── Time-lock banner ── */
.timelock-banner {
  display: flex; align-items: center; gap: 1rem;
  padding: 1rem 1.3rem; border-radius: 10px;
  background: linear-gradient(135deg, #fff3cd, #ffe8a1);
  border-left: 4px solid var(--warning);
  margin-bottom: 1.5rem;
}
.timelock-banner .lock-icon { font-size: 1.5rem; }

/* ── Login page ── */
.login-page {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--grad-start) 0%, var(--grad-end) 50%, var(--accent2) 100%);
}
.login-box {
  background: #fff; border-radius: 20px;
  padding: 2.5rem; width: 100%; max-width: 420px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}
.login-logo { text-align: center; margin-bottom: 2rem; }
.login-logo h1 { font-size: 1.5rem; background: linear-gradient(135deg, var(--grad-start), var(--accent2)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.login-logo p  { color: var(--muted); font-size: 0.88rem; margin-top: 4px; }

/* ── Responsive ── */
@media (max-width: 768px) {
  .page-wrap { flex-direction: column; }
  .sidebar { width: 100%; }
  .sidebar-nav { display: flex; overflow-x: auto; padding: 0.5rem; }
  .sidebar-nav a { padding: 0.5rem 1rem; white-space: nowrap; border-left: none !important; border-bottom: 3px solid transparent; }
  .sidebar-nav a.active { border-bottom-color: var(--accent); }
  .main-content { padding: 1.2rem; }
  .stats-grid { grid-template-columns: repeat(2,1fr); }
  .courses-grid { grid-template-columns: 1fr; }
}
