/**
 * Rider trip history - compact sheet-panel cards
 */

.trip-history-page {
  max-width: 32rem;
  margin: 0 auto;
}

.trip-history-page.page-shell {
  padding-top: calc(var(--space-3) + var(--safe-top));
  padding-bottom: calc(var(--space-4) + var(--safe-bottom));
}

.trip-history-page .trip-history-header {
  margin-bottom: var(--space-3);
}

.trip-history-page .sheet-step-badge {
  margin-bottom: var(--space-1);
}

.trip-history-page .trip-history-title {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--ddg-page-heading, var(--ddg-sage-dark));
  margin: 0 0 var(--space-1);
}

.trip-history-page .trip-history-lead {
  margin: 0;
  font-size: var(--text-xs);
  color: var(--uber-text-muted);
  line-height: 1.4;
}

.trip-history-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.trip-history-page .trip-record.sheet-panel {
  margin-bottom: 0;
  padding: var(--space-2) var(--space-3);
}

html[data-theme='light'] .trip-history-page .trip-record.sheet-panel {
  background: #ffffff;
  border: 1px solid rgba(10, 10, 10, 0.14);
  box-shadow: var(--shadow-md);
}

html[data-theme='light'] .trip-history-page .trip-record__fare {
  color: var(--ddg-accent-gold-light);
}

html[data-theme='light'] .trip-history-page .trip-record__route {
  background: #f3f5f7;
  border-color: rgba(10, 10, 10, 0.14);
}

html[data-theme='light'] .trip-history-page .trip-record__meta {
  color: var(--ddg-text-muted);
}

html[data-theme='light'] .trip-history-page .trip-record__trail-step.is-current {
  color: var(--ddg-accent-gold-light);
}

html[data-theme='light'] .trip-history-page .trip-record__trail {
  border-top-color: rgba(10, 10, 10, 0.12);
}

.trip-history-page .trip-record.sheet-panel--route,
.trip-history-page .trip-record.trip-record--trip {
  border-color: rgba(var(--ddg-edge-rgb), 0.45);
  box-shadow:
    0 0 16px rgba(var(--ddg-edge-rgb), 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.trip-history-page .trip-record--declined,
.trip-history-page .trip-record--cancelled {
  border-color: rgba(199, 62, 58, 0.35);
}

/* Header: status + date + fare in one row */
.trip-record__head {
  align-items: center;
  margin-bottom: var(--space-2);
  gap: var(--space-2);
}

.trip-record__head .sheet-panel__badge {
  width: 32px;
  height: 32px;
  font-size: 0.8125rem;
}

.trip-record__head-main {
  flex: 1;
  min-width: 0;
}

.trip-record__head .sheet-panel__heading {
  font-size: var(--text-sm);
  margin: 0;
  line-height: 1.25;
}

.trip-record__head .sheet-panel__sub {
  font-size: 0.6875rem;
  margin: 2px 0 0;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.trip-record__fare {
  flex-shrink: 0;
  font-family: var(--font-display);
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--ddg-accent-gold-light);
  line-height: 1;
}

/* Route: two tight lines */
.trip-record__route {
  margin-bottom: var(--space-2);
  padding: var(--space-2);
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.trip-record__line {
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
  margin: 0;
  font-size: 0.75rem;
  line-height: 1.35;
  color: var(--ddg-text-on-dark);
}

.trip-record__line + .trip-record__line {
  margin-top: var(--space-1);
  padding-top: var(--space-1);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.trip-record__line i {
  flex-shrink: 0;
  width: 0.75rem;
  margin-top: 2px;
  font-size: 0.5625rem;
  text-align: center;
}

.trip-record__line:first-child i {
  color: var(--ddg-success);
}

.trip-record__line:last-child i {
  color: var(--ddg-accent-gold-light);
}

.trip-record__line span {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
}

/* Meta chips (single lines) */
.trip-record__meta {
  margin: 0 0 var(--space-1);
  font-size: 0.6875rem;
  line-height: 1.4;
  color: var(--ddg-text-muted-on-dark);
  word-break: break-word;
}

.trip-record__meta--driver {
  margin-bottom: var(--space-2);
}

.trip-record__meta--driver i {
  margin-right: 2px;
  font-size: 0.625rem;
  color: var(--ddg-success);
}

/* Horizontal timeline trail */
.trip-record__trail {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.15rem 0.25rem;
  padding-top: var(--space-2);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 0.625rem;
  line-height: 1.35;
}

.trip-record__trail-step {
  color: rgba(168, 176, 188, 0.65);
}

.trip-record__trail-step.is-done {
  color: var(--ddg-text-muted-on-dark);
}

.trip-record__trail-step.is-current {
  color: var(--ddg-accent-gold-light);
  font-weight: 600;
}

.trip-record__trail-step.is-terminal {
  color: #f0a8a5;
  font-weight: 600;
}

.trip-record__trail-sep {
  color: rgba(255, 255, 255, 0.2);
  user-select: none;
}

.trip-history-empty {
  padding: var(--space-4);
  text-align: center;
  border-radius: var(--radius-lg);
  background: var(--uber-surface);
  border: 1px dashed var(--ddg-border);
  color: var(--uber-text-muted);
  font-size: var(--text-sm);
}

.trip-history-empty i {
  display: block;
  margin-bottom: var(--space-2);
  font-size: 1.5rem;
  color: var(--ddg-sage);
}
