@import url('https://fonts.googleapis.com/css2?family=Sora:wght@400;600;700&family=IBM+Plex+Sans:wght@400;500;600&display=swap');

:root {
  --bg-deep: #041722;
  --bg-mid: #0e2f43;
  --panel: rgba(250, 253, 255, 0.93);
  --panel-border: rgba(255, 255, 255, 0.35);
  --text-main: #112436;
  --text-soft: #3e556a;
  --brand: #0f766e;
  --brand-strong: #115e59;
  --alert: #c2352a;
  --shadow: 0 20px 45px rgba(1, 16, 26, 0.25);
  --radius-lg: 20px;
  --radius-md: 12px;
  --surface-soft: rgba(255, 255, 255, 0.72);
  --surface-line: rgba(22, 77, 104, 0.16);
}

* {
  box-sizing: border-box;
}

body {
  --dynamic-map-image: none;
  margin: 0;
  font-family: 'IBM Plex Sans', sans-serif;
  color: var(--text-main);
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
  background-image:
    radial-gradient(1200px 500px at 12% -8%, rgba(61, 166, 139, 0.34), transparent 62%),
    radial-gradient(900px 500px at 96% 0%, rgba(252, 176, 69, 0.2), transparent 60%),
    var(--dynamic-map-image),
    linear-gradient(135deg, var(--bg-deep), var(--bg-mid));
  background-size: auto, auto, cover, auto;
  background-position: center, center, center, center;
  background-repeat: no-repeat, no-repeat, no-repeat, no-repeat;
}

header {
  background: linear-gradient(90deg, rgba(2, 14, 22, 0.92), rgba(8, 36, 52, 0.9));
  color: #f8fcff;
  padding: 14px 22px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  z-index: 100;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(7px);
}

header h1,
header h2 {
  font-family: 'Sora', sans-serif;
  margin: 0;
  letter-spacing: 0.2px;
}

header a {
  color: #eaf8ff;
  text-decoration: none;
}

header a:hover {
  text-decoration: underline;
}

a[href="driver.html"] {
  color: #eaf8ff;
}

.brand-title {
  color: #f8fcff;
  margin: 0;
}

main {
  display: flex;
  flex: 1;
  position: relative;
  padding: 0 16px;
  gap: 16px;
  min-height: 0;
  animation: revealMain 0.45s ease-out both;
}

main::before {
  content: "";
  position: absolute;
  inset: 0 14px;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(255, 255, 255, 0.2);
  pointer-events: none;
}

.controls {
  width: min(360px, 100%);
  padding: 22px;
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  z-index: 10;
  overflow-y: auto;
  backdrop-filter: blur(4px);
}

.controls h2,
.controls h3 {
  font-family: 'Sora', sans-serif;
  margin-top: 0;
}

.controls p {
  color: var(--text-soft);
}

#map {
  flex: 1;
  height: 100%;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  border: 1px solid rgba(255, 255, 255, 0.2);
  min-height: 300px;
}

.map-fab-control {
  margin: 0 12px 18px 0;
  min-width: 112px;
  border: none;
  border-radius: 999px;
  padding: 10px 14px;
  background: #111827;
  color: #f9fafb;
  font-family: 'Sora', sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.2px;
  cursor: pointer;
  box-shadow: 0 10px 18px rgba(17, 24, 39, 0.34);
}

.map-fab-control:hover {
  background: #030712;
}

.route-action-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.review-route-btn {
  background: linear-gradient(135deg, #111827, #1f2937) !important;
  box-shadow: 0 10px 18px rgba(17, 24, 39, 0.3) !important;
}

#map.map-review-active {
  outline: 3px solid rgba(96, 165, 250, 0.85);
  outline-offset: -3px;
}

.ride-panel {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 16px;
  background: linear-gradient(90deg,
      rgba(250, 253, 255, 0.93) 0%,
      rgba(250, 253, 255, 0.93) 50%,
      rgba(250, 253, 255, 0.62) 50%,
      rgba(250, 253, 255, 0.62) 100%);
  border: 1px solid var(--panel-border);
  max-height: 70%;
  overflow-y: auto;
  box-shadow: var(--shadow);
  z-index: 20;
  border-radius: var(--radius-lg);
  padding: 0;
  animation: slideUp 0.35s ease-out;
  backdrop-filter: blur(4px);
  box-shadow: 0 28px 48px rgba(1, 16, 26, 0.32);
}


.ride-section {
  padding: 20px;
  display: grid;
  gap: 10px;
}

.ride-section h2 {
  font-family: 'Sora', sans-serif;
  margin-top: 0;
  margin-bottom: 8px;
  font-size: 1.12rem;
  font-weight: 700;
  color: #0b2535;
  letter-spacing: 0.2px;
}

.ride-section p {
  margin: 0;
}

button {
  width: 100%;
  padding: 12px 14px;
  background: linear-gradient(135deg, var(--brand), #148f86);
  color: #fff;
  border: none;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-family: 'Sora', sans-serif;
  cursor: pointer;
  margin-bottom: 0;
  transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
  box-shadow: 0 10px 18px rgba(15, 118, 110, 0.28);
}

button:hover {
  transform: translateY(-2px);
  filter: saturate(1.08);
}

button:active {
  transform: translateY(0);
}

.location-btn {
  background: linear-gradient(135deg, #1363df, #104ac5) !important;
  width: auto !important;
  padding: 10px 14px !important;
  margin-left: 8px;
  font-size: 0.9rem;
  box-shadow: 0 8px 16px rgba(19, 99, 223, 0.3);
}

.ride-section input[type="text"],
.ride-section input[type="datetime-local"],
.ride-section select,
#username,
#password {
  width: 100% !important;
  padding: 12px 13px !important;
  border: 1px solid #b7ceda !important;
  border-radius: 11px !important;
  font-size: 0.95rem !important;
  margin-bottom: 10px !important;
  background: rgba(248, 252, 255, 0.95);
  color: var(--text-main);
  outline: none;
}

.ride-section input::placeholder {
  color: #5a7287;
}

.ride-section input[type="text"]:focus,
.ride-section input[type="datetime-local"]:focus,
.ride-section select:focus,
#username:focus,
#password:focus {
  border-color: #2e8b82 !important;
  box-shadow: 0 0 0 3px rgba(46, 139, 130, 0.2);
}

.ride-section label {
  display: block;
  font-weight: 600;
  margin-bottom: 5px;
  color: #25445b;
}

.time-display,
#price,
#paymentNotice,
#globalStatsRider,
#globalStatsDriver,
#acceptedRidesSection,
#rideDetails {
  border-radius: var(--radius-md);
}

.time-display {
  padding: 12px 13px;
  background: #edf8f7;
  border: 1px solid #c9e6e2;
  font-size: 0.93rem;
  color: #15465a;
  margin-bottom: 10px;
}

#price {
  margin: 2px 0 0;
  padding: 10px 12px;
  background: var(--surface-soft);
  border: 1px solid var(--surface-line);
  color: #d4af37;
  font-weight: 800;
}

#price strong {
  color: inherit;
  font-weight: inherit;
}

.ride-options-card {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid #c8dce6;
  border-radius: var(--radius-md);
  padding: 12px;
  margin-top: 2px;
  margin-bottom: 0;
}

.ride-option-item {
  display: block;
  padding: 10px;
  border: 1px solid #d8e7ef;
  border-radius: 10px;
  margin-bottom: 10px;
  background: #f7fbfe;
}

.ride-option-item input[type="radio"] {
  margin-right: 8px;
}

#paymentNotice,
#globalStatsRider,
#globalStatsDriver {
  background: rgba(255, 255, 255, 0.86) !important;
  border: 1px solid #ccdfe9 !important;
  padding: 10px 12px !important;
}

#paymentNotice {
  font-size: 0.9rem;
  color: #24465b;
}

#acceptedRidesSection {
  background: rgba(255, 255, 255, 0.82) !important;
  border: 1px solid #d8e7ef !important;
}

#acceptedRidesList {
  color: #1b3a4d;
}

#rideDetails {
  background: #fff8ef !important;
  border: 1px solid #f3ddbf !important;
  border-left: 5px solid #cf7a2d !important;
}

.decline-ride,
button[onclick*="driverResponse('no')"] {
  background: linear-gradient(135deg, #b9382d, var(--alert)) !important;
  box-shadow: 0 10px 18px rgba(194, 53, 42, 0.28) !important;
}

footer {
  background: linear-gradient(90deg, rgba(2, 14, 22, 0.92), rgba(8, 36, 52, 0.9));
  color: rgba(242, 251, 255, 0.75);
  text-align: center;
  padding: 10px;
  font-size: 0.74rem;
  z-index: 100;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

#loading {
  color: #d8edf8 !important;
  font-family: 'Sora', sans-serif;
}

#loginOverlay {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
  backdrop-filter: blur(4px);
}

#loginOverlay>div {
  border-radius: var(--radius-lg) !important;
  border: 1px solid #d4e5ef;
  box-shadow: var(--shadow) !important;
}

#loginBtn {
  background: linear-gradient(135deg, var(--brand), #148f86) !important;
}

.login-card {
  background: #ffffff;
  padding: 30px;
  width: min(320px, 92vw);
  box-shadow: var(--shadow);
}

.login-title {
  margin-top: 0;
}

.login-error {
  color: #b9382d;
  display: none;
  margin-top: 10px;
  font-size: 0.9rem;
}

.driver-main {
  display: none;
}

.stats-rider {
  margin-top: 15px;
  font-size: 0.9em;
  color: #333;
}

.stats-driver {
  margin-bottom: 15px;
  font-size: 0.9em;
  color: #333;
}

.accepted-rides-card {
  margin-bottom: 15px;
  padding: 12px;
}

.accepted-rides-title {
  margin: 0 0 8px 0;
}

.accepted-rides-list {
  margin: 0;
  padding-left: 18px;
  max-height: 180px;
  overflow-y: auto;
}

.ride-details-title {
  margin-top: 0;
}

.accept-btn {
  background: linear-gradient(135deg, #1f8c46, #2aa255) !important;
}

.decline-btn {
  background: linear-gradient(135deg, #b9382d, var(--alert)) !important;
}

.loading-indicator {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 18px;
  color: #666;
}

.is-hidden {
  display: none !important;
}

@keyframes slideUp {
  from {
    transform: translateY(20px);
    opacity: 0;
  }

  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes revealMain {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 960px) {
  body {
    overflow: auto;
  }

  main {
    flex-direction: column;
    padding: 0 10px;
    gap: 10px;
  }

  .controls {
    width: 100%;
    max-height: 48vh;
  }

  #map {
    min-height: 42vh;
  }

  .ride-panel {
    position: static;
    max-height: none;
    left: auto;
    right: auto;
    bottom: auto;
    margin-top: 10px;
    border-radius: 16px;
  }

  .ride-section {
    padding: 16px;
  }

  .location-btn {
    margin-left: 0;
    width: 100% !important;
  }

  .route-action-row {
    grid-template-columns: 1fr;
  }

  header {
    flex-wrap: wrap;
    justify-content: center;
    text-align: center;
  }
}

/* Rider homepage: original ride-hailing inspired look (scoped to index page). */
body.rider-home {
  background: #090b10;
  color: #f3f4f6;
  overflow: hidden;
}

.rider-home .rider-header {
  position: relative;
  z-index: 30;
  background: linear-gradient(92deg, rgba(8, 8, 10, 0.95), rgba(16, 18, 24, 0.86));
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.rider-home .rider-brand-wrap {
  display: grid;
  gap: 2px;
}

.rider-home .brand-title {
  font-size: 1.3rem;
  letter-spacing: 0.2px;
}

.rider-home .brand-subtitle {
  font-size: 0.72rem;
  color: rgba(255, 255, 255, 0.7);
  text-transform: uppercase;
  letter-spacing: 1.15px;
}

.rider-home .rider-nav {
  display: flex;
  gap: 12px;
  align-items: center;
}

.rider-home .rider-nav a {
  color: #f3f4f6;
  text-decoration: none;
  font-family: 'Sora', sans-serif;
  font-size: 0.9rem;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.16);
}

.rider-home .rider-nav a:hover {
  background: rgba(255, 255, 255, 0.14);
  text-decoration: none;
}

.rider-home .rider-main {
  position: relative;
  height: calc(100vh - 68px);
  padding: 0;
  gap: 0;
}

.rider-home main::before {
  display: none;
}

.rider-home #map {
  position: absolute;
  inset: 0;
  border-radius: 0;
  border: none;
  box-shadow: none;
}

.rider-home .hero-card {
  position: absolute;
  top: 18px;
  left: 18px;
  z-index: 22;
  width: min(520px, calc(100vw - 36px));
  background: linear-gradient(135deg, rgba(11, 13, 19, 0.94), rgba(28, 34, 45, 0.78));
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 22px;
  padding: 20px;
  box-shadow: 0 24px 48px rgba(2, 2, 3, 0.45);
  backdrop-filter: blur(8px);
}

.rider-home .hero-kicker {
  margin: 0 0 8px;
  text-transform: uppercase;
  letter-spacing: 1.4px;
  font-size: 0.72rem;
  color: #b7f5d2;
  font-family: 'Sora', sans-serif;
}

.rider-home .hero-card h1 {
  margin: 0;
  font-family: 'Sora', sans-serif;
  font-size: clamp(1.55rem, 2.2vw, 2.35rem);
  line-height: 1.12;
  color: #f9fafb;
}

.rider-home .hero-copy {
  margin: 10px 0 0;
  max-width: 48ch;
  color: rgba(243, 244, 246, 0.85);
  font-size: 0.95rem;
}

.rider-home .hero-chips {
  margin-top: 14px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.rider-home .hero-chips span {
  display: inline-block;
  font-size: 0.78rem;
  font-family: 'Sora', sans-serif;
  background: rgba(255, 255, 255, 0.11);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  padding: 6px 10px;
}

.rider-home .ride-panel {
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 14px;
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(247, 250, 255, 0.92));
  box-shadow: 0 28px 56px rgba(1, 4, 10, 0.36);
  max-height: min(42vh, 420px);
}

.rider-home .ride-section {
  padding: 14px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 12px;
}

.rider-home .ride-section h2,
.rider-home .ride-section p,
.rider-home .ride-section label,
.rider-home #estimatedDropoff,
.rider-home #price,
.rider-home #paymentNotice,
.rider-home #rideOptions,
.rider-home #globalStatsRider,
.rider-home #seatAvailabilityNote {
  grid-column: 1 / -1;
}

.rider-home .ride-section h2 {
  font-size: 1.18rem;
  margin-bottom: 2px;
}

.rider-home .ride-section p {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.rider-home .location-btn {
  width: auto !important;
  margin: 0 !important;
}

.rider-home .ride-section input[type="text"],
.rider-home .ride-section input[type="datetime-local"],
.rider-home .ride-section select {
  margin-bottom: 0 !important;
}

.rider-home .ride-section button {
  margin-bottom: 0;
}

.rider-home .rider-footer {
  display: none;
}

@media (max-width: 960px) {
  .rider-home .rider-main {
    height: calc(100vh - 90px);
  }

  .rider-home .hero-card {
    position: absolute;
    top: 10px;
    left: 10px;
    right: 10px;
    width: auto;
    padding: 14px;
  }

  .rider-home .hero-card h1 {
    font-size: 1.35rem;
  }

  .rider-home .ride-panel {
    left: 10px;
    right: 10px;
    bottom: 10px;
    max-height: 46vh;
  }

  .rider-home .ride-section {
    grid-template-columns: 1fr;
    padding: 14px;
  }

  .rider-home .ride-section p {
    display: grid;
    gap: 8px;
  }

  .rider-home .location-btn {
    width: 100% !important;
  }

  .rider-home .rider-nav {
    width: 100%;
    justify-content: center;
  }
}