/* app.css — TukTuk Drive app-specific styles. Landing styles live in theme.css. */

/* ---- LAYOUT ---- */
.app-body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ---- NAV ---- */
.app-nav {
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  background: var(--bg-elevated);
  border-bottom: 1px solid rgba(255,255,255,0.06);
  flex-shrink: 0;
  z-index: 100;
}

.nav-brand {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.2rem;
  color: var(--fg);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 2px;
}

.nav-brand span {
  color: var(--accent);
}

.nav-tag {
  background: rgba(245,166,35,0.15);
  color: var(--accent);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 2px 8px;
  border-radius: 100px;
  margin-left: 8px;
  font-family: var(--font-body);
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.nav-user {
  font-size: 14px;
  color: var(--fg-muted);
}

/* ---- APP LAYOUT ---- */
.app-layout {
  flex: 1;
  display: flex;
  min-height: 0;
}

/* ---- BOOKING PANEL ---- */
.booking-panel {
  width: 380px;
  flex-shrink: 0;
  background: var(--bg-elevated);
  border-right: 1px solid rgba(255,255,255,0.06);
  overflow-y: auto;
}

.panel-inner {
  padding: 24px 20px;
}

/* ---- MAP ---- */
.map-container {
  flex: 1;
  position: relative;
  min-height: 400px;
}

#map {
  position: absolute;
  inset: 0;
  background: #111;
}

/* ---- MODAL ---- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}

.modal {
  background: var(--bg-card);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--radius);
  padding: 32px 28px;
  width: 100%;
  max-width: 400px;
}

.modal-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 24px;
  background: var(--bg-elevated);
  border-radius: 10px;
  padding: 4px;
}

.tab-btn {
  flex: 1;
  padding: 8px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--fg-muted);
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.tab-btn.active {
  background: var(--bg-card);
  color: var(--fg);
}

/* ---- FORM FIELDS ---- */
.field-group {
  margin-bottom: 16px;
}

.field-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--fg-muted);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.field-group .optional {
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
}

.field-group input {
  width: 100%;
  background: var(--bg-elevated);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 10px;
  padding: 12px 14px;
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 15px;
  outline: none;
  transition: border-color 0.2s;
}

.field-group input:focus {
  border-color: rgba(245,166,35,0.4);
}

.field-group input::placeholder {
  color: var(--fg-muted);
  opacity: 0.6;
}

/* ---- BUTTONS ---- */
.btn-primary {
  background: var(--accent);
  color: #0a0a0a;
  border: none;
  border-radius: 12px;
  padding: 14px 24px;
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
}

.btn-primary:hover { background: var(--accent-warm); }
.btn-primary:active { transform: scale(0.98); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-ghost {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 12px;
  padding: 12px 20px;
  color: var(--fg-muted);
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
}

.btn-ghost:hover { border-color: rgba(255,255,255,0.25); color: var(--fg); }

.btn-full { width: 100%; }

.btn-danger {
  background: #e53e3e;
  color: #fff;
}

/* ---- AUTH ---- */
.auth-error {
  color: #fc8181;
  font-size: 13px;
  margin-bottom: 12px;
  min-height: 18px;
}

.auth-switch {
  text-align: center;
  margin-top: 16px;
  font-size: 13px;
  color: var(--fg-muted);
}

.auth-switch a {
  color: var(--accent);
  text-decoration: none;
}

/* ---- LOCATION INPUTS ---- */
.location-inputs {
  position: relative;
  margin-bottom: 20px;
}

.location-field {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-card);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  padding: 12px 14px;
  position: relative;
}

.location-connector {
  width: 2px;
  height: 16px;
  background: rgba(255,255,255,0.1);
  margin: 4px 0 4px 18px;
}

.loc-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.loc-dot-green { background: var(--green); }
.loc-dot-accent { background: var(--accent); }

.location-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 15px;
}

.location-input::placeholder { color: var(--fg-muted); opacity: 0.7; }
.location-input[readonly] { cursor: default; }

.loc-gps-btn {
  background: transparent;
  border: none;
  color: var(--accent);
  cursor: pointer;
  padding: 2px;
  display: flex;
  align-items: center;
  opacity: 0.8;
  transition: opacity 0.2s;
}

.loc-gps-btn:hover { opacity: 1; }

/* ---- FARE PREVIEW ---- */
.fare-preview {
  background: var(--bg-card);
  border: 1px solid rgba(245,166,35,0.2);
  border-radius: 12px;
  padding: 16px 18px;
  margin-bottom: 16px;
}

.fare-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.fare-label {
  font-size: 13px;
  color: var(--fg-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
}

.fare-amount {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--accent);
}

.fare-meta {
  display: flex;
  gap: 12px;
  margin-top: 6px;
  font-size: 12px;
  color: var(--fg-muted);
}

/* ---- STEP HEADINGS ---- */
.step-heading {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 800;
  margin-bottom: 8px;
}

.step-sub {
  color: var(--fg-muted);
  font-size: 14px;
  margin-bottom: 16px;
}

/* ---- FINDING ANIMATION ---- */
.finding-animation {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px 0;
}

.tuk-icon {
  font-size: 3.5rem;
  animation: tuk-bob 1s ease-in-out infinite;
}

@keyframes tuk-bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

.finding-dots {
  display: flex;
  gap: 6px;
}

.finding-dots span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  animation: dot-pulse 1.2s ease-in-out infinite;
}

.finding-dots span:nth-child(2) { animation-delay: 0.2s; }
.finding-dots span:nth-child(3) { animation-delay: 0.4s; }

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

/* ---- FARE CHIP ---- */
.fare-chip {
  background: rgba(245,166,35,0.1);
  border: 1px solid rgba(245,166,35,0.2);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 14px;
  color: var(--fg);
  margin: 12px 0;
}

/* ---- DRIVER CARD ---- */
.driver-card {
  background: var(--bg-card);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  padding: 16px;
  display: flex;
  gap: 14px;
  align-items: center;
  margin-bottom: 16px;
}

.driver-avatar {
  font-size: 2rem;
  width: 48px;
  height: 48px;
  background: var(--bg-elevated);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.driver-name {
  font-weight: 700;
  font-size: 1rem;
  margin-bottom: 4px;
}

.driver-vehicle {
  font-size: 13px;
  color: var(--fg-muted);
}

.driver-rating {
  font-size: 13px;
  color: var(--accent);
  margin-top: 2px;
}

/* ---- STATUS PILL ---- */
.ride-status-pill {
  display: inline-block;
  background: rgba(46, 204, 113, 0.15);
  color: var(--green);
  border: 1px solid rgba(46, 204, 113, 0.25);
  border-radius: 100px;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 12px;
}

.ride-status-pill.waiting {
  background: rgba(245,166,35,0.1);
  color: var(--accent);
  border-color: rgba(245,166,35,0.2);
}

/* ---- COMPLETED ---- */
.completed-icon {
  font-size: 3rem;
  margin-bottom: 16px;
}

.rating-section {
  margin-top: 20px;
}

.rating-prompt {
  font-size: 14px;
  color: var(--fg-muted);
  margin-bottom: 10px;
}

.star-row {
  display: flex;
  gap: 8px;
}

.star {
  background: transparent;
  border: none;
  font-size: 2rem;
  color: rgba(255,255,255,0.2);
  cursor: pointer;
  padding: 0;
  transition: color 0.15s, transform 0.1s;
}

.star.lit { color: var(--accent); }
.star:hover { transform: scale(1.1); }

/* ---- DRIVER SPECIFIC ---- */
.offline-card {
  background: var(--bg-card);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 12px;
  padding: 24px 20px;
  margin-bottom: 20px;
}

.earnings-card {
  background: var(--bg-card);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 12px;
  padding: 20px;
}

.earnings-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}

.earnings-row:last-child { border-bottom: none; }

.earnings-label { font-size: 13px; color: var(--fg-muted); }
.earnings-value { font-weight: 700; }
.earnings-value.accent { color: var(--accent); }

.online-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(46,204,113,0.1);
  border: 1px solid rgba(46,204,113,0.2);
  border-radius: 100px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  color: var(--green);
  margin-bottom: 20px;
}

.dot-green {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  animation: pulse 2s ease infinite;
}

/* ---- PENDING RIDE REQUEST CARD ---- */
.ride-request-card {
  background: var(--bg-card);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 12px;
}

.rrc-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.rrc-fare {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--accent);
}

.rrc-dist {
  font-size: 12px;
  color: var(--fg-muted);
  background: var(--bg-elevated);
  padding: 3px 8px;
  border-radius: 6px;
}

.rrc-route { margin-bottom: 12px; }

.rrc-point {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--fg-muted);
  margin-bottom: 4px;
}

.rrc-point strong { color: var(--fg); }

/* ---- ACTIVE RIDE (DRIVER) ---- */
.active-ride-card {
  background: var(--bg-card);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  padding: 20px;
}

.active-ride-header {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 16px;
}

.tuk-icon-small { font-size: 1.8rem; }

.active-ride-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--fg-muted);
  font-weight: 600;
}

.active-ride-rider {
  font-weight: 700;
  font-size: 1.05rem;
  margin-top: 2px;
}

.route-display { margin-bottom: 14px; }

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

.route-line {
  width: 2px;
  height: 16px;
  background: rgba(255,255,255,0.1);
  margin-left: 4px;
}

.action-btns {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 16px;
}

/* ---- RESPONSIVE ---- */
@media (max-width: 768px) {
  .booking-panel {
    width: 100%;
    max-height: 45vh;
    border-right: none;
    border-bottom: 1px solid rgba(255,255,255,0.06);
  }

  .app-layout {
    flex-direction: column;
  }

  .map-container {
    min-height: 300px;
  }
}

/* ---- LEAFLET OVERRIDES ---- */
.leaflet-container {
  background: #1a1a1a;
  font-family: var(--font-body);
}

.leaflet-tile-pane { filter: grayscale(0.3) brightness(0.85); }
