/* ============================================================
   TAXI COST CALCULATOR - Main Styles
   ============================================================ */

:root {
  --bg-primary: #1a1a2e;
  --bg-secondary: #16213e;
  --bg-card: #0f3460;
  --accent: #e94560;
  --accent-2: #f5a623;
  --text-primary: #eaeaea;
  --text-secondary: #a0a0b0;
  --success: #2ecc71;
  --warning: #f39c12;
  --info: #3498db;
  --uber: #000000;
  --pickme: #ff6b35;
  --other: #6c757d;
  --border: rgba(255,255,255,0.1);
  --radius: 12px;
  --shadow: 0 4px 20px rgba(0,0,0,0.3);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
}

/* ---- Top Header ---- */
.app-header {
  background: var(--bg-secondary);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.app-header h1 {
  font-size: 18px;
  font-weight: 700;
  color: var(--accent);
}

.header-actions button {
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 20px;
  cursor: pointer;
  padding: 4px 8px;
}

/* ---- Bottom Nav ---- */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0; right: 0;
  background: var(--bg-secondary);
  border-top: 1px solid var(--border);
  display: flex;
  z-index: 100;
}

.nav-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 10px 4px 8px;
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 10px;
  font-weight: 500;
  cursor: pointer;
  transition: color 0.2s;
  gap: 2px;
}

.nav-btn .nav-icon { font-size: 22px; }
.nav-btn.active { color: var(--accent); }

/* ---- Pages ---- */
.page {
  display: none;
  padding: 16px 16px 80px;
  animation: fadeIn 0.2s ease;
}
.page.active { display: block; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---- Cards ---- */
.card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 16px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.card-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 12px;
}

/* ---- Form Elements ---- */
.form-group { margin-bottom: 14px; }
.form-group label {
  display: block;
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

input[type="number"], input[type="text"], select {
  width: 100%;
  background: rgba(255,255,255,0.08);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--text-primary);
  font-size: 15px;
}

input:focus, select:focus {
  outline: none;
  border-color: var(--accent);
}

select option { background: var(--bg-secondary); }

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 11px 20px;
  border-radius: 8px;
  border: none;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.1s;
}
.btn:active { transform: scale(0.97); }
.btn-primary { background: var(--accent); color: white; }
.btn-success { background: var(--success); color: white; }
.btn-warning { background: var(--warning); color: white; }
.btn-danger { background: #c0392b; color: white; }
.btn-secondary { background: rgba(255,255,255,0.1); color: var(--text-primary); }
.btn-full { width: 100%; }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* ---- Platform Tabs ---- */
.platform-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.platform-tab {
  flex: 1;
  padding: 10px 6px;
  border-radius: 8px;
  border: 2px solid transparent;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  transition: all 0.2s;
}

.platform-tab.uber {
  background: rgba(0,0,0,0.4);
  color: white;
  border-color: rgba(255,255,255,0.2);
}
.platform-tab.uber.active { background: #333; border-color: #fff; }

.platform-tab.pickme {
  background: rgba(255,107,53,0.15);
  color: var(--pickme);
  border-color: rgba(255,107,53,0.3);
}
.platform-tab.pickme.active { background: var(--pickme); color: white; border-color: var(--pickme); }

.platform-tab.other {
  background: rgba(108,117,125,0.15);
  color: var(--text-secondary);
  border-color: rgba(108,117,125,0.3);
}
.platform-tab.other.active { background: var(--other); color: white; border-color: var(--other); }

/* ---- Pricing Table ---- */
.pricing-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.pricing-table th {
  background: rgba(255,255,255,0.08);
  padding: 10px 8px;
  text-align: left;
  font-weight: 600;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border);
}

.pricing-table td {
  padding: 10px 8px;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}

.pricing-table tr:hover td { background: rgba(255,255,255,0.03); }
.pricing-table tr.highlight td { background: rgba(233,69,96,0.1); }

.tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
}
.tag-success { background: rgba(46,204,113,0.2); color: var(--success); }
.tag-warning { background: rgba(243,156,18,0.2); color: var(--warning); }
.tag-danger { background: rgba(192,57,43,0.2); color: #e74c3c; }

/* ---- Cost Breakdown ---- */
.cost-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  font-size: 14px;
}
.cost-row:last-child { border-bottom: none; }
.cost-row.total {
  font-size: 18px;
  font-weight: 700;
  color: var(--accent);
  padding-top: 12px;
  margin-top: 4px;
  border-top: 2px solid var(--border);
  border-bottom: none;
}
.cost-row .label { color: var(--text-secondary); }
.cost-row .value { font-weight: 600; }

/* ---- Toggle Switch ---- */
.toggle-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
}
.toggle-row label { font-size: 14px; }

.toggle {
  position: relative;
  width: 46px;
  height: 26px;
}
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0.15);
  border-radius: 26px;
  transition: 0.3s;
  cursor: pointer;
}
.toggle-slider::before {
  content: '';
  position: absolute;
  width: 20px; height: 20px;
  left: 3px; top: 3px;
  background: white;
  border-radius: 50%;
  transition: 0.3s;
}
.toggle input:checked + .toggle-slider { background: var(--accent); }
.toggle input:checked + .toggle-slider::before { transform: translateX(20px); }

/* ---- Trip Tracker ---- */
.tracker-status {
  text-align: center;
  padding: 24px 16px;
}
.tracker-status .status-icon {
  font-size: 48px;
  margin-bottom: 12px;
}
.tracker-status .status-text {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 4px;
}
.tracker-status .status-sub {
  font-size: 13px;
  color: var(--text-secondary);
}

.stat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 16px;
}

.stat-box {
  background: rgba(255,255,255,0.05);
  border-radius: 10px;
  padding: 14px;
  text-align: center;
}
.stat-box .stat-value {
  font-size: 22px;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 4px;
}
.stat-box .stat-label {
  font-size: 12px;
  color: var(--text-secondary);
}

/* ---- Map placeholder ---- */
#map-container {
  width: 100%;
  height: 220px;
  border-radius: var(--radius);
  overflow: hidden;
  background: #0d1b2a;
  position: relative;
  margin-bottom: 16px;
}
#map-container canvas {
  width: 100%;
  height: 100%;
}
.map-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  height: 100%;
  color: var(--text-secondary);
  font-size: 13px;
  gap: 8px;
}

/* ---- Report ---- */
.report-header {
  text-align: center;
  margin-bottom: 20px;
}
.report-header h2 {
  font-size: 22px;
  color: var(--accent);
}
.report-header p { color: var(--text-secondary); font-size: 13px; margin-top: 4px; }

.report-section { margin-bottom: 20px; }
.report-section h3 {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 12px;
}

.trips-list { display: flex; flex-direction: column; gap: 10px; }
.trip-item {
  background: rgba(255,255,255,0.05);
  border-radius: 10px;
  padding: 12px;
  border-left: 3px solid var(--accent);
}
.trip-item.uber-trip { border-left-color: #aaa; }
.trip-item.pickme-trip { border-left-color: var(--pickme); }
.trip-item .trip-meta {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  margin-bottom: 6px;
  color: var(--text-secondary);
}
.trip-item .trip-amount {
  font-size: 20px;
  font-weight: 700;
  color: var(--success);
}
.trip-item .trip-details { font-size: 12px; color: var(--text-secondary); margin-top: 4px; }

/* ---- Section divider ---- */
.divider {
  height: 1px;
  background: var(--border);
  margin: 16px 0;
}

/* ---- Chip ---- */
.chip {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  margin: 2px;
}
.chip-uber { background: #333; color: #fff; }
.chip-pickme { background: var(--pickme); color: #fff; }
.chip-other { background: var(--other); color: #fff; }

/* ---- Scrollable table wrapper ---- */
.table-scroll { overflow-x: auto; }

/* ---- Toast ---- */
.toast {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: rgba(30,30,50,0.97);
  border: 1px solid var(--border);
  color: var(--text-primary);
  padding: 10px 20px;
  border-radius: 24px;
  font-size: 13px;
  font-weight: 500;
  opacity: 0;
  transition: all 0.3s;
  z-index: 200;
  white-space: nowrap;
  pointer-events: none;
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ---- Subscription selector ---- */
.sub-pills {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 6px;
}
.sub-pill {
  padding: 6px 12px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-primary);
  font-size: 13px;
  cursor: pointer;
}
.sub-pill.active {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}

/* ---- Section header ---- */
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}
.section-header h2 {
  font-size: 18px;
  font-weight: 700;
}

/* ---- Pulsing dot for live tracking ---- */
.pulse-dot {
  display: inline-block;
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 0 rgba(46,204,113,0.6);
  animation: pulse-anim 1.5s infinite;
  margin-right: 6px;
}
@keyframes pulse-anim {
  0% { box-shadow: 0 0 0 0 rgba(46,204,113,0.6); }
  70% { box-shadow: 0 0 0 10px rgba(46,204,113,0); }
  100% { box-shadow: 0 0 0 0 rgba(46,204,113,0); }
}

/* ---- Responsive tweaks ---- */
@media (min-width: 480px) {
  .page { max-width: 480px; margin: 0 auto; }
  .bottom-nav { max-width: 480px; left: 50%; transform: translateX(-50%); }
}
