/* ========================================
   HISTORY.CSS — Ride History Page
   Mobile-first + Desktop responsive
   ======================================== */

/* ── Header Banner ── */
.history-header-wrap {
  background: linear-gradient(135deg, #1E174A 0%, #2B2166 60%, #3a1a5c 100%);
  padding: 28px 20px 32px;
  position: relative;
  overflow: hidden;
}
.history-header-wrap::before {
  content: '';
  position: absolute;
  width: 260px; height: 260px;
  background: radial-gradient(circle, rgba(255,107,44,0.22), transparent 70%);
  top: -100px; right: -60px;
  pointer-events: none;
}
.history-header-wrap::after {
  content: '';
  position: absolute;
  width: 180px; height: 180px;
  background: radial-gradient(circle, rgba(96,165,250,0.12), transparent 70%);
  bottom: -60px; left: -40px;
  pointer-events: none;
}
.history-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 24px;
}
.history-page-title {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 800;
  color: #ffffff;
  line-height: 1.1;
  letter-spacing: -0.3px;
  text-shadow: 0 2px 12px rgba(0,0,0,0.3);
}
.history-page-sub {
  font-size: 0.82rem;
  color: rgba(255,255,255,0.60);
  margin-top: 5px;
  font-weight: 500;
}

/* ── Stat Cards ── */
.stats-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px;
}
.stat-card {
  background: rgba(255,255,255,0.09);
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 16px;
  padding: 16px 10px;
  text-align: center;
  backdrop-filter: blur(12px);
  transition: all 0.25s;
}
.stat-card:active { transform: scale(0.96); }
.stat-icon { font-size: 1.25rem; margin-bottom: 8px; }
.stat-num {
  font-family: var(--font-display);
  font-size: 1.65rem;
  font-weight: 800;
  color: #ffffff;
  line-height: 1;
}
.stat-label {
  font-size: 0.6rem;
  font-weight: 700;
  color: rgba(255,255,255,0.50);
  letter-spacing: 0.8px;
  text-transform: uppercase;
  margin-top: 5px;
}
.stat-card.active-card {
  background: rgba(255,107,44,0.22);
  border-color: rgba(255,107,44,0.40);
  box-shadow: 0 4px 20px rgba(255,107,44,0.18);
}
.stat-card.active-card .stat-num   { color: #FFB08A; }
.stat-card.active-card .stat-label { color: rgba(255,176,138,0.70); }

/* ── Filter Bar ── */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 16px 10px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  background: var(--bg);
}
.filter-bar::-webkit-scrollbar { display: none; }
.filter-chip {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 15px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  border: 1.5px solid var(--border);
  background: var(--bg-card);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
  font-family: var(--font-body);
}
.filter-chip.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  box-shadow: 0 4px 14px rgba(255,107,44,0.32);
}
.cal-chip {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 15px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  border: 1.5px solid var(--border);
  background: var(--bg-card);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
  white-space: nowrap;
  font-family: var(--font-body);
}
.cal-chip.has-date {
  background: linear-gradient(135deg, #1E174A, #2B2166);
  border-color: #3d2d80;
  color: #fff;
}
.cal-chip svg { width: 13px; height: 13px; }
#cal-input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }

/* ── Month Label ── */
.month-label {
  font-size: 0.7rem;
  font-weight: 800;
  color: var(--text-muted);
  letter-spacing: 1.2px;
  text-transform: uppercase;
  padding: 16px 16px 6px;
  font-family: var(--font-display);
}

/* ── Ride Card ── */
.ride-card {
  margin: 0 12px 12px;
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1.5px solid var(--border);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  transition: transform 0.2s, box-shadow 0.2s;
  cursor: pointer;
}
.ride-card:active { transform: scale(0.98); box-shadow: none; }
@media (min-width: 480px) { .ride-card { margin: 0 16px 12px; } }

.ride-card-top {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 14px 12px;
}
.ride-vehicle-img {
  width: 72px; height: 54px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  background: var(--bg);
  flex-shrink: 0;
}
.ride-vehicle-img-placeholder {
  width: 72px; height: 54px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, #f0f1f6, #e8e9f0);
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.6rem;
}
.ride-info { flex: 1; min-width: 0; }
.ride-vehicle-name {
  font-family: var(--font-display);
  font-size: 0.97rem; font-weight: 700;
  color: var(--text-main);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ride-date-line {
  font-size: 0.75rem; color: var(--text-muted);
  margin-top: 3px; display: flex; align-items: center; gap: 4px;
}
.ride-amount {
  font-family: var(--font-display);
  font-size: 1.05rem; font-weight: 800;
  color: var(--primary); flex-shrink: 0;
}
.ride-status-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 9px 14px;
  border-top: 1px solid var(--border);
  background: #f9fafb;
}
.ride-id-text { font-size: 0.68rem; color: var(--text-light); font-weight: 600; letter-spacing: 0.5px; }

/* ── Status Pills ── */
.status-pill {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 10px; border-radius: 999px;
  font-size: 0.7rem; font-weight: 800; letter-spacing: 0.2px;
}
.status-pill .dot { width: 6px; height: 6px; border-radius: 50%; }
.pill-active    { background: #dcfce7; color: #15803d; }
.pill-active .dot    { background: #22c55e; animation: blink 1.2s ease-in-out infinite; }
.pill-confirmed { background: #dbeafe; color: #1d4ed8; }
.pill-confirmed .dot { background: #3b82f6; }
.pill-pending   { background: #fef9c3; color: #a16207; }
.pill-pending .dot   { background: #eab308; }
.pill-completed { background: #f0fdf4; color: #166534; }
.pill-completed .dot { background: #4ade80; }
.pill-cancelled { background: #fee2e2; color: #991b1b; }
.pill-cancelled .dot { background: #f87171; }
@keyframes blink {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.4; transform: scale(1.5); }
}

/* ── Progress Bar ── */
.duration-bar-wrap {
  margin: 8px 0 2px; background: var(--bg);
  border-radius: 999px; height: 5px; overflow: hidden;
}
.duration-bar-fill {
  height: 100%; border-radius: 999px;
  background: linear-gradient(90deg, var(--primary), #FF9A6C);
  transition: width 0.6s ease;
}

/* ── Shimmer ── */
.shimmer-card {
  margin: 0 12px 12px; border-radius: var(--radius);
  overflow: hidden; border: 1.5px solid var(--border); background: var(--bg-card);
}
@media (min-width: 480px) { .shimmer-card { margin: 0 16px 12px; } }
.shimmer-top    { display: flex; gap: 12px; padding: 14px; align-items: center; }
.shimmer-img    { width: 72px; height: 54px; border-radius: var(--radius-sm); flex-shrink: 0; }
.shimmer-lines  { flex: 1; display: flex; flex-direction: column; gap: 8px; }
.shimmer-line   { height: 12px; border-radius: 6px; }
.shimmer-line.w60 { width: 60%; }
.shimmer-line.w40 { width: 40%; }
.shimmer-bottom { height: 36px; }

/* ── Empty State ── */
.history-empty { text-align: center; padding: 64px 24px; color: var(--text-muted); }
.history-empty-icon { font-size: 3.5rem; margin-bottom: 16px; opacity: 0.4; }
.history-empty h3 { font-size: 1.05rem; color: var(--text-main); margin-bottom: 8px; font-family: var(--font-display); }
.history-empty p  { font-size: 0.85rem; }

/* ── Refresh Button ── */
.refresh-btn {
  background: rgba(255,255,255,0.12);
  border: 1.5px solid rgba(255,255,255,0.20);
  border-radius: 50%; width: 40px; height: 40px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; color: #fff; transition: all 0.22s; flex-shrink: 0;
}
.refresh-btn:hover  { background: rgba(255,255,255,0.20); }
.refresh-btn:active { transform: rotate(180deg) scale(0.9); }
.refresh-btn svg    { width: 18px; height: 18px; }
.refresh-btn.spinning { animation: spin360 0.6s ease; }
@keyframes spin360 { to { transform: rotate(360deg); } }

/* ── Scroll to Top ── */
#scroll-top-btn {
  position: fixed; bottom: 90px; right: 16px;
  width: 42px; height: 42px; border-radius: 50%;
  background: var(--primary); color: #fff;
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-primary); cursor: pointer; border: none;
  transition: all 0.25s; opacity: 0; pointer-events: none; z-index: 500;
}
#scroll-top-btn.visible { opacity: 1; pointer-events: auto; }
#scroll-top-btn:active  { transform: scale(0.92); }

/* ── Detail Modal ── */
.modal-overlay {
  position: fixed; inset: 0; z-index: 8000;
  background: rgba(0,0,0,0.55); backdrop-filter: blur(4px);
  display: flex; align-items: flex-end; justify-content: center;
  opacity: 0; pointer-events: none; transition: opacity 0.3s;
}
.modal-overlay.open { opacity: 1; pointer-events: auto; }
.modal-sheet {
  background: #fff; width: 100%; max-width: 480px;
  border-radius: 24px 24px 0 0; padding: 0 0 40px;
  max-height: 88vh; overflow-y: auto;
  transform: translateY(30px);
  transition: transform 0.35s cubic-bezier(0.34,1.2,0.64,1);
}
.modal-overlay.open .modal-sheet { transform: translateY(0); }
.modal-handle { width: 40px; height: 4px; background: var(--border-strong); border-radius: 2px; margin: 14px auto 0; }
.modal-title { font-family: var(--font-display); font-size: 1.1rem; font-weight: 800; padding: 14px 20px 6px; color: var(--text-main); }
.modal-vehicle-banner {
  margin: 0 16px 16px; border-radius: 16px; overflow: hidden; height: 114px;
  background: linear-gradient(135deg, #1E174A, #2B2166);
  display: flex; align-items: center; justify-content: center; position: relative;
}
.modal-vehicle-banner img { width: 100%; height: 100%; object-fit: cover; }
.modal-vehicle-banner .banner-name {
  position: absolute; bottom: 10px; left: 14px;
  font-family: var(--font-display); font-size: 1rem; font-weight: 800;
  color: #fff; text-shadow: 0 2px 8px rgba(0,0,0,0.5);
}
.modal-section-head {
  font-size: 0.7rem; font-weight: 800; color: var(--text-muted);
  letter-spacing: 1px; text-transform: uppercase;
  padding: 12px 20px 6px; border-top: 1px solid var(--border);
  font-family: var(--font-display);
}
.modal-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 20px; font-size: 0.88rem; border-bottom: 1px solid var(--border);
}
.modal-row:last-of-type { border-bottom: none; }
.modal-row span:first-child { color: var(--text-muted); }
.modal-row span:last-child  { font-weight: 700; color: var(--text-main); }
.modal-close-btn { margin: 16px 16px 0; width: calc(100% - 32px); }
.modal-progress-wrap { padding: 12px 20px 14px; border-bottom: 1px solid var(--border); }
.modal-progress-label {
  display: flex; justify-content: space-between;
  font-size: 0.7rem; color: var(--text-muted);
  margin-bottom: 8px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px;
}
.modal-progress-ends {
  display: flex; justify-content: space-between;
  font-size: 0.72rem; color: var(--text-muted); margin-top: 5px;
}

/* ══════════════════════════════════════
   DETAIL OVERLAY — Full screen slide-up
   Same look as confirmation page
══════════════════════════════════════ */
.detail-overlay {
  position: fixed;
  inset: 0;
  z-index: 9000;
  background: var(--bg);
  transform: translateY(100%);
  transition: transform 0.38s cubic-bezier(0.4, 0, 0.2, 1);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.detail-overlay.open {
  transform: translateY(0);
}

/* Top bar with back button */
.detail-overlay-topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(135deg, #1E174A 0%, #2B2166 100%);
  padding: 0 16px;
  height: 60px;
  box-shadow: 0 2px 16px rgba(0,0,0,0.18);
}
.detail-back-btn {
  background: rgba(255,255,255,0.10);
  border: 1.5px solid rgba(255,255,255,0.18);
  border-radius: 50%;
  width: 38px; height: 38px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; color: #fff;
  transition: all 0.2s;
  flex-shrink: 0;
}
.detail-back-btn:hover  { background: rgba(255,255,255,0.20); }
.detail-back-btn:active { transform: scale(0.92); }

.detail-overlay-title {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: 0.2px;
}

/* page-content inside overlay */
.detail-overlay .page-content {
  padding: 16px 14px 100px;
  max-width: 600px;
  margin: 0 auto;
}
@media (min-width: 480px) {
  .detail-overlay .page-content { padding: 20px 20px 100px; }
}
@media (min-width: 768px) {
  .detail-overlay .page-content { padding: 32px 28px 80px; }
  .detail-overlay-topbar { height: 68px; padding: 0 28px; }
  .detail-overlay-title { font-size: 1.1rem; }
}
.login-icon-img{
   width:26px;
   height:26px;
   object-fit:contain;
}