/* VanPool — Main Stylesheet */
/* Aesthetic: Bold industrial transport — high contrast, Syne display, utility-forward */

:root {
  --ink: #0d0d0d;
  --ink-2: #2a2a2a;
  --ink-3: #555;
  --ink-4: #888;
  --paper: #f5f3ee;
  --paper-2: #ece9e2;
  --paper-3: #e0ddd6;
  --accent: #e8420a;
  --accent-2: #ff6b3d;
  --accent-light: #ffeee8;
  --green: #1a7a4a;
  --green-light: #e6f4ec;
  --amber: #b45309;
  --amber-light: #fef3c7;
  --blue: #1e40af;
  --blue-light: #dbeafe;
  --border: #d5d2cb;
  --border-dark: #999;
  --radius: 6px;
  --radius-lg: 12px;
  --shadow: 3px 3px 0 #0d0d0d;
  --shadow-sm: 2px 2px 0 #0d0d0d;
  --font-display: 'Syne', sans-serif;
  --font-body: 'DM Sans', sans-serif;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--paper);
  color: var(--ink);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── Navigation ── */
.topnav {
  display: flex;
  align-items: center;
  gap: 2rem;
  padding: 0 2rem;
  height: 60px;
  background: var(--ink);
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 2px solid var(--accent);
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 18px;
  color: #fff;
  text-decoration: none;
  letter-spacing: -0.5px;
  white-space: nowrap;
}

.brand-icon { color: var(--accent); font-size: 20px; }

.nav-links {
  display: flex;
  align-items: center;
  gap: 0;
  flex: 1;
}

.nav-link {
  color: rgba(255,255,255,0.6);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  padding: 0 1rem;
  height: 60px;
  display: flex;
  align-items: center;
  transition: all 0.15s;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
}
.nav-link:hover, .nav-link.active {
  color: #fff;
  border-bottom-color: var(--accent);
}

.nav-auth, .nav-user {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.user-badge {
  font-size: 13px;
  color: rgba(255,255,255,0.7);
  font-family: var(--font-display);
}

/* ── Buttons ── */
.btn-primary {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15px;
  background: var(--accent);
  color: #fff;
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  padding: 10px 24px;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: transform 0.1s, box-shadow 0.1s;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}
.btn-primary:hover { transform: translate(-1px,-1px); box-shadow: 4px 4px 0 var(--ink); }
.btn-primary:active { transform: translate(1px,1px); box-shadow: 1px 1px 0 var(--ink); }

.btn-primary-sm {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 13px;
  background: var(--accent);
  color: #fff;
  border: 1.5px solid rgba(255,255,255,0.3);
  border-radius: var(--radius);
  padding: 6px 16px;
  cursor: pointer;
  text-decoration: none;
}
.btn-primary-sm:hover { background: var(--accent-2); }

.btn-ghost {
  font-size: 13px;
  background: transparent;
  color: rgba(255,255,255,0.8);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: var(--radius);
  padding: 6px 14px;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s;
}
.btn-ghost:hover { background: rgba(255,255,255,0.1); color: #fff; }

.btn-outline {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 14px;
  background: var(--paper);
  color: var(--ink);
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  padding: 8px 20px;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: transform 0.1s, box-shadow 0.1s;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.btn-outline:hover { transform: translate(-1px,-1px); box-shadow: 3px 3px 0 var(--ink); }
.btn-outline:active { transform: translate(1px,1px); box-shadow: 0 0 0 var(--ink); }

.btn-sm {
  font-size: 12px;
  padding: 5px 12px;
  font-weight: 600;
}

.btn-danger {
  background: #fee2e2;
  color: #991b1b;
  border-color: #991b1b;
}

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

/* ── Hero ── */
.hero {
  background: var(--ink);
  color: #fff;
  padding: 5rem 2rem 4rem;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: 'VANPOOL';
  position: absolute;
  top: -20px;
  right: -20px;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 14rem;
  color: rgba(255,255,255,0.03);
  line-height: 1;
  pointer-events: none;
  user-select: none;
}

.hero-inner {
  max-width: 900px;
  margin: 0 auto;
}

.hero-tag {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 2px;
  text-transform: uppercase;
  padding: 4px 12px;
  border-radius: 2px;
  margin-bottom: 1.5rem;
}

.hero h1 {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(2.5rem, 6vw, 5rem);
  line-height: 1.0;
  letter-spacing: -2px;
  margin-bottom: 1.25rem;
}

.hero h1 em {
  font-style: normal;
  color: var(--accent-2);
}

.hero-sub {
  font-size: 1.1rem;
  color: rgba(255,255,255,0.65);
  max-width: 500px;
  margin-bottom: 2.5rem;
  font-weight: 300;
}

/* ── Search Panel ── */
.search-panel {
  background: var(--paper);
  border: 2px solid var(--ink);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow);
  max-width: 800px;
}

.search-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr auto;
  gap: 10px;
  align-items: end;
}

.search-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr auto;
  gap: 10px;
  align-items: end;
  margin-top: 10px;
}

.form-group { display: flex; flex-direction: column; gap: 4px; }
.form-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--ink-3);
  font-family: var(--font-display);
}

.form-input, .form-select, .form-textarea {
  font-family: var(--font-body);
  font-size: 14px;
  padding: 9px 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
  outline: none;
  transition: border-color 0.15s;
  width: 100%;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--ink);
}

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

/* ── Main Content ── */
main#app { flex: 1; }

.page { animation: fadeIn 0.2s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.container { max-width: 1100px; margin: 0 auto; padding: 0 2rem; }
.container-sm { max-width: 700px; margin: 0 auto; padding: 0 2rem; }
.container-md { max-width: 900px; margin: 0 auto; padding: 0 2rem; }

.section { padding: 3rem 0; }
.section-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.75rem;
  letter-spacing: -0.5px;
  margin-bottom: 0.25rem;
}
.section-sub { font-size: 14px; color: var(--ink-3); margin-bottom: 2rem; }

/* ── Trip Cards ── */
.trips-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 1.25rem;
}

.trip-card {
  background: #fff;
  border: 2px solid var(--ink);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform 0.15s, box-shadow 0.15s;
  cursor: pointer;
  text-decoration: none;
  display: block;
  color: inherit;
}
.trip-card:hover { transform: translate(-2px,-2px); box-shadow: 5px 5px 0 var(--ink); }

.trip-card-header {
  background: var(--ink-2);
  color: #fff;
  padding: 1rem 1.25rem 0.75rem;
  position: relative;
}

.trip-card-type {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--accent);
  color: #fff;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 10px;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: 2px;
  margin-bottom: 8px;
}

.trip-card-event {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.1rem;
  line-height: 1.2;
  margin-bottom: 4px;
}

.trip-card-location {
  font-size: 12px;
  color: rgba(255,255,255,0.6);
  display: flex;
  align-items: center;
  gap: 4px;
}

.trip-card-body { padding: 1rem 1.25rem; }

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

.trip-date {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 13px;
  color: var(--ink-2);
}

.trip-price {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.25rem;
  color: var(--accent);
}
.trip-price span { font-size: 11px; font-weight: 400; color: var(--ink-4); }

.trip-seats {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 0.75rem;
}

.seats-bar {
  flex: 1;
  height: 6px;
  background: var(--paper-3);
  border-radius: 3px;
  overflow: hidden;
  border: 1px solid var(--border);
}
.seats-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 3px;
  transition: width 0.3s;
}
.seats-fill.green { background: var(--green); }
.seats-fill.amber { background: var(--amber); }

.seats-label { font-size: 12px; color: var(--ink-3); white-space: nowrap; }

.trip-pickups {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  color: var(--ink-3);
}

.pickup-dot {
  display: flex;
  align-items: center;
  gap: 6px;
}
.pickup-dot::before {
  content: '●';
  font-size: 8px;
  color: var(--accent);
  flex-shrink: 0;
}

.trip-driver {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: var(--ink-4);
}

/* ── Badges ── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: var(--radius);
  white-space: nowrap;
}
.badge-active { background: var(--green-light); color: var(--green); }
.badge-full { background: var(--amber-light); color: var(--amber); }
.badge-offline { background: var(--paper-3); color: var(--ink-3); }
.badge-cancelled { background: #fee2e2; color: #991b1b; }
.badge-pending { background: var(--amber-light); color: var(--amber); }
.badge-approved { background: var(--green-light); color: var(--green); }
.badge-suspended { background: #fee2e2; color: #991b1b; }
.badge-confirmed { background: var(--green-light); color: var(--green); }

/* ── Modal / Overlay ── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  animation: fadeIn 0.15s ease;
}
.modal {
  background: var(--paper);
  border: 2px solid var(--ink);
  border-radius: var(--radius-lg);
  box-shadow: 8px 8px 0 var(--ink);
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1.5px solid var(--border);
}
.modal-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.2rem;
}
.modal-close {
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
  cursor: pointer;
  font-size: 18px;
  color: var(--ink-3);
  transition: all 0.1s;
}
.modal-close:hover { border-color: var(--ink); color: var(--ink); }
.modal-body { padding: 1.5rem; }
.modal-footer { padding: 1rem 1.5rem; border-top: 1px solid var(--border); display: flex; gap: 8px; justify-content: flex-end; }

/* ── Forms ── */
.form-stack { display: flex; flex-direction: column; gap: 1rem; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-hint { font-size: 12px; color: var(--ink-4); margin-top: 3px; }

/* ── Tables ── */
.table-wrap { overflow-x: auto; border: 1.5px solid var(--border); border-radius: var(--radius-lg); }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th {
  background: var(--ink);
  color: #fff;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 10px 16px;
  text-align: left;
}
td { padding: 12px 16px; border-bottom: 1px solid var(--border); }
tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--paper-2); }

/* ── Stats Cards ── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 2rem;
}
.stat-card {
  background: #fff;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
}
.stat-label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; color: var(--ink-4); margin-bottom: 6px; font-family: var(--font-display); }
.stat-value { font-family: var(--font-display); font-weight: 800; font-size: 2rem; color: var(--ink); }

/* ── Auth pages ── */
.auth-wrap {
  min-height: calc(100vh - 120px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem 1rem;
}
.auth-card {
  background: #fff;
  border: 2px solid var(--ink);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  width: 100%;
  max-width: 440px;
  box-shadow: var(--shadow);
}
.auth-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.75rem;
  letter-spacing: -0.5px;
  margin-bottom: 0.25rem;
}
.auth-sub { font-size: 14px; color: var(--ink-3); margin-bottom: 2rem; }

/* ── Confirmation card ── */
.confirm-card {
  background: var(--green-light);
  border: 2px solid var(--green);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}
.confirm-code {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 2rem;
  letter-spacing: 2px;
  color: var(--green);
}
.confirm-label { font-size: 11px; text-transform: uppercase; letter-spacing: 1px; font-weight: 600; color: var(--green); margin-bottom: 6px; }

.payment-card {
  background: var(--amber-light);
  border: 2px solid var(--amber);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  margin-top: 1rem;
}
.payment-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 14px;
  color: var(--amber);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ── Pickup builder ── */
.pickup-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 10px; }
.pickup-item {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 8px;
  align-items: end;
  background: var(--paper-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px;
}
.pickup-num {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 11px;
  color: var(--accent);
  text-transform: uppercase;
}
.pickup-remove {
  width: 28px; height: 28px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
  cursor: pointer;
  font-size: 14px;
  color: var(--ink-3);
  display: flex; align-items: center; justify-content: center;
}
.pickup-remove:hover { background: #fee2e2; border-color: #991b1b; color: #991b1b; }

/* ── Empty state ── */
.empty-state {
  text-align: center;
  padding: 4rem 2rem;
  color: var(--ink-4);
}
.empty-icon { font-size: 3rem; margin-bottom: 1rem; opacity: 0.4; }
.empty-title { font-family: var(--font-display); font-weight: 700; font-size: 1.1rem; color: var(--ink-2); margin-bottom: 0.5rem; }
.empty-text { font-size: 14px; }

/* ── Loading ── */
.loader {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 3rem;
  color: var(--ink-3);
  font-size: 14px;
}
.spin {
  width: 20px; height: 20px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Toast ── */
.toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--ink);
  color: #fff;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 14px;
  padding: 12px 24px;
  border-radius: var(--radius);
  border: 1.5px solid rgba(255,255,255,0.15);
  z-index: 9999;
  transition: transform 0.25s ease, opacity 0.25s;
  opacity: 0;
  white-space: nowrap;
}
.toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}
.toast.success { background: var(--green); }
.toast.error { background: #991b1b; }

/* ── Driver Hub ── */
.tabs {
  display: flex;
  border-bottom: 2px solid var(--border);
  margin-bottom: 2rem;
  gap: 0;
}
.tab-btn {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 13px;
  padding: 10px 20px;
  border: none;
  background: transparent;
  cursor: pointer;
  color: var(--ink-4);
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  transition: all 0.15s;
}
.tab-btn:hover { color: var(--ink); }
.tab-btn.active { color: var(--ink); border-bottom-color: var(--accent); }

/* ── Footer ── */
.footer {
  background: var(--ink);
  color: rgba(255,255,255,0.4);
  font-size: 13px;
  border-top: 2px solid var(--accent);
}
.footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.brand-sm { color: rgba(255,255,255,0.7); font-family: var(--font-display); font-weight: 700; }

/* ── Trip detail page ── */
.trip-detail-header {
  background: var(--ink);
  color: #fff;
  padding: 2.5rem 0;
}
.detail-event {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(2rem, 4vw, 3.5rem);
  line-height: 1.1;
  letter-spacing: -1px;
  margin-bottom: 0.5rem;
}
.detail-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
  margin-top: 1rem;
}
.detail-meta-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  color: rgba(255,255,255,0.7);
}
.detail-meta-item strong { color: #fff; }

.detail-grid {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 2rem;
  align-items: start;
  padding: 2rem 0;
}

.booking-box {
  position: sticky;
  top: 80px;
  background: #fff;
  border: 2px solid var(--ink);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.booking-box-header {
  background: var(--ink);
  color: #fff;
  padding: 1rem 1.5rem;
}
.booking-box-price {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 2rem;
}
.booking-box-sub { font-size: 13px; color: rgba(255,255,255,0.6); }
.booking-box-body { padding: 1.25rem; }

.pickup-option {
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  margin-bottom: 8px;
  cursor: pointer;
  transition: all 0.1s;
}
.pickup-option:hover { border-color: var(--ink-3); }
.pickup-option.selected { border-color: var(--accent); background: var(--accent-light); }
.pickup-option label { cursor: pointer; }
.pickup-time { font-family: var(--font-display); font-weight: 700; font-size: 15px; }
.pickup-name { font-size: 13px; color: var(--ink-3); }

/* ── Responsive ── */
@media (max-width: 768px) {
  .search-grid, .search-grid-2 { grid-template-columns: 1fr 1fr; }
  .detail-grid { grid-template-columns: 1fr; }
  .booking-box { position: static; }
  .form-row { grid-template-columns: 1fr; }
  .trips-grid { grid-template-columns: 1fr; }
  .topnav { gap: 1rem; padding: 0 1rem; }
  .nav-links .nav-link { padding: 0 0.6rem; }
  .hero { padding: 3rem 1rem 2.5rem; }
  .pickup-item { grid-template-columns: 1fr auto; }
}
