/* ═══════════════════════════════════════════
   HustleRides — Shared Application Styles
   Design: Dark theme, yellow accents
   Fonts: Space Grotesk (headings), Plus Jakarta Sans (body)
   ═══════════════════════════════════════════ */

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

:root {
  --black: #0a0a0a;
  --white: #ffffff;
  --yellow: #F5C518;
  --yellow-dim: #d4a913;
  --yellow-glow: rgba(245, 197, 24, 0.15);
  --gray-100: #f5f5f5;
  --gray-200: #e5e5e5;
  --gray-400: #a3a3a3;
  --gray-600: #525252;
  --gray-800: #262626;
  --gray-900: #171717;
  --green: #22c55e;
  --green-dim: #16a34a;
  --red: #ef4444;
  --red-dim: #dc2626;
  --blue: #3b82f6;
  --orange: #f97316;
}

body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--black);
  color: var(--white);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

h1, h2, h3, h4 {
  font-family: 'Space Grotesk', sans-serif;
}

a { color: var(--yellow); text-decoration: none; }
a:hover { color: var(--yellow-dim); }

/* ─── NAV ────────────────────────────────── */

.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 1rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(10, 10, 10, 0.9);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--gray-900);
}

.nav-logo {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 1.2rem;
  color: var(--white);
}

.nav-logo .hl { color: var(--yellow); }

.nav-links {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.nav-links a {
  padding: 0.5rem 1rem;
  border-radius: 8px;
  font-size: 0.9rem;
  color: var(--gray-400);
  transition: all 0.2s;
}

.nav-links a:hover {
  color: var(--white);
  background: var(--gray-900);
}

.nav-links a.active {
  color: var(--yellow);
}

.nav-user {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.nav-user-name {
  font-size: 0.85rem;
  color: var(--gray-400);
}

.nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0.5rem 1.25rem;
  background: var(--yellow);
  color: var(--black);
  font-weight: 600;
  font-size: 0.85rem;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
}

.nav-btn:hover {
  background: var(--yellow-dim);
  color: var(--black);
}

.nav-btn-outline {
  background: transparent;
  border: 1px solid var(--gray-800);
  color: var(--gray-400);
}

.nav-btn-outline:hover {
  border-color: var(--yellow);
  color: var(--yellow);
  background: transparent;
}

/* ─── LAYOUT ─────────────────────────────── */

.page {
  padding: 6rem 2rem 3rem;
  max-width: 800px;
  margin: 0 auto;
}

.page-wide {
  max-width: 1100px;
}

.page-header {
  margin-bottom: 2rem;
}

.page-header h1 {
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 0.5rem;
}

.page-header p {
  color: var(--gray-400);
  font-size: 1rem;
  line-height: 1.6;
}

.page-header .hl { color: var(--yellow); }

/* ─── CARDS ──────────────────────────────── */

.card {
  background: var(--gray-900);
  border-radius: 16px;
  padding: 2rem;
  margin-bottom: 1.5rem;
  border: 1px solid transparent;
  transition: border-color 0.2s;
}

.card:hover {
  border-color: var(--gray-800);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1rem;
}

.card-title {
  font-size: 1.1rem;
  font-weight: 600;
}

.card-subtitle {
  font-size: 0.85rem;
  color: var(--gray-400);
  margin-top: 0.25rem;
}

/* ─── FORMS ──────────────────────────────── */

.form-group {
  margin-bottom: 1.25rem;
}

.form-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--gray-400);
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.form-input {
  width: 100%;
  padding: 0.85rem 1rem;
  background: var(--gray-800);
  border: 1px solid var(--gray-800);
  border-radius: 10px;
  color: var(--white);
  font-family: inherit;
  font-size: 0.95rem;
  transition: all 0.2s;
  outline: none;
}

.form-input:focus {
  border-color: var(--yellow);
  box-shadow: 0 0 0 3px var(--yellow-glow);
}

.form-input::placeholder {
  color: var(--gray-600);
}

select.form-input {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%23a3a3a3' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
}

textarea.form-input {
  resize: vertical;
  min-height: 80px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.form-hint {
  font-size: 0.8rem;
  color: var(--gray-600);
  margin-top: 0.35rem;
}

.form-error {
  font-size: 0.8rem;
  color: var(--red);
  margin-top: 0.35rem;
}

/* ─── BUTTONS ────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0.85rem 1.75rem;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 600;
  font-size: 0.95rem;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--yellow);
  color: var(--black);
}

.btn-primary:hover:not(:disabled) {
  background: var(--yellow-dim);
}

.btn-secondary {
  background: var(--gray-800);
  color: var(--white);
}

.btn-secondary:hover:not(:disabled) {
  background: var(--gray-600);
}

.btn-danger {
  background: var(--red);
  color: var(--white);
}

.btn-danger:hover:not(:disabled) {
  background: var(--red-dim);
}

.btn-success {
  background: var(--green);
  color: var(--white);
}

.btn-success:hover:not(:disabled) {
  background: var(--green-dim);
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--gray-800);
  color: var(--gray-400);
}

.btn-outline:hover:not(:disabled) {
  border-color: var(--yellow);
  color: var(--yellow);
}

.btn-sm {
  padding: 0.5rem 1rem;
  font-size: 0.8rem;
  border-radius: 8px;
}

.btn-lg {
  padding: 1rem 2.5rem;
  font-size: 1.1rem;
}

.btn-full {
  width: 100%;
}

.btn-group {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

/* ─── BADGES ─────────────────────────────── */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 100px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.badge-pending { background: rgba(249, 115, 22, 0.15); color: var(--orange); }
.badge-accepted { background: rgba(59, 130, 246, 0.15); color: var(--blue); }
.badge-in-progress, .badge-collected { background: rgba(245, 197, 24, 0.15); color: var(--yellow); }
.badge-completed, .badge-delivered { background: rgba(34, 197, 94, 0.15); color: var(--green); }
.badge-cancelled { background: rgba(239, 68, 68, 0.15); color: var(--red); }
.badge-rider { background: rgba(59, 130, 246, 0.15); color: var(--blue); }
.badge-driver { background: rgba(245, 197, 24, 0.15); color: var(--yellow); }

/* ─── FARE DISPLAY ───────────────────────── */

.fare-box {
  background: var(--gray-800);
  border: 1px solid var(--gray-800);
  border-radius: 12px;
  padding: 1.5rem;
  margin: 1.5rem 0;
  text-align: center;
}

.fare-box.active {
  border-color: var(--yellow);
  background: rgba(245, 197, 24, 0.05);
}

.fare-amount {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--yellow);
}

.fare-label {
  font-size: 0.8rem;
  color: var(--gray-400);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-top: 4px;
}

.fare-breakdown {
  display: flex;
  justify-content: center;
  gap: 2rem;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--gray-800);
}

.fare-item {
  text-align: center;
}

.fare-item-value {
  font-weight: 600;
  font-size: 0.95rem;
}

.fare-item-label {
  font-size: 0.75rem;
  color: var(--gray-600);
  margin-top: 2px;
}

/* ─── STATS GRID ─────────────────────────── */

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: var(--gray-900);
  border-radius: 12px;
  padding: 1.25rem;
  text-align: center;
}

.stat-value {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--yellow);
}

.stat-label {
  font-size: 0.75rem;
  color: var(--gray-600);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-top: 4px;
}

/* ─── TRIP CARDS ─────────────────────────── */

.trip-card {
  background: var(--gray-900);
  border-radius: 14px;
  padding: 1.5rem;
  margin-bottom: 1rem;
  border: 1px solid transparent;
  transition: all 0.2s;
}

.trip-card:hover {
  border-color: var(--gray-800);
}

.trip-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.trip-type {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--gray-400);
}

.trip-route {
  margin-bottom: 1rem;
}

.trip-point {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 0.5rem 0;
}

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

.trip-dot-pickup { background: var(--green); }
.trip-dot-dest { background: var(--yellow); }
.trip-dot-store { background: var(--blue); }

.trip-address {
  font-size: 0.95rem;
  line-height: 1.4;
}

.trip-address-label {
  font-size: 0.7rem;
  color: var(--gray-600);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.trip-connector {
  width: 2px;
  height: 20px;
  background: var(--gray-800);
  margin-left: 4px;
}

.trip-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 1rem;
  border-top: 1px solid var(--gray-800);
}

.trip-fare {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--yellow);
}

.trip-time {
  font-size: 0.8rem;
  color: var(--gray-600);
}

.trip-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 1rem;
}

.trip-driver-info {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0.75rem;
  background: var(--gray-800);
  border-radius: 10px;
  margin-top: 0.75rem;
}

.trip-driver-avatar {
  width: 36px;
  height: 36px;
  background: var(--yellow);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--black);
  font-weight: 700;
  font-size: 0.85rem;
}

.trip-driver-details {
  flex: 1;
}

.trip-driver-name {
  font-weight: 600;
  font-size: 0.9rem;
}

.trip-driver-vehicle {
  font-size: 0.8rem;
  color: var(--gray-400);
}

/* ─── TOGGLE SWITCH ──────────────────────── */

.toggle {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
}

.toggle-track {
  width: 52px;
  height: 28px;
  background: var(--gray-800);
  border-radius: 100px;
  position: relative;
  transition: background 0.2s;
}

.toggle-track.active {
  background: var(--green);
}

.toggle-thumb {
  width: 22px;
  height: 22px;
  background: var(--white);
  border-radius: 50%;
  position: absolute;
  top: 3px;
  left: 3px;
  transition: transform 0.2s;
}

.toggle-track.active .toggle-thumb {
  transform: translateX(24px);
}

.toggle-label {
  font-size: 0.95rem;
  font-weight: 500;
}

/* ─── EMPTY STATE ────────────────────────── */

.empty-state {
  text-align: center;
  padding: 4rem 2rem;
  color: var(--gray-600);
}

.empty-state-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.empty-state h3 {
  font-size: 1.2rem;
  color: var(--gray-400);
  margin-bottom: 0.5rem;
}

.empty-state p {
  font-size: 0.9rem;
  max-width: 400px;
  margin: 0 auto;
  line-height: 1.6;
}

/* ─── TABS ───────────────────────────────── */

.tabs {
  display: flex;
  gap: 4px;
  background: var(--gray-900);
  border-radius: 12px;
  padding: 4px;
  margin-bottom: 1.5rem;
}

.tab {
  flex: 1;
  padding: 0.65rem 1rem;
  text-align: center;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--gray-400);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
  background: none;
  font-family: inherit;
}

.tab:hover {
  color: var(--white);
}

.tab.active {
  background: var(--gray-800);
  color: var(--yellow);
}

/* ─── ALERTS ─────────────────────────────── */

.alert {
  padding: 1rem 1.25rem;
  border-radius: 10px;
  font-size: 0.9rem;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 10px;
}

.alert-success {
  background: rgba(34, 197, 94, 0.1);
  color: var(--green);
  border: 1px solid rgba(34, 197, 94, 0.2);
}

.alert-error {
  background: rgba(239, 68, 68, 0.1);
  color: var(--red);
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.alert-info {
  background: rgba(59, 130, 246, 0.1);
  color: var(--blue);
  border: 1px solid rgba(59, 130, 246, 0.2);
}

/* ─── LOADING ────────────────────────────── */

.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid var(--gray-800);
  border-top-color: var(--yellow);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

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

.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 10, 10, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

/* ─── AUTH PAGES ─────────────────────────── */

.auth-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.auth-box {
  width: 100%;
  max-width: 420px;
}

.auth-box .logo {
  text-align: center;
  margin-bottom: 2rem;
}

.auth-box .logo h2 {
  font-size: 1.5rem;
  font-weight: 700;
}

.auth-box .logo .hl { color: var(--yellow); }

.auth-box .logo p {
  color: var(--gray-400);
  font-size: 0.9rem;
  margin-top: 0.5rem;
}

.auth-footer {
  text-align: center;
  margin-top: 1.5rem;
  font-size: 0.85rem;
  color: var(--gray-600);
}

.role-selector {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.role-option {
  padding: 1rem;
  background: var(--gray-900);
  border: 2px solid var(--gray-800);
  border-radius: 12px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
}

.role-option:hover {
  border-color: var(--gray-600);
}

.role-option.selected {
  border-color: var(--yellow);
  background: rgba(245, 197, 24, 0.05);
}

.role-option-icon {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}

.role-option-label {
  font-weight: 600;
  font-size: 0.9rem;
}

.role-option-desc {
  font-size: 0.75rem;
  color: var(--gray-400);
  margin-top: 0.25rem;
}

/* ─── STORE SELECTOR ─────────────────────── */

.store-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.store-option {
  padding: 1rem;
  background: var(--gray-900);
  border: 2px solid var(--gray-800);
  border-radius: 12px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
}

.store-option:hover {
  border-color: var(--gray-600);
}

.store-option.selected {
  border-color: var(--yellow);
  background: rgba(245, 197, 24, 0.05);
}

.store-option-icon {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}

.store-option-name {
  font-weight: 600;
  font-size: 0.85rem;
}

/* ─── DRIVER ONLINE/OFFLINE ──────────────── */

.driver-status-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  background: var(--gray-900);
  border-radius: 14px;
  margin-bottom: 1.5rem;
}

.driver-status-text {
  font-weight: 600;
}

.driver-status-text.online {
  color: var(--green);
}

.driver-status-text.offline {
  color: var(--gray-400);
}

/* ─── RESPONSIVE ─────────────────────────── */

@media (max-width: 768px) {
  .nav {
    padding: 0.75rem 1rem;
  }

  .nav-links a {
    padding: 0.4rem 0.6rem;
    font-size: 0.8rem;
  }

  .page {
    padding: 5rem 1rem 2rem;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .fare-breakdown {
    gap: 1rem;
  }

  .store-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .btn-group {
    flex-direction: column;
  }

  .trip-actions {
    flex-direction: column;
  }
}

@media (max-width: 480px) {
  .stats-grid {
    grid-template-columns: 1fr 1fr;
  }
}
