/* ═══════════════════════════════════════════════════
   On-Time – Main Stylesheet   (Mobile-first)
═══════════════════════════════════════════════════ */
:root {
  --primary: #111827;
  --primary-dark: #000;
  --primary-light: #f4f4f5;
  --success: #16a34a;
  --success-light: #dcfce7;
  --danger: #dc2626;
  --danger-light: #fee2e2;
  --warning: #d97706;
  --warning-light: #fef3c7;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 1px 4px rgba(0,0,0,0.06), 0 4px 16px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 8px rgba(0,0,0,0.08), 0 12px 32px rgba(0,0,0,0.1);
  --font: 'Sora', system-ui, -apple-system, sans-serif;
}

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

body {
  font-family: var(--font);
  color: var(--gray-800);
  background: var(--gray-50);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  max-width: 100vw;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

img { max-width: 100%; height: auto; }

/* ── Typography ─────────────────────────────────── */
h1 { font-size: 1.75rem; font-weight: 700; line-height: 1.2; }
h2 { font-size: 1.375rem; font-weight: 700; }
h3 { font-size: 1.125rem; font-weight: 600; }
h4 { font-size: 1rem; font-weight: 600; }

/* ── Layout ──────────────────────────────────────── */
.container { max-width: 480px; margin: 0 auto; padding: 0 16px; }
.container-lg { max-width: 900px; margin: 0 auto; padding: 0 16px; }

/* ── Navbar ──────────────────────────────────────── */
.navbar {
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(0,0,0,0.06);
  position: sticky; top: 0; z-index: 100;
  box-shadow: 0 1px 0 rgba(0,0,0,0.04);
}
.navbar-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 56px; padding: 0 16px;
  max-width: 900px; margin: 0 auto;
}
.navbar-logo {
  font-size: 1.25rem; font-weight: 800;
  color: var(--primary); letter-spacing: -0.5px;
  display: flex; align-items: center; gap: 6px;
}
.navbar-logo span { color: var(--gray-800); }
.navbar-actions { display: flex; gap: 8px; align-items: center; }

/* ── Buttons ─────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 20px; border-radius: var(--radius-sm);
  font-size: 0.95rem; font-weight: 600; cursor: pointer;
  border: none; transition: all 0.15s; white-space: nowrap;
  text-decoration: none;
}
.btn:hover { transform: translateY(-1px); text-decoration: none; }
.btn:active { transform: translateY(0); }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); color: #fff; }
.btn-outline { background: transparent; color: var(--primary); border: 2px solid var(--primary); }
.btn-outline:hover { background: var(--primary-light); }
.btn-success { background: var(--success); color: #fff; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-gray { background: var(--gray-200); color: var(--gray-700); }
.btn-gray:hover { background: var(--gray-300); }
.btn-sm { padding: 6px 14px; font-size: 0.85rem; }
.btn-lg { padding: 14px 28px; font-size: 1.05rem; }
.btn-full { width: 100%; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

/* ── Cards ───────────────────────────────────────── */
.card {
  background: #fff; border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 20px;
  margin-bottom: 16px;
}
.card-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 16px;
}

/* ── Forms ───────────────────────────────────────── */
.form-group { margin-bottom: 16px; }
.form-label {
  display: block; font-weight: 600; margin-bottom: 6px;
  color: var(--gray-700); font-size: 0.95rem;
}
.form-control {
  width: 100%; padding: 12px 14px;
  border: 2px solid var(--gray-200); border-radius: var(--radius-sm);
  font-size: 1rem; color: var(--gray-800); background: #fff;
  transition: border-color 0.15s;
  -webkit-appearance: none;
}
.form-control:focus {
  outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}
.form-control::placeholder { color: var(--gray-400); }
select.form-control { cursor: pointer; }
textarea.form-control { resize: vertical; min-height: 80px; }
.form-hint { font-size: 0.82rem; color: var(--gray-500); margin-top: 4px; }

/* ── Alerts ──────────────────────────────────────── */
.alert {
  padding: 12px 16px; border-radius: var(--radius-sm);
  font-size: 0.9rem; margin-bottom: 16px;
  display: flex; align-items: flex-start; gap: 8px;
}
.alert-error { background: var(--danger-light); color: #991b1b; }
.alert-success { background: var(--success-light); color: #166534; }
.alert-warning { background: var(--warning-light); color: #92400e; }
.alert-info { background: var(--primary-light); color: #1e40af; }

/* ── Stars ───────────────────────────────────────── */
.stars { color: #f59e0b; font-size: 1rem; letter-spacing: 1px; }
.stars-input { display: flex; gap: 4px; }
.stars-input .star { font-size: 2rem; cursor: pointer; color: var(--gray-300); transition: color 0.1s; }
.stars-input .star.active, .stars-input .star:hover { color: #f59e0b; }

/* ── Badge ───────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; padding: 2px 10px;
  border-radius: 20px; font-size: 0.78rem; font-weight: 600;
}
.badge-success { background: var(--success-light); color: #166534; }
.badge-danger { background: var(--danger-light); color: #991b1b; }
.badge-warning { background: var(--warning-light); color: #92400e; }
.badge-primary { background: var(--primary-light); color: #1e40af; }
.badge-gray { background: var(--gray-200); color: var(--gray-600); }

/* ── Provider Card ───────────────────────────────── */
.provider-card {
  background: #fff; border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden;
  transition: box-shadow 0.2s, transform 0.2s; cursor: pointer;
  display: block; text-decoration: none; color: inherit;
}
.provider-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.provider-card-img {
  width: 100%; height: 160px; object-fit: cover;
  background: linear-gradient(135deg, var(--primary-light), #c7d2fe);
  display: flex; align-items: center; justify-content: center;
  font-size: 3rem;
}
.provider-card-body { padding: 14px 16px; }
.provider-card-title { font-size: 1rem; font-weight: 700; margin-bottom: 2px; }
.provider-card-sub { font-size: 0.83rem; color: var(--gray-500); margin-bottom: 8px; }
.provider-card-meta {
  display: flex; justify-content: space-between; align-items: center;
}
.provider-price { font-weight: 700; color: var(--primary); font-size: 0.9rem; }

/* ── Grid ────────────────────────────────────────── */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid-3 { display: grid; grid-template-columns: repeat(3,1fr); gap: 12px; }

/* ── Time slot picker ────────────────────────────── */
.slot-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 8px; margin-top: 12px; }
.slot-btn {
  padding: 10px 4px; text-align: center; border-radius: var(--radius-sm);
  border: 2px solid var(--gray-200); background: #fff;
  cursor: pointer; font-size: 0.88rem; font-weight: 600;
  transition: all 0.15s; color: var(--gray-700);
}
.slot-btn.available:hover, .slot-btn.selected {
  border-color: var(--primary); background: var(--primary-light); color: var(--primary);
}
.slot-btn.unavailable {
  background: var(--gray-100); color: var(--gray-300);
  cursor: not-allowed; border-color: var(--gray-100);
  text-decoration: line-through;
}
/* Past slots (today, time already gone) — dimmer than unavailable, no strikethrough */
.slot-btn.past {
  background: transparent; color: var(--gray-200);
  cursor: not-allowed; border-color: var(--gray-100);
  opacity: 0.5;
  font-weight: 400;
}

/* ── Loading spinner ─────────────────────────────── */
.spinner {
  width: 40px; height: 40px; border: 4px solid var(--gray-200);
  border-top-color: var(--primary); border-radius: 50%;
  animation: spin 0.7s linear infinite; margin: 40px auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Map ─────────────────────────────────────────── */
#map { width: 100%; height: 340px; border-radius: var(--radius); }

/* ── Tabs ────────────────────────────────────────── */
.tabs { display: flex; border-bottom: 2px solid var(--gray-200); margin-bottom: 20px; }
.tab-btn {
  flex: 1; padding: 12px; text-align: center; background: none;
  border: none; cursor: pointer; font-size: 0.95rem; font-weight: 600;
  color: var(--gray-500); border-bottom: 2px solid transparent;
  margin-bottom: -2px; transition: all 0.15s;
}
.tab-btn.active { color: var(--primary); border-bottom-color: var(--primary); }

/* ── Category pills ──────────────────────────────── */
.pill-wrap { position: relative; margin-bottom: 16px; }
.pill-wrap::after {
  content: '';
  position: absolute; right: 0; top: 0; bottom: 6px; width: 56px;
  background: linear-gradient(to left, var(--gray-50) 30%, transparent);
  pointer-events: none;
  transition: opacity 0.25s;
}
.pill-wrap.at-end::after { opacity: 0; }
.pill-arrow {
  position: absolute; right: 6px; top: 50%; transform: translateY(-68%);
  font-size: 1.4rem; color: var(--primary); pointer-events: none; line-height: 1;
  animation: pill-bob 0.9s ease-in-out infinite alternate;
  transition: opacity 0.25s;
}
.pill-wrap.at-end .pill-arrow { opacity: 0; }
@keyframes pill-bob {
  from { transform: translateY(-68%) translateX(0); }
  to   { transform: translateY(-68%) translateX(5px); }
}
.pill-bar { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px; }
.pill-bar::-webkit-scrollbar { display: none; }
.pill {
  flex-shrink: 0; padding: 7px 16px; border-radius: 10px;
  border: 1.5px solid var(--gray-200); background: #fff;
  font-size: 0.83rem; font-weight: 600; cursor: pointer;
  transition: all 0.15s; white-space: nowrap; color: var(--gray-600);
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.pill:hover { border-color: var(--primary); color: var(--primary); background: #f8f7ff; }
.pill.active { border-color: var(--primary); background: var(--primary-light); color: var(--primary); box-shadow: 0 1px 3px rgba(79,70,229,0.15); }

/* ── Bottom nav (mobile) ─────────────────────────── */
.bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0;
  background: #fff; border-top: 1px solid var(--gray-200);
  display: flex; z-index: 100;
  box-shadow: 0 -2px 10px rgba(0,0,0,0.06);
}
.bottom-nav a {
  flex: 1; padding: 10px 4px 8px; text-align: center;
  font-size: 0.7rem; color: var(--gray-500); font-weight: 600;
  text-decoration: none; display: flex; flex-direction: column; align-items: center; gap: 3px;
}
.bottom-nav a.active { color: var(--primary); }
.bottom-nav a svg { width: 22px; height: 22px; }
.page-content { padding-bottom: 76px; }

/* ── Divider ─────────────────────────────────────── */
.divider { border: none; border-top: 1px solid var(--gray-200); margin: 16px 0; }

/* ── Avatar ──────────────────────────────────────── */
.avatar {
  width: 48px; height: 48px; border-radius: 50%;
  object-fit: cover; background: var(--primary-light);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem; font-weight: 700; color: var(--primary);
  flex-shrink: 0;
}

/* ── Status colors ───────────────────────────────── */
.status-pending { color: var(--warning); }
.status-confirmed { color: var(--success); }
.status-completed { color: var(--gray-600); }
.status-cancelled { color: var(--danger); }

/* ── Section header ──────────────────────────────── */
.section-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 12px;
}

/* ── Empty state ─────────────────────────────────── */
.empty-state {
  text-align: center; padding: 48px 24px; color: var(--gray-500);
}
.empty-state .empty-icon { font-size: 3rem; margin-bottom: 12px; }
.empty-state p { font-size: 0.95rem; }

/* ── Modal ───────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.5);
  z-index: 200; display: flex; align-items: flex-end;
  animation: fadeIn 0.2s;
}
.modal-overlay.center { align-items: center; justify-content: center; }
.modal {
  background: #fff; border-radius: var(--radius) var(--radius) 0 0;
  width: 100%; max-height: 90vh; overflow-y: auto;
  padding: 24px 20px; animation: slideUp 0.25s ease-out;
}
.modal-overlay.center .modal { border-radius: var(--radius); max-width: 440px; margin: 16px; }
.modal-handle { width: 40px; height: 4px; background: var(--gray-300); border-radius: 2px; margin: 0 auto 20px; }
.modal-title { font-size: 1.2rem; font-weight: 700; margin-bottom: 20px; }
@keyframes slideUp { from { transform: translateY(30px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* ── Booking list item ───────────────────────────── */
.booking-item {
  background: #fff; border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 16px;
  margin-bottom: 12px; border-left: 4px solid var(--gray-200);
}
.booking-item.pending { border-left-color: var(--warning); }
.booking-item.confirmed { border-left-color: var(--success); }
.booking-item.completed { border-left-color: var(--gray-400); }
.booking-item.cancelled { border-left-color: var(--danger); }
.booking-item-header { display: flex; justify-content: space-between; margin-bottom: 6px; }
.booking-time { font-size: 1.1rem; font-weight: 700; color: var(--gray-800); }
.booking-detail { font-size: 0.85rem; color: var(--gray-600); }

/* ── Search bar ──────────────────────────────────── */
.search-bar {
  display: flex; gap: 8px; margin-bottom: 16px;
}
.search-bar .form-control { flex: 1; border-radius: 24px; padding-left: 18px; }
.search-bar .btn { border-radius: 24px; }

/* ── Utilities ───────────────────────────────────── */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--gray-500); }
.text-sm { font-size: 0.85rem; }
.text-xs { font-size: 0.78rem; }
.fw-bold { font-weight: 700; }
.mt-4 { margin-top: 4px; } .mt-8 { margin-top: 8px; }
.mt-12 { margin-top: 12px; } .mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; } .mt-32 { margin-top: 32px; }
.mb-4 { margin-bottom: 4px; } .mb-8 { margin-bottom: 8px; }
.mb-12 { margin-bottom: 12px; } .mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.flex { display: flex; } .flex-center { display: flex; align-items: center; }
.gap-8 { gap: 8px; } .gap-12 { gap: 12px; }
.justify-between { justify-content: space-between; }
.hidden { display: none !important; }
.p-16 { padding: 16px; }
.rounded { border-radius: var(--radius); }

/* ── Page header ─────────────────────────────────── */
.page-hero {
  background: linear-gradient(135deg, var(--primary) 0%, #7c3aed 100%);
  color: #fff; padding: 32px 20px 24px;
}
.page-hero h1 { color: #fff; font-size: 1.6rem; margin-bottom: 6px; }
.page-hero p { color: rgba(255,255,255,0.85); font-size: 0.95rem; }

/* ── Admin table ─────────────────────────────────── */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
th { text-align: left; padding: 10px 12px; background: var(--gray-50); font-weight: 600; color: var(--gray-600); border-bottom: 2px solid var(--gray-200); }
td { padding: 10px 12px; border-bottom: 1px solid var(--gray-100); vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--gray-50); }

/* ── Responsive ──────────────────────────────────── */
@media (min-width: 600px) {
  .container { max-width: 600px; }
  h1 { font-size: 2rem; }
  .grid-2 { grid-template-columns: repeat(2,1fr); }
  .slot-grid { grid-template-columns: repeat(4,1fr); }
}
@media (min-width: 900px) {
  .container-lg { padding: 0 24px; }
  .grid-3 { grid-template-columns: repeat(3,1fr); }
  #map { height: 420px; }
}
