/* ============================================================
   DRIVING SCHOOL - GLOBAL STYLES
   ============================================================ */

:root {
  --primary: #111111;
  --primary-light: #2d2d2d;
  --primary-dark: #000000;
  --accent: #e31e24;
  --accent-light: #ff5252;
  --success: #28a745;
  --danger: #dc3545;
  --warning: #ffc107;
  --info: #17a2b8;
  --sidebar-width: 260px;
  --sidebar-collapsed: 70px;
  --navbar-height: 64px;
  --bg-light: #f5f5f5;
  --card-shadow: 0 2px 15px rgba(0,0,0,0.08);
  --border-radius: 12px;
  --transition: all 0.3s ease;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Segoe UI', system-ui, -apple-system, sans-serif; background: var(--bg-light); color: #333; }

/* ============================================================
   SIDEBAR
   ============================================================ */
.sidebar {
  position: fixed; top: 0; left: 0; height: 100vh;
  width: var(--sidebar-width); background: var(--primary);
  z-index: 1000; overflow-y: auto; overflow-x: hidden;
  transition: var(--transition); box-shadow: 3px 0 15px rgba(0,0,0,0.15);
}
.sidebar.collapsed { width: var(--sidebar-collapsed); }
.sidebar.collapsed .sidebar-brand span,
.sidebar.collapsed .nav-link span,
.sidebar.collapsed .nav-section,
.sidebar.collapsed .badge { display: none; }
.sidebar.collapsed .nav-link { justify-content: center; padding: 12px; }
.sidebar.collapsed .nav-link i { margin: 0; font-size: 1.2rem; }

.sidebar-header {
  padding: 20px 18px; border-bottom: 1px solid rgba(255,255,255,0.1);
  min-height: var(--navbar-height);
}
.sidebar-brand {
  color: #fff; font-size: 1.1rem; font-weight: 700;
  display: flex; align-items: center; white-space: nowrap;
}
.sidebar-logo { max-height: 40px; max-width: 180px; object-fit: contain; }

.sidebar-menu { padding: 10px 0; }
.nav-section {
  color: rgba(255,255,255,0.4); font-size: 0.65rem; font-weight: 700;
  letter-spacing: 1.5px; padding: 14px 18px 6px; text-transform: uppercase;
}
.nav-link {
  color: rgba(255,255,255,0.75) !important; padding: 11px 18px;
  display: flex; align-items: center; gap: 12px; border-radius: 0;
  transition: var(--transition); font-size: 0.9rem; white-space: nowrap;
}
.nav-link:hover { background: rgba(255,255,255,0.1); color: #fff !important; }
.nav-link.active { background: rgba(255,255,255,0.15); color: #fff !important; border-left: 3px solid #e31e24; }
.nav-link i { width: 20px; text-align: center; font-size: 1rem; flex-shrink: 0; }

/* ============================================================
   MAIN WRAPPER
   ============================================================ */
.main-wrapper {
  margin-left: var(--sidebar-width); min-height: 100vh;
  transition: var(--transition); display: flex; flex-direction: column;
}
.main-wrapper.expanded { margin-left: var(--sidebar-collapsed); }

/* ============================================================
   TOP NAVBAR
   ============================================================ */
.top-navbar {
  height: var(--navbar-height); background: #fff;
  box-shadow: 0 2px 10px rgba(0,0,0,0.08);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px; position: sticky; top: 0; z-index: 999;
}
.page-title-nav { font-weight: 600; font-size: 1rem; color: var(--primary); }
.sidebar-toggle { background: none; border: 1px solid #e0e0e0; color: #666; border-radius: 8px; padding: 6px 10px; }
.sidebar-toggle:hover { background: var(--bg-light); }

.nav-icon-btn {
  color: #666; font-size: 1.1rem; text-decoration: none;
  padding: 8px; border-radius: 8px; transition: var(--transition);
}
.nav-icon-btn:hover { background: var(--bg-light); color: var(--primary); }
.notif-dot {
  position: absolute; top: 2px; right: 2px; background: var(--danger);
  color: #fff; font-size: 0.6rem; width: 16px; height: 16px;
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
}
.user-dropdown-btn {
  background: none; border: 1px solid #e0e0e0; border-radius: 8px;
  padding: 6px 12px; display: flex; align-items: center; gap: 8px; color: #333;
}
.user-dropdown-btn:hover { background: var(--bg-light); }
.user-avatar-sm {
  width: 32px; height: 32px; border-radius: 50%; background: var(--primary);
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 0.85rem; flex-shrink: 0;
}
.trainer-avatar { background: #198754; }
.student-avatar { background: #0d6efd; }

/* ============================================================
   PAGE CONTENT
   ============================================================ */
.page-content { padding: 24px; flex: 1; }

/* ============================================================
   CARDS
   ============================================================ */
.card {
  border: none; border-radius: var(--border-radius);
  box-shadow: var(--card-shadow); background: #fff;
}
.card-header {
  background: #fff; border-bottom: 1px solid #f0f0f0;
  padding: 16px 20px; border-radius: var(--border-radius) var(--border-radius) 0 0 !important;
  font-weight: 600; color: var(--primary);
}

/* Stat Cards */
.stat-card {
  border-radius: var(--border-radius); padding: 20px;
  background: #fff; box-shadow: var(--card-shadow);
  display: flex; align-items: center; gap: 16px;
  transition: var(--transition); text-decoration: none; color: inherit;
}
.stat-card:hover { transform: translateY(-3px); box-shadow: 0 8px 25px rgba(0,0,0,0.12); color: inherit; }
.stat-icon {
  width: 56px; height: 56px; border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem; flex-shrink: 0;
}
.stat-icon.blue { background: rgba(26,60,94,0.1); color: var(--primary); }
.stat-icon.green { background: rgba(40,167,69,0.1); color: var(--success); }
.stat-icon.orange { background: rgba(240,165,0,0.1); color: var(--accent); }
.stat-icon.red { background: rgba(220,53,69,0.1); color: var(--danger); }
.stat-icon.purple { background: rgba(111,66,193,0.1); color: #6f42c1; }
.stat-icon.teal { background: rgba(23,162,184,0.1); color: var(--info); }
.stat-value { font-size: 1.8rem; font-weight: 700; line-height: 1; color: var(--primary); }
.stat-label { font-size: 0.8rem; color: #888; margin-top: 4px; }

/* ============================================================
   TABLES
   ============================================================ */
.table-card { border-radius: var(--border-radius); overflow: hidden; box-shadow: var(--card-shadow); }
.table { margin: 0; }
.table thead th {
  background: var(--primary); color: #fff; font-weight: 600;
  font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.5px;
  border: none; padding: 12px 16px; white-space: nowrap;
}
.table tbody td { padding: 12px 16px; vertical-align: middle; border-color: #f0f0f0; font-size: 0.9rem; }
.table tbody tr:hover { background: rgba(26,60,94,0.03); }

/* ============================================================
   FORMS
   ============================================================ */
.form-label { font-weight: 600; font-size: 0.85rem; color: #555; margin-bottom: 6px; }
.form-control, .form-select {
  border: 1.5px solid #e0e0e0; border-radius: 8px; padding: 10px 14px;
  font-size: 0.9rem; transition: var(--transition);
}
.form-control:focus, .form-select:focus {
  border-color: var(--primary-light); box-shadow: 0 0 0 3px rgba(45,106,159,0.15);
}
.form-section-title {
  font-size: 0.75rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 1px; color: var(--primary); border-bottom: 2px solid var(--primary);
  padding-bottom: 8px; margin-bottom: 16px; margin-top: 8px;
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn { border-radius: 8px; font-weight: 600; font-size: 0.88rem; padding: 9px 18px; transition: var(--transition); }
.btn-primary { background: var(--primary); border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); }
.btn-sm { padding: 5px 12px; font-size: 0.8rem; }
.btn-icon { width: 32px; height: 32px; padding: 0; display: inline-flex; align-items: center; justify-content: center; border-radius: 8px; }

/* ============================================================
   BADGES
   ============================================================ */
.badge { font-size: 0.75rem; padding: 5px 10px; border-radius: 6px; font-weight: 600; }

/* ============================================================
   AUTH PAGES
   ============================================================ */
.auth-body { background: linear-gradient(135deg, #0a0a0a 0%, #1a1a1a 60%, #2d0a0a 100%); min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.auth-card { background: #fff; border-radius: 20px; box-shadow: 0 20px 60px rgba(0,0,0,0.35); overflow: hidden; width: 100%; max-width: 480px; }
.auth-header { background: linear-gradient(135deg, #111111, #2d2d2d); padding: 32px; text-align: center; color: #fff; border-bottom: 3px solid #e31e24; }
.auth-header h2 { font-size: 1.6rem; font-weight: 800; margin-bottom: 6px; }
.auth-header p { opacity: 0.8; font-size: 0.9rem; margin: 0; }
.auth-body-inner { padding: 32px; }
.auth-logo { font-size: 2.5rem; margin-bottom: 12px; color: #e31e24; }

/* Role Selection */
.role-card {
  border: 2px solid #e5e5e5; border-radius: 16px; padding: 28px 20px;
  text-align: center; cursor: pointer; transition: var(--transition);
  text-decoration: none; color: inherit; display: block;
}
.role-card:hover, .role-card.selected {
  border-color: #e31e24; background: rgba(227,30,36,0.05); color: inherit;
  transform: translateY(-4px); box-shadow: 0 8px 25px rgba(227,30,36,0.18);
}
.role-icon { font-size: 3rem; margin-bottom: 12px; }
.role-title { font-size: 1.1rem; font-weight: 800; color: #111; }
.role-desc { font-size: 0.82rem; color: #888; margin-top: 6px; }

/* OTP Input */
.otp-inputs { display: flex; gap: 10px; justify-content: center; }
.otp-input {
  width: 52px; height: 56px; text-align: center; font-size: 1.4rem;
  font-weight: 700; border: 2px solid #e0e0e0; border-radius: 10px;
  transition: var(--transition);
}
.otp-input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(26,60,94,0.15); outline: none; }

/* ============================================================
   PROFILE
   ============================================================ */
.profile-avatar {
  width: 100px; height: 100px; border-radius: 50%; object-fit: cover;
  border: 4px solid #fff; box-shadow: 0 4px 15px rgba(0,0,0,0.15);
}
.profile-avatar-placeholder {
  width: 100px; height: 100px; border-radius: 50%; background: var(--primary);
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-size: 2.5rem; font-weight: 700; border: 4px solid #fff;
  box-shadow: 0 4px 15px rgba(0,0,0,0.15);
}

/* ============================================================
   PROGRESS
   ============================================================ */
.progress { border-radius: 10px; background: #e9ecef; }
.progress-bar { border-radius: 10px; }

/* ============================================================
   ALERTS
   ============================================================ */
.alert { border: none; border-radius: 10px; font-size: 0.9rem; }

/* ============================================================
   MOBILE RESPONSIVE
   ============================================================ */
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.mobile-open { transform: translateX(0); }
  .main-wrapper { margin-left: 0 !important; }
  .page-content { padding: 16px; }
  .stat-value { font-size: 1.4rem; }
  .auth-card { max-width: 100%; }
  .otp-input { width: 44px; height: 50px; font-size: 1.2rem; }
}

/* ============================================================
   LANDING PAGE
   ============================================================ */
.landing-hero {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 60%, #1a6fa8 100%);
  min-height: 100vh; display: flex; align-items: center; color: #fff;
}
.landing-nav { background: rgba(26,60,94,0.95); backdrop-filter: blur(10px); }
.feature-card { border-radius: 16px; padding: 28px; text-align: center; transition: var(--transition); }
.feature-card:hover { transform: translateY(-5px); box-shadow: 0 15px 40px rgba(0,0,0,0.12); }
.feature-icon { font-size: 2.5rem; margin-bottom: 16px; }

/* ============================================================
   MISC
   ============================================================ */
.page-header { margin-bottom: 24px; }
.page-header h4 { font-weight: 700; color: var(--primary); margin: 0; }
.breadcrumb { font-size: 0.82rem; }
.breadcrumb-item.active { color: #888; }
.filter-bar { background: #fff; border-radius: var(--border-radius); padding: 16px 20px; box-shadow: var(--card-shadow); margin-bottom: 20px; }
.empty-state { text-align: center; padding: 60px 20px; color: #aaa; }
.empty-state i { font-size: 3rem; margin-bottom: 16px; display: block; }
.upload-preview { max-width: 200px; max-height: 200px; border-radius: 8px; object-fit: cover; border: 2px solid #e0e0e0; }
.qr-image { max-width: 220px; border-radius: 12px; box-shadow: var(--card-shadow); }
.rating-stars { color: var(--accent); }
.timeline { position: relative; padding-left: 24px; }
.timeline::before { content: ''; position: absolute; left: 8px; top: 0; bottom: 0; width: 2px; background: #e0e0e0; }
.timeline-item { position: relative; margin-bottom: 20px; }
.timeline-item::before { content: ''; position: absolute; left: -20px; top: 6px; width: 10px; height: 10px; border-radius: 50%; background: var(--primary); }
