/* ==========================================================================
   Trip Detail — SoneyaDrive  (Guinea green / gold — cohérent avec create-trip.css)
   ========================================================================== */

/* ── Page shell ──────────────────────────────────────────────────────────── */
.trip-detail-page {
  background: var(--gn-light, #F6FBF8);
  min-height: 100vh;
  padding: 0 0 80px;
}

/* ── Hero ────────────────────────────────────────────────────────────────── */
.td-hero {
  background: linear-gradient(135deg, var(--gn-dark, #0D2E1A) 0%, #1a4a2e 55%, var(--gn-green, #1A8F5C) 100%);
  padding: 52px 0 56px;
  color: #fff;
  position: relative;
  overflow: hidden;
}
.td-hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 80% 50%, rgba(245,166,35,.12), transparent 60%);
  pointer-events: none;
}
.td-hero .container { position: relative; z-index: 1; }

.td-hero-back {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: rgba(255,255,255,.75);
  text-decoration: none;
  font-size: .875rem;
  font-weight: 500;
  margin-bottom: 18px;
  transition: color .2s;
}
.td-hero-back:hover { color: #fff; }

.td-hero-grid {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 32px;
  align-items: start;
}

/* Route title */
.td-route-title {
  font-size: clamp(1.5rem, 3.5vw, 2.2rem);
  font-weight: 800;
  line-height: 1.2;
  margin: 0 0 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}
.td-route-title .td-arrow {
  color: var(--gn-gold, #F5A623);
  font-size: .8em;
}

.td-route-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 24px;
}
.td-route-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 16px;
  border-radius: 999px;
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.18);
  font-size: .88rem;
  font-weight: 600;
}
.td-route-pill i { color: var(--gn-gold, #F5A623); }

.td-meta-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.td-meta-chip {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 10px 16px;
  background: rgba(255,255,255,.1);
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.15);
  min-width: 110px;
}
.td-meta-chip .td-meta-label {
  font-size: .72rem;
  color: rgba(255,255,255,.65);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
  margin-bottom: 3px;
}
.td-meta-chip .td-meta-val {
  font-size: .97rem;
  font-weight: 700;
  color: #fff;
}

/* Hero price card */
.td-price-card {
  background: #fff;
  border-radius: 18px;
  padding: 24px 28px;
  box-shadow: 0 16px 48px rgba(0,0,0,.22);
  min-width: 220px;
  display: grid;
  gap: 14px;
  align-self: start;
}
.td-price-label { font-size: .75rem; color: rgba(13,46,26,.5); font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.td-price-amount {
  font-size: 2rem;
  font-weight: 800;
  color: var(--gn-green, #1A8F5C);
  line-height: 1;
}
.td-price-amount span { font-size: .95rem; font-weight: 600; color: rgba(13,46,26,.6); margin-left: 4px; }
.td-price-sub { font-size: .8rem; color: rgba(13,46,26,.5); margin-top: -6px; }
.td-price-card .btn { width: 100%; justify-content: center; }

/* Status badge */
.td-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: .78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
}
.td-status-badge.active   { background: rgba(26,143,92,.15); color: #065f46; }
.td-status-badge.inactive { background: rgba(229,62,62,.1);  color: #991b1b; }
.td-status-badge.full     { background: rgba(245,166,35,.15); color: #7c4a00; }

/* ── Body layout ─────────────────────────────────────────────────────────── */
.td-body {
  max-width: 1060px;
  margin: -28px auto 0;
  padding: 0 20px;
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 24px;
  align-items: start;
  position: relative;
  z-index: 2;
}

/* ── Cards ───────────────────────────────────────────────────────────────── */
.td-main { display: grid; gap: 16px; }

.td-card {
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 4px 20px rgba(13,46,26,.06);
  overflow: hidden;
}
.td-card-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 28px 0;
}
.td-card-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--gn-green, #1A8F5C), #136B44);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: .95rem;
  flex-shrink: 0;
}
.td-card-icon.gold { background: linear-gradient(135deg, var(--gn-gold, #F5A623), #D4891A); }
.td-card-icon.red  { background: linear-gradient(135deg, #e53e3e, #c53030); }

.td-card-head h2 { margin: 0; font-size: 1.05rem; font-weight: 700; color: var(--gn-dark, #0D2E1A); }
.td-card-head p  { margin: 2px 0 0; font-size: .78rem; color: rgba(13,46,26,.5); }

.td-card-body { padding: 20px 28px 24px; }

/* ── Timeline ────────────────────────────────────────────────────────────── */
.td-timeline {
  position: relative;
  display: grid;
  gap: 0;
}
.td-timeline-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 14px 0;
  position: relative;
}
.td-timeline-item:not(:last-child) {
  border-bottom: 1px dashed rgba(13,46,26,.08);
}
.td-tl-dot {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .9rem;
  flex-shrink: 0;
  margin-top: 2px;
}
.td-tl-dot.green { background: rgba(26,143,92,.12); color: var(--gn-green, #1A8F5C); }
.td-tl-dot.red   { background: rgba(206,17,38,.1);  color: var(--gn-red,   #CE1126); }
.td-tl-dot.gold  { background: rgba(245,166,35,.15); color: var(--gn-gold,  #F5A623); }

.td-tl-label { font-size: .75rem; font-weight: 700; color: rgba(13,46,26,.5); text-transform: uppercase; letter-spacing: .05em; margin-bottom: 3px; }
.td-tl-value { font-size: .95rem; font-weight: 600; color: var(--gn-dark, #0D2E1A); }

/* ── Info grid ───────────────────────────────────────────────────────────── */
.td-info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
}
.td-info-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--gn-light, #F6FBF8);
  border-radius: 12px;
  border: 1px solid rgba(13,46,26,.06);
}
.td-info-item i { color: var(--gn-green, #1A8F5C); font-size: 1.1rem; flex-shrink: 0; }
.td-info-item .td-ii-label { font-size: .75rem; color: rgba(13,46,26,.5); margin-bottom: 2px; }
.td-info-item .td-ii-val   { font-size: .92rem; font-weight: 700; color: var(--gn-dark, #0D2E1A); }

/* ── Driver card ─────────────────────────────────────────────────────────── */
.td-driver {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 16px;
  background: var(--gn-light, #F6FBF8);
  border-radius: 14px;
  border: 1px solid rgba(13,46,26,.06);
}
.td-driver-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--gn-green, #1A8F5C), #136B44);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  font-weight: 800;
  color: #fff;
  overflow: hidden;
  flex-shrink: 0;
}
.td-driver-avatar img { width: 100%; height: 100%; object-fit: cover; }
.td-driver-name { font-size: 1rem; font-weight: 700; color: var(--gn-dark, #0D2E1A); margin-bottom: 4px; }
.td-driver-sub  { font-size: .8rem; color: rgba(13,46,26,.55); margin-bottom: 10px; }
.td-driver-badges { display: flex; flex-wrap: wrap; gap: 7px; }
.td-driver-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: .75rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(26,143,92,.1);
  color: var(--gn-green, #1A8F5C);
}
.td-driver-badge.gold { background: rgba(245,166,35,.15); color: #7c4a00; }
.td-driver-rating { font-size: 1.1rem; font-weight: 800; color: var(--gn-gold, #F5A623); }
.td-driver-rating i { font-size: .9rem; }

/* ── Option chips ────────────────────────────────────────────────────────── */
.td-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.td-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--gn-light, #F6FBF8);
  border: 1.5px solid rgba(13,46,26,.1);
  font-size: .82rem;
  font-weight: 600;
  color: rgba(13,46,26,.7);
}
.td-chip i { color: var(--gn-green, #1A8F5C); }

/* ── Reservations list (owner view) ──────────────────────────────────────── */
.td-reservation-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid rgba(13,46,26,.06);
}
.td-reservation-item:last-child { border-bottom: none; }
.td-res-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--gn-gold, #F5A623);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: .9rem;
  flex-shrink: 0;
}
.td-res-name  { font-size: .92rem; font-weight: 700; color: var(--gn-dark, #0D2E1A); }
.td-res-meta  { font-size: .78rem; color: rgba(13,46,26,.5); margin-top: 2px; }
.td-res-actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }

.td-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: .72rem;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.td-status-pill.pending  { background: rgba(245,166,35,.15); color: #7c4a00; }
.td-status-pill.confirmed{ background: rgba(26,143,92,.12);  color: #065f46; }
.td-status-pill.cancelled{ background: rgba(229,62,62,.1);   color: #991b1b; }

/* ── Map ─────────────────────────────────────────────────────────────────── */
#trip-map {
  height: 340px;
  border-radius: 12px;
  z-index: 0;
  border: 1px solid rgba(13,46,26,.08);
}

.tracking-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  padding: 8px 14px;
  border-radius: 8px;
  font-size: .875rem;
  font-weight: 500;
  min-height: 36px;
}
.tracking-badge:empty { display: none; }
.tracking-badge--active   { background: rgba(26,143,92,.1);  color: #065f46; border: 1px solid rgba(26,143,92,.25); }
.tracking-badge--error    { background: rgba(229,62,62,.08); color: #991b1b; border: 1px solid rgba(229,62,62,.2); }
.tracking-badge--stopped  { background: var(--gn-light);     color: rgba(13,46,26,.55); border: 1px solid rgba(13,46,26,.1); }

.map-marker { display:flex; align-items:center; justify-content:center; width:32px; height:32px; border-radius:50%; font-size:14px; color:#fff; box-shadow:0 2px 6px rgba(0,0,0,.3); }
.map-marker--depart    { background: var(--gn-green, #1A8F5C); }
.map-marker--arrivee   { background: var(--gn-red,   #CE1126); }
.map-marker--driver    { background: var(--gn-gold,  #F5A623); }
.map-marker--passenger { background: #7c3aed; }
.map-marker--user      { background: #2563eb; border: 3px solid #fff; width: 24px; height: 24px; font-size: 10px; }

/* ── Sidebar ─────────────────────────────────────────────────────────────── */
.td-sidebar {
  position: sticky;
  top: 90px;
  display: grid;
  gap: 16px;
}

/* Booking card */
.td-booking-card {
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 8px 32px rgba(13,46,26,.1);
  overflow: hidden;
}
.td-booking-head {
  background: linear-gradient(135deg, var(--gn-green, #1A8F5C), #136B44);
  padding: 20px 24px;
  color: #fff;
}
.td-booking-head h3 { margin: 0 0 4px; font-size: 1rem; font-weight: 700; }
.td-booking-head p  { margin: 0; font-size: .8rem; opacity: .85; }

.td-booking-body { padding: 20px 24px; display: grid; gap: 16px; }

.td-booking-price {
  text-align: center;
  padding: 14px;
  background: rgba(26,143,92,.05);
  border-radius: 12px;
  border: 1.5px solid rgba(26,143,92,.15);
}
.td-booking-price .td-bp-amount { font-size: 2rem; font-weight: 800; color: var(--gn-green, #1A8F5C); line-height: 1; }
.td-booking-price .td-bp-amount span { font-size: .85rem; font-weight: 600; color: rgba(13,46,26,.55); margin-left: 3px; }
.td-booking-price .td-bp-sub { font-size: .78rem; color: rgba(13,46,26,.5); margin-top: 4px; }

.td-booking-meta { display: grid; gap: 8px; }
.td-booking-meta-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: .84rem;
  color: rgba(13,46,26,.65);
}
.td-booking-meta-row i { color: var(--gn-green, #1A8F5C); width: 16px; text-align: center; flex-shrink: 0; }

.td-booking-divider { height: 1px; background: rgba(13,46,26,.07); }

.td-booking-actions { display: grid; gap: 10px; }
.td-booking-actions .btn { width: 100%; justify-content: center; }

/* Booking form */
.td-booking-form { display: grid; gap: 14px; }
.td-bf-field { display: grid; gap: 6px; }
.td-bf-field label {
  font-size: .82rem;
  font-weight: 600;
  color: var(--gn-dark, #0D2E1A);
  display: flex;
  align-items: center;
  gap: 6px;
}
.td-bf-field label i { color: var(--gn-green, #1A8F5C); }
.td-bf-input {
  border: 1.5px solid rgba(13,46,26,.15);
  border-radius: 10px;
  padding: 9px 12px;
  font-size: .9rem;
  background: var(--gn-light, #F6FBF8);
  color: var(--gn-dark, #0D2E1A);
  outline: none;
  transition: border-color .2s, box-shadow .2s;
  width: 100%;
  box-sizing: border-box;
  font-family: inherit;
}
.td-bf-input:focus {
  border-color: var(--gn-green, #1A8F5C);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(26,143,92,.1);
}

/* Secure badge */
.td-secure-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: .75rem;
  font-weight: 600;
  color: rgba(13,46,26,.55);
  background: rgba(26,143,92,.05);
  border-radius: 8px;
  padding: 8px 12px;
  border: 1px solid rgba(26,143,92,.1);
}
.td-secure-badge i { color: var(--gn-green, #1A8F5C); }

/* Alert in sidebar */
.td-alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 10px;
  font-size: .86rem;
  font-weight: 500;
}
.td-alert.success { background: rgba(26,143,92,.08);  color: #065f46; border: 1px solid rgba(26,143,92,.2); }
.td-alert.warning { background: rgba(245,166,35,.1);  color: #7c4a00; border: 1px solid rgba(245,166,35,.25); }
.td-alert.info    { background: rgba(59,130,246,.08); color: #1e40af; border: 1px solid rgba(59,130,246,.2); }
.td-alert i { margin-top: 2px; flex-shrink: 0; }

/* Quick actions card */
.td-actions-card {
  background: #fff;
  border-radius: 18px;
  padding: 18px 22px;
  box-shadow: 0 4px 20px rgba(13,46,26,.06);
  display: grid;
  gap: 10px;
}
.td-actions-card h4 { margin: 0 0 4px; font-size: .92rem; font-weight: 700; color: var(--gn-dark, #0D2E1A); }
.td-actions-card .btn { width: 100%; justify-content: center; }

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 940px) {
  .td-body { grid-template-columns: 1fr; }
  .td-sidebar { position: static; }
}

@media (max-width: 700px) {
  .td-hero-grid { grid-template-columns: 1fr; }
  .td-price-card { min-width: auto; }
  .td-info-grid  { grid-template-columns: 1fr 1fr; }
  .td-driver     { flex-direction: column; text-align: center; }
  .td-driver-badges { justify-content: center; }
}

@media (max-width: 480px) {
  .td-hero    { padding: 36px 0 40px; }
  .td-body    { margin-top: -16px; padding: 0 12px; }
  .td-card-body  { padding: 14px 16px 18px; }
  .td-card-head  { padding: 14px 16px 0; }
  .td-info-grid  { grid-template-columns: 1fr; }
  #trip-map      { height: 240px !important; }
  .td-booking-body { padding: 16px; }
  .td-route-title  { font-size: 1.3rem; }
}

@media (max-width: 360px) {
  .td-route-title { font-size: 1.1rem; }
  .td-price-card  { padding: 16px; }
}
