/* =============================================
   LoadiGo - Premium Mobile-First CSS
   ============================================= */

@import url('https://fonts.googleapis.com/css2?family=Sora:wght@300;400;500;600;700;800&family=DM+Sans:ital,wght@0,300;0,400;0,500;0,600;1,400&display=swap');

/* ---- CSS Variables ---- */
:root {
  --primary: #FF5722;
  --primary-dark: #E64A19;
  --primary-light: #FF7043;
  --primary-glow: rgba(255, 87, 34, 0.15);
  --secondary: #1A1A2E;
  --accent: #FFC107;
  --success: #00C851;
  --danger: #FF3B30;
  --warning: #FF9500;
  --info: #007AFF;

  --bg: #F8F9FC;
  --bg-card: #FFFFFF;
  --bg-muted: #F0F2F8;
  --border: #E8ECF4;
  --text: #1A1A2E;
  --text-muted: #8892A4;
  --text-light: #B8C1CC;

  --shadow-sm: 0 2px 8px rgba(26,26,46,0.06);
  --shadow-md: 0 4px 20px rgba(26,26,46,0.10);
  --shadow-lg: 0 8px 32px rgba(26,26,46,0.14);
  --shadow-primary: 0 6px 20px rgba(255,87,34,0.30);

  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-xl: 32px;

  --font-main: 'Sora', sans-serif;
  --font-body: 'DM Sans', sans-serif;

  --bottom-nav-height: 68px;
  --header-height: 60px;
}

/* ---- Reset & Base ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  -webkit-tap-highlight-color: transparent;
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: contain;
}

/* ---- Typography ---- */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-main);
  font-weight: 700;
  line-height: 1.2;
  color: var(--secondary);
}

/* ---- App Shell ---- */
.app-shell {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  max-width: 480px;
  margin: 0 auto;
  background: var(--bg);
  position: relative;
}

/* ---- Top Header ---- */
.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  padding: 0 16px;
  height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--shadow-sm);
}

.app-header .logo {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
}

.app-header .logo-icon {
  width: 36px;
  height: 36px;
  background: var(--primary);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.app-header .logo-text {
  font-family: var(--font-main);
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--secondary);
}

.app-header .logo-text span { color: var(--primary); }

.header-action {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  background: var(--bg-muted);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text);
  transition: all 0.2s;
}

.header-action:hover { background: var(--primary-glow); color: var(--primary); }

/* ---- Page Content ---- */
.page-content {
  flex: 1;
  overflow-y: auto;
  padding-bottom: calc(var(--bottom-nav-height) + 16px);
  -webkit-overflow-scrolling: touch;
}

.page-content.no-nav { padding-bottom: 20px; }

/* ---- Bottom Navigation ---- */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  height: var(--bottom-nav-height);
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-around;
  z-index: 200;
  padding: 0 8px;
  box-shadow: 0 -4px 20px rgba(26,26,46,0.08);
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: var(--text-muted);
  transition: all 0.2s;
  position: relative;
  min-width: 64px;
}

.nav-item .nav-icon { font-size: 22px; transition: transform 0.2s; }
.nav-item .nav-label { font-size: 10px; font-weight: 600; font-family: var(--font-main); }
.nav-item.active { color: var(--primary); }
.nav-item.active .nav-icon { transform: scale(1.1); }

.nav-item.active::before {
  content: '';
  position: absolute;
  top: -1px;
  left: 50%;
  transform: translateX(-50%);
  width: 28px;
  height: 3px;
  background: var(--primary);
  border-radius: 0 0 4px 4px;
}

/* ---- Cards ---- */
.card {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.card-body { padding: 16px; }
.card-header-custom {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  font-family: var(--font-main);
  font-weight: 600;
  font-size: 0.95rem;
}

/* ---- Buttons ---- */
.btn-primary-custom {
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  padding: 14px 24px;
  font-family: var(--font-main);
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  width: 100%;
  transition: all 0.3s;
  box-shadow: var(--shadow-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
  letter-spacing: 0.3px;
}

.btn-primary-custom:hover, .btn-primary-custom:focus {
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(255,87,34,0.40);
  color: #fff;
}

.btn-primary-custom:active { transform: translateY(0); }

.btn-outline-custom {
  background: transparent;
  color: var(--primary);
  border: 2px solid var(--primary);
  border-radius: var(--radius-sm);
  padding: 12px 24px;
  font-family: var(--font-main);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  width: 100%;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
}

.btn-outline-custom:hover { background: var(--primary-glow); }

.btn-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 18px;
}

.btn-icon-success { background: rgba(0,200,81,0.12); color: var(--success); }
.btn-icon-primary { background: var(--primary-glow); color: var(--primary); }
.btn-icon-info { background: rgba(0,122,255,0.12); color: var(--info); }

/* ---- Form Controls ---- */
.form-group { margin-bottom: 16px; }

.form-label {
  display: block;
  font-family: var(--font-main);
  font-weight: 600;
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.form-control-custom {
  width: 100%;
  padding: 13px 16px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 0.95rem;
  color: var(--text);
  background: var(--bg-card);
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
  -webkit-appearance: none;
}

.form-control-custom:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.form-control-custom::placeholder { color: var(--text-light); }

.input-icon-wrap {
  position: relative;
}

.input-icon-wrap .input-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 16px;
  pointer-events: none;
}

.input-icon-wrap .form-control-custom { padding-left: 44px; }

/* ---- Status Badges ---- */
.badge-status {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 20px;
  font-family: var(--font-main);
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge-pending  { background: rgba(255,149,0,0.12); color: var(--warning); }
.badge-accepted { background: rgba(0,122,255,0.12); color: var(--info); }
.badge-ongoing  { background: rgba(255,87,34,0.12); color: var(--primary); }
.badge-completed{ background: rgba(0,200,81,0.12); color: var(--success); }
.badge-cancelled{ background: rgba(255,59,48,0.12); color: var(--danger); }

/* ---- Vehicle Category Cards ---- */
.vehicle-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.vehicle-card {
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px 12px;
  text-align: center;
  cursor: pointer;
  transition: all 0.25s;
  position: relative;
  overflow: hidden;
}

.vehicle-card:hover, .vehicle-card.selected {
  border-color: var(--primary);
  background: var(--primary-glow);
  transform: translateY(-2px);
  box-shadow: var(--shadow-primary);
}

.vehicle-card.selected::after {
  content: '✓';
  position: absolute;
  top: 8px;
  right: 8px;
  width: 20px;
  height: 20px;
  background: var(--primary);
  color: #fff;
  border-radius: 50%;
  font-size: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}

.vehicle-emoji { font-size: 2.2rem; margin-bottom: 8px; line-height: 1; }
.vehicle-name {
  font-family: var(--font-main);
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--secondary);
}
.vehicle-capacity {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 2px;
}
.vehicle-fare {
  font-family: var(--font-main);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--primary);
  margin-top: 4px;
}

/* ---- Map Container ---- */
.map-container {
  width: 100%;
  height: 260px;
  border-radius: var(--radius-md);
  overflow: hidden;
  position: relative;
  background: var(--bg-muted);
}

.map-container #map { width: 100%; height: 100%; }

.map-overlay {
  position: absolute;
  bottom: 12px;
  right: 12px;
  z-index: 400;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.map-btn {
  width: 40px;
  height: 40px;
  background: var(--bg-card);
  border: none;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 18px;
  color: var(--text);
  transition: all 0.2s;
}

/* ---- Booking Card ---- */
.booking-card {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  padding: 16px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 12px;
  transition: all 0.2s;
}

.booking-card:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }

.booking-route {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin: 12px 0;
}

.route-point {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 4px 0;
  font-size: 0.875rem;
}

.route-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-top: 5px;
  flex-shrink: 0;
}

.route-dot.pickup { background: var(--success); }
.route-dot.drop { background: var(--primary); }

.route-line {
  width: 2px;
  height: 18px;
  background: var(--border);
  margin-left: 4px;
}

/* ---- Driver Info Card ---- */
.driver-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-md);
  display: flex;
  align-items: center;
  gap: 14px;
}

.driver-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--primary-glow);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary);
  font-family: var(--font-main);
  flex-shrink: 0;
  overflow: hidden;
}

.driver-avatar img { width: 100%; height: 100%; object-fit: cover; }

.driver-info { flex: 1; }
.driver-name { font-family: var(--font-main); font-weight: 700; font-size: 1rem; }
.driver-vehicle { font-size: 0.82rem; color: var(--text-muted); margin-top: 2px; }
.driver-rating {
  display: flex;
  align-items: center;
  gap: 3px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--accent);
  margin-top: 4px;
}

.driver-actions { display: flex; gap: 8px; }

/* ---- Stats Card (Dashboard) ---- */
.stat-card {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  padding: 16px;
  box-shadow: var(--shadow-sm);
  text-align: center;
  border: 1px solid var(--border);
}

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  margin: 0 auto 10px;
}

.stat-value {
  font-family: var(--font-main);
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--secondary);
  line-height: 1;
}

.stat-label {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 4px;
  font-weight: 500;
}

/* ---- Section Headers ---- */
.section-title {
  font-family: var(--font-main);
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--secondary);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.section-link {
  font-size: 0.8rem;
  color: var(--primary);
  font-weight: 600;
  text-decoration: none;
}

/* ---- Online Toggle ---- */
.toggle-online {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg-card);
  border-radius: var(--radius-md);
  padding: 16px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
}

.toggle-switch {
  position: relative;
  width: 54px;
  height: 28px;
  flex-shrink: 0;
}

.toggle-switch input { opacity: 0; width: 0; height: 0; }

.toggle-slider {
  position: absolute;
  inset: 0;
  background: var(--border);
  border-radius: 28px;
  cursor: pointer;
  transition: 0.3s;
}

.toggle-slider::before {
  content: '';
  position: absolute;
  width: 22px;
  height: 22px;
  left: 3px;
  bottom: 3px;
  background: white;
  border-radius: 50%;
  transition: 0.3s;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

input:checked + .toggle-slider { background: var(--success); }
input:checked + .toggle-slider::before { transform: translateX(26px); }

.toggle-label { flex: 1; }
.toggle-label .title { font-family: var(--font-main); font-weight: 600; font-size: 0.95rem; }
.toggle-label .subtitle { font-size: 0.78rem; color: var(--text-muted); }

/* ---- Alert / Toast ---- */
.toast-container {
  position: fixed;
  top: 70px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  width: calc(100% - 32px);
  max-width: 440px;
}

.toast-msg {
  background: var(--secondary);
  color: #fff;
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  font-family: var(--font-main);
  font-weight: 500;
  font-size: 0.875rem;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
  animation: slideDown 0.3s ease;
}

.toast-msg.success { background: var(--success); }
.toast-msg.error { background: var(--danger); }
.toast-msg.warning { background: var(--warning); }

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-12px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ---- Loading Spinner ---- */
.spinner {
  width: 24px;
  height: 24px;
  border: 3px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  display: inline-block;
}

.spinner-primary {
  border-color: var(--primary-glow);
  border-top-color: var(--primary);
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ---- Full Page Loader ---- */
.page-loader {
  position: fixed;
  inset: 0;
  background: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  gap: 16px;
}

.page-loader .logo-big {
  font-family: var(--font-main);
  font-size: 2rem;
  font-weight: 800;
  color: var(--secondary);
}

.page-loader .logo-big span { color: var(--primary); }

/* ---- Empty State ---- */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
  text-align: center;
}

.empty-icon { font-size: 3rem; margin-bottom: 16px; opacity: 0.5; }
.empty-title { font-family: var(--font-main); font-weight: 700; font-size: 1.1rem; margin-bottom: 8px; }
.empty-text { font-size: 0.875rem; color: var(--text-muted); max-width: 240px; }

/* ---- Scrollbar ---- */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

/* ---- Utilities ---- */
.p-16 { padding: 16px; }
.px-16 { padding-left: 16px; padding-right: 16px; }
.py-16 { padding-top: 16px; padding-bottom: 16px; }
.mt-8 { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mb-12 { margin-bottom: 12px; }
.mb-16 { margin-bottom: 16px; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.text-primary { color: var(--primary) !important; }
.text-muted { color: var(--text-muted) !important; }
.text-success { color: var(--success) !important; }
.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }
.font-main { font-family: var(--font-main); }
.d-flex { display: flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.w-100 { width: 100%; }
.rounded-lg { border-radius: var(--radius-lg); }

/* ---- Pulse Animation (live indicator) ---- */
.pulse-dot {
  width: 10px;
  height: 10px;
  background: var(--success);
  border-radius: 50%;
  position: relative;
}

.pulse-dot::before {
  content: '';
  position: absolute;
  inset: -4px;
  background: rgba(0,200,81,0.3);
  border-radius: 50%;
  animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { transform: scale(0.8); opacity: 1; }
  50% { transform: scale(1.4); opacity: 0; }
}

/* ---- Landing Page Specific ---- */
.hero-section {
  background: linear-gradient(145deg, #1A1A2E 0%, #16213E 60%, #0F3460 100%);
  padding: 60px 20px 80px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero-section::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -30%;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(255,87,34,0.2) 0%, transparent 70%);
  pointer-events: none;
}

.hero-title {
  font-family: var(--font-main);
  font-size: clamp(1.8rem, 6vw, 3rem);
  font-weight: 800;
  color: #fff;
  line-height: 1.15;
  margin-bottom: 16px;
}

.hero-title span { color: var(--primary); }

.hero-subtitle {
  font-size: 1rem;
  color: rgba(255,255,255,0.7);
  margin-bottom: 32px;
  max-width: 420px;
  margin-left: auto;
  margin-right: auto;
}

.hero-cta { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

.hero-vehicles {
  display: flex;
  justify-content: center;
  gap: 24px;
  margin-top: 40px;
  flex-wrap: wrap;
}

.hero-vehicle-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  color: rgba(255,255,255,0.8);
  font-family: var(--font-main);
  font-size: 0.78rem;
  font-weight: 600;
}

.hero-vehicle-item .emoji { font-size: 2rem; }

.how-it-works { padding: 48px 20px; }

.step-card {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 20px;
}

.step-num {
  width: 40px;
  height: 40px;
  background: var(--primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-main);
  font-weight: 700;
  color: #fff;
  font-size: 0.9rem;
  flex-shrink: 0;
}

.step-content .title { font-family: var(--font-main); font-weight: 600; font-size: 0.95rem; }
.step-content .desc { font-size: 0.84rem; color: var(--text-muted); margin-top: 2px; }

/* ---- Admin Specific ---- */
.admin-sidebar {
  width: 240px;
  background: var(--secondary);
  min-height: 100vh;
  position: fixed;
  left: 0;
  top: 0;
  z-index: 1000;
  padding: 20px 0;
  transform: translateX(-100%);
  transition: transform 0.3s;
}

.admin-sidebar.open { transform: translateX(0); }

@media (min-width: 768px) {
  .admin-layout { display: flex; }
  .admin-sidebar { transform: translateX(0); position: sticky; }
  .admin-main { margin-left: 240px; flex: 1; min-height: 100vh; }
  .app-shell { max-width: 100%; }
  .bottom-nav { display: none; }
  .page-content { padding-bottom: 20px; }
}

/* ---- Responsive ---- */
@media (max-width: 360px) {
  .vehicle-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .vehicle-card { padding: 12px 8px; }
  .vehicle-emoji { font-size: 1.8rem; }
}
