/* Lotus Bus — Driver Interface CSS (Simple, clear, natural colors, responsive across all screens) */

body {
  padding-bottom: 32px;
}

.drv-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: 14px;
  align-items: start;
}

.drv-grid > * {
  min-width: 0;
}

.topbar-actions {
  gap: 8px;
}

.drv-sel {
  width: auto;
  min-width: 170px;
  padding: 5px 10px;
  font-weight: 700;
}

.drv-trip-head {
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}

.trip-sel {
  width: auto;
  min-width: 180px;
  max-width: 100%;
  flex: 0 1 280px;
  padding: 6px 10px;
  font-size: 13px;
  font-weight: 700;
}

.drv-map {
  height: 340px;
  margin: 0;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 3px 10px;
  font-size: 12px;
  font-weight: 700;
  color: var(--ink-soft);
  max-width: 100%;
}

.status-pill .pulse {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--mute);
  flex-shrink: 0;
}

.status-pill[data-state="on"] .pulse {
  background: var(--ok);
}

.status-pill[data-state="live"] {
  background: var(--ok-bg);
  color: var(--ok);
  border-color: #b8e2cc;
}

.status-pill[data-state="live"] .pulse {
  background: var(--ok);
}

.status-pill[data-state="paused"] {
  background: var(--warn-bg);
  color: var(--warn);
  border-color: #f3d58a;
}

.status-pill[data-state="paused"] .pulse {
  background: var(--warn);
}

/* Status Chain */
.chain {
  list-style: none;
  padding: 0;
  margin: 12px 0;
  display: flex;
  gap: 6px;
}

.chain li {
  flex: 1;
  text-align: center;
  padding: 7px 6px;
  border-radius: 8px;
  background: var(--bg);
  border: 1px solid var(--line);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--mute);
}

.chain li.done {
  background: var(--ok-bg);
  color: var(--ok);
  border-color: #b8e2cc;
}

.chain li.cur {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
  font-weight: 800;
}

/* Primary Action Button */
.go-btn {
  min-height: 54px;
  border-radius: 10px;
  font-size: 18px;
  font-weight: 800;
}

.go-btn.ok {
  background: var(--brand);
}

.go-btn.bad {
  background: var(--bad);
}

.hint {
  margin: 8px 0 12px;
  font-size: 13px;
  text-align: center;
}

/* Next Up Request Card (nearest waiting request, big ETA) */
.next-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 14px;
}

.next-card.hot {
  background: var(--brand-soft);
  border-color: var(--brand);
}

.next-card > div:first-child {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  min-width: 0;
}

.next-name {
  font-size: 16.5px;
  font-weight: 800;
  color: var(--ink);
  overflow-wrap: anywhere;
}

.eta-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 14px;
  min-width: 92px;
  flex-shrink: 0;
}

.eta-num {
  font-size: clamp(26px, 5vw, 34px);
  font-weight: 800;
  color: var(--brand);
  line-height: 1.1;
}

/* Ready Requests List */
.req-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.req-empty {
  margin: 0;
  text-align: center;
  padding: 10px 0;
}

.req-row {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-right: 4px solid var(--info);
  border-radius: 10px;
  background: var(--card);
}

.req-row.accepted {
  border-right-color: var(--ok);
}

.req-row.boarding {
  border-right-color: var(--warn);
  background: var(--warn-bg);
}

.req-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.req-info strong {
  font-size: 15px;
  color: var(--ink);
}

.req-state {
  font-size: 15.5px;
  font-weight: 800;
}

.req-state.wait {
  color: var(--info);
}

.req-state.acc {
  color: var(--ok);
}

.req-state.brd {
  color: var(--warn);
}

.req-count {
  font-size: 20px;
  font-weight: 800;
  color: var(--warn);
  font-variant-numeric: tabular-nums;
}

.req-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.req-actions .btn {
  font-size: 15px;
  padding: 10px;
}

/* Map Pins: students (anonymous), route terminals */
.pin.req {
  width: 100%;
  min-width: 0;
  height: 26px;
  border-radius: 13px;
  padding: 0 4px;
  font-size: 11.5px;
  white-space: nowrap;
  background: var(--info);
}

.pin.req.acc {
  background: var(--ok);
}

.pin.req.brd {
  background: var(--warn);
}

.pin.term {
  width: 100%;
  min-width: 0;
  height: 24px;
  border-radius: 12px;
  padding: 0 8px;
  font-size: 11.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  background: var(--ink-soft);
}

.pin.term.start {
  background: var(--brand);
}

/* Inline Chat */
.msg-list {
  height: 210px;
  overflow-y: auto;
  padding: 10px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 10px;
}

.bubble {
  max-width: 84%;
  padding: 8px 12px;
  border-radius: 10px;
  font-size: 14px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.bubble.driver {
  align-self: flex-start;
  background: var(--brand);
  color: #fff;
}

.bubble.student {
  align-self: flex-end;
  background: var(--card);
  color: var(--ink);
  border: 1px solid var(--line-strong);
}

.bubble time {
  display: block;
  font-size: 11px;
  opacity: 0.75;
  margin-top: 2px;
}

.quick-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.qchip {
  appearance: none;
  border: 1px solid var(--line-strong);
  background: var(--bg);
  color: var(--ink);
  border-radius: 6px;
  padding: 6px 10px;
  font: inherit;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
}

.qchip:hover {
  background: var(--bg-subtle);
}

.chat-input {
  display: flex;
  gap: 8px;
}

/* Responsive Breakpoints */
@media (max-width: 860px) {
  .drv-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
  }

  .drv-col {
    display: contents;
  }

  .drv-grid .card {
    margin-bottom: 0;
  }

  .m-order-1 { order: 1; }
  .m-order-2 { order: 2; }
  .m-order-3 { order: 3; }
  .m-order-4 { order: 4; }
}

@media (max-width: 680px) {
  .status-pill {
    margin-inline-start: auto;
    font-size: 11.5px;
    padding: 3px 8px;
  }

  .drv-sel {
    width: 100%;
    flex: 1 1 100%;
  }

  .trip-sel {
    width: 100%;
    flex: 1 1 100%;
    min-width: 0;
  }

  .drv-map {
    height: 260px;
  }
}

@media (max-width: 480px) {
  .chain li {
    font-size: 11.5px;
    padding: 6px 4px;
  }

  .next-card {
    padding: 10px 12px;
  }

  .eta-box {
    min-width: 78px;
    padding: 6px 10px;
  }

  .req-actions {
    grid-template-columns: 1fr;
  }
}
