/* ========================================
   KinCare App Dashboard — DoorDash-Style
   Interactive Booking Platform
   ======================================== */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&family=Inter:wght@300;400;500;600;700&family=Space+Grotesk:wght@400;500;600;700&display=swap');

:root {
  --coral: #32CD32;
  --coral-light: #45E045;
  --coral-dark: #28A428;
  --navy: #0A1628;
  --navy-light: #142236;
  --gold: #FFD93D;
  --gold-dark: #E6C235;
  --lavender: #E8D5F5;
  --green: #10B981;
  --green-light: #D1FAE5;
  --blue: #3B82F6;
  --orange: #F59E0B;
  --white: #FFFFFF;
  --cloud: #F8F9FC;
  --mist: #EEF0F5;
  --slate: #6B7280;
  --charcoal: #2D3436;
  --black: #0D0D1A;
  --font-heading: 'Outfit', sans-serif;
  --font-body: 'Inter', sans-serif;
  --font-accent: 'Space Grotesk', sans-serif;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --radius-full: 9999px;
  --shadow-sm: 0 2px 8px rgba(26,26,46,0.06);
  --shadow-md: 0 4px 20px rgba(26,26,46,0.08);
  --shadow-lg: 0 8px 40px rgba(26,26,46,0.12);
  --ease-out: cubic-bezier(0.16,1,0.3,1);
  --ease-spring: cubic-bezier(0.34,1.56,0.64,1);
}

* { margin:0; padding:0; box-sizing:border-box; }
html { font-size:16px; }
body {
  font-family: var(--font-body);
  background: var(--cloud);
  color: var(--charcoal);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
h1,h2,h3,h4,h5 { font-family: var(--font-heading); font-weight:700; color: var(--navy); }
a { text-decoration:none; color:inherit; }
ul { list-style:none; }
img { max-width:100%; display:block; }
button { cursor:pointer; border:none; font-family: var(--font-body); }
input, select { font-family: var(--font-body); }

/* ===== TOP BAR ===== */
.topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  background: var(--white);
  border-bottom: 1px solid var(--mist);
  padding: 12px 24px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.topbar-logo {
  font-family: var(--font-heading);
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--navy);
  white-space: nowrap;
}
.topbar-logo span { color: var(--coral); }

.topbar-location {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: var(--cloud);
  border-radius: var(--radius-full);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}
.topbar-location:hover { background: var(--mist); }
.topbar-location .pin { color: var(--coral); }

.topbar-search {
  flex: 1;
  position: relative;
  max-width: 480px;
}
.topbar-search input {
  width: 100%;
  padding: 10px 16px 10px 40px;
  border-radius: var(--radius-full);
  border: 2px solid var(--mist);
  background: var(--cloud);
  font-size: 0.9rem;
  outline: none;
  transition: all 0.2s;
}
.topbar-search input:focus {
  border-color: var(--coral);
  background: var(--white);
  box-shadow: 0 0 0 3px rgba(50,205,50,0.1);
}
.topbar-search .search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--slate);
  font-size: 0.9rem;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: auto;
}

.topbar-btn {
  padding: 8px 16px;
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 600;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-outline {
  background: transparent;
  border: 2px solid var(--mist);
  color: var(--charcoal);
}
.btn-outline:hover { border-color: var(--coral); color: var(--coral); }

.btn-fill {
  background: linear-gradient(135deg, var(--coral), var(--coral-dark));
  color: var(--white);
  border: none;
  box-shadow: 0 2px 10px rgba(50,205,50,0.3);
}
.btn-fill:hover { transform: translateY(-1px); box-shadow: 0 4px 15px rgba(50,205,50,0.4); }

.topbar-avatar {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--coral), var(--lavender));
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; color: var(--white); font-size: 0.9rem;
  cursor: pointer;
  transition: transform 0.2s;
}
.topbar-avatar:hover { transform: scale(1.1); }

/* ===== MAIN LAYOUT ===== */
.app-layout {
  margin-top: 64px;
  display: grid;
  grid-template-columns: 1fr 420px;
  min-height: calc(100vh - 64px);
}

/* ===== LEFT: BROWSING PANEL ===== */
.browse-panel {
  padding: 24px;
  overflow-y: auto;
  max-height: calc(100vh - 64px);
}

/* Category pills */
.category-bar {
  display: flex;
  gap: 10px;
  margin-bottom: 24px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: none;
}
.category-bar::-webkit-scrollbar { display:none; }

.category-pill {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 12px 18px;
  border-radius: var(--radius-lg);
  background: var(--white);
  border: 2px solid var(--mist);
  cursor: pointer;
  transition: all 0.25s var(--ease-spring);
  white-space: nowrap;
  min-width: 90px;
}
.category-pill:hover { border-color: var(--coral-light); transform: translateY(-3px); }
.category-pill.active {
  border-color: var(--coral);
  background: linear-gradient(135deg, rgba(50,205,50,0.08), rgba(50,205,50,0.02));
  box-shadow: 0 4px 12px rgba(50,205,50,0.15);
}
.category-pill .cat-icon { font-size: 1.5rem; }
.category-pill .cat-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--slate);
}
.category-pill.active .cat-label { color: var(--coral); }

/* Filter bar */
.filter-bar {
  display: flex;
  gap: 10px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}
.filter-chip {
  padding: 8px 16px;
  border-radius: var(--radius-full);
  background: var(--white);
  border: 1.5px solid var(--mist);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--slate);
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 4px;
}
.filter-chip:hover { border-color: var(--coral); color: var(--coral); }
.filter-chip.active {
  background: var(--coral);
  color: var(--white);
  border-color: var(--coral);
}

/* Section Header */
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}
.section-header h2 { font-size: 1.3rem; }
.section-header .count {
  font-size: 0.85rem;
  color: var(--slate);
  font-weight: 500;
}

/* Provider Cards Grid */
.providers-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}

.provider-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--mist);
  cursor: pointer;
  transition: all 0.3s var(--ease-out);
  position: relative;
}
.provider-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: transparent;
}

.provider-card-image {
  height: 160px;
  background: linear-gradient(135deg, var(--lavender), var(--mist));
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3.5rem;
}

.provider-card-badge {
  position: absolute;
  top: 10px; left: 10px;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--white);
  backdrop-filter: blur(10px);
}
.badge-available { background: var(--green); }
.badge-top { background: var(--coral); }
.badge-new { background: var(--blue); }

.provider-card-fav {
  position: absolute;
  top: 10px; right: 10px;
  width: 32px; height: 32px;
  border-radius: 50%;
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
}
.provider-card-fav:hover { transform: scale(1.2); background: var(--white); }
.provider-card-fav.liked { background: #FEE2E2; }

.provider-card-body {
  padding: 14px 16px;
}

.provider-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 6px;
}

.provider-card-name {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 700;
}

.provider-card-rating {
  display: flex;
  align-items: center;
  gap: 3px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--charcoal);
}
.provider-card-rating .star { color: var(--gold); }

.provider-card-services {
  display: flex;
  gap: 6px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}
.provider-card-services .tag {
  padding: 3px 8px;
  border-radius: var(--radius-full);
  background: var(--cloud);
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--slate);
}

.provider-card-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  color: var(--slate);
}
.provider-card-price {
  font-family: var(--font-accent);
  font-weight: 700;
  color: var(--charcoal);
  font-size: 0.95rem;
}
.provider-card-price span { font-weight:400; color: var(--slate); font-size:0.8rem; }

.provider-card-eta {
  display: flex;
  align-items: center;
  gap: 4px;
}
.eta-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--green);
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0%, 100% { opacity:1; transform:scale(1); }
  50% { opacity:0.5; transform:scale(1.3); }
}

/* Quick Book Banner */
.quick-book {
  background: linear-gradient(135deg, var(--navy), #2A1A4E);
  border-radius: var(--radius-xl);
  padding: 28px 32px;
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 32px;
  position: relative;
  overflow: hidden;
}
.quick-book::before {
  content: '';
  position: absolute;
  top: -50%; right: -20%;
  width: 300px; height: 300px;
  border-radius: 50%;
  background: rgba(50,205,50,0.15);
  filter: blur(60px);
}
.quick-book-text h3 { color: var(--white); font-size: 1.2rem; margin-bottom: 4px; }
.quick-book-text p { color: rgba(255,255,255,0.6); font-size: 0.9rem; }
.quick-book-btn {
  padding: 12px 24px;
  border-radius: var(--radius-full);
  background: var(--coral);
  color: var(--white);
  font-weight: 700;
  font-size: 0.9rem;
  transition: all 0.2s var(--ease-spring);
  white-space: nowrap;
  position: relative;
  z-index: 1;
}
.quick-book-btn:hover { transform: scale(1.05); box-shadow: 0 4px 20px rgba(50,205,50,0.4); }

/* ===== RIGHT: MAP PANEL ===== */
.map-panel {
  position: sticky;
  top: 64px;
  height: calc(100vh - 64px);
  background: #E8E0D8;
  border-left: 1px solid var(--mist);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.map-container {
  flex: 1;
  position: relative;
  background:
    radial-gradient(circle at 30% 40%, rgba(16,185,129,0.15) 0%, transparent 30%),
    radial-gradient(circle at 70% 60%, rgba(59,130,246,0.1) 0%, transparent 30%),
    linear-gradient(135deg, #E8E0D8, #D4CCC4);
  overflow: hidden;
}

/* Simulated map roads */
.map-road {
  position: absolute;
  background: rgba(255,255,255,0.6);
  border-radius: 2px;
}
.map-road-h1 { top: 30%; left: 0; right: 0; height: 3px; }
.map-road-h2 { top: 55%; left: 0; right: 0; height: 2px; }
.map-road-h3 { top: 78%; left: 10%; right: 15%; height: 2px; }
.map-road-v1 { left: 25%; top: 0; bottom: 0; width: 3px; }
.map-road-v2 { left: 55%; top: 0; bottom: 0; width: 2px; }
.map-road-v3 { left: 80%; top: 10%; bottom: 20%; width: 2px; }

/* Map blocks */
.map-block {
  position: absolute;
  border-radius: 4px;
  opacity: 0.4;
}

/* Map pins */
.map-pin {
  position: absolute;
  width: 40px; height: 40px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem;
  cursor: pointer;
  transition: all 0.3s var(--ease-spring);
  z-index: 10;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,0.2));
}
.map-pin::before {
  content: '';
  position: absolute;
  width: 36px; height: 36px;
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  z-index: -1;
}
.map-pin:hover { transform: scale(1.3) translateY(-5px); z-index: 20; }

.map-pin.pin-baby::before { background: var(--coral); }
.map-pin.pin-pet::before { background: var(--blue); }
.map-pin.pin-transport::before { background: var(--green); }
.map-pin.pin-home::before { background: var(--orange); }
.map-pin.pin-tutor::before { background: #8B5CF6; }
.map-pin.pin-senior::before { background: #EC4899; }

.map-pin.pin-you {
  z-index: 30;
}
.map-pin.pin-you::before {
  background: var(--navy);
  box-shadow: 0 0 0 4px rgba(26,26,46,0.2), 0 0 0 8px rgba(26,26,46,0.1);
}
.map-pin.pin-you::after {
  content: '';
  position: absolute;
  width: 50px; height: 50px;
  border-radius: 50%;
  border: 2px solid rgba(26,26,46,0.15);
  animation: radar 2s ease-out infinite;
}
@keyframes radar {
  0% { transform: scale(0.8); opacity: 1; }
  100% { transform: scale(2.5); opacity: 0; }
}

/* Map bottom info */
.map-info {
  padding: 16px 20px;
  background: var(--white);
  border-top: 1px solid var(--mist);
}
.map-info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.map-info-count {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.95rem;
}
.map-info-count span { color: var(--coral); }
.map-info-btn {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--coral);
  cursor: pointer;
  transition: all 0.2s;
  background: none; border: none;
}
.map-info-btn:hover { text-decoration: underline; }

/* ===== PROVIDER DETAIL DRAWER ===== */
.drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  backdrop-filter: blur(4px);
  z-index: 200;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s;
}
.drawer-overlay.open { opacity: 1; visibility: visible; }

.drawer {
  position: fixed;
  right: 0; top: 0; bottom: 0;
  width: 460px;
  max-width: 100vw;
  background: var(--white);
  z-index: 201;
  transform: translateX(100%);
  transition: transform 0.4s var(--ease-out);
  display: flex;
  flex-direction: column;
  box-shadow: -8px 0 40px rgba(0,0,0,0.15);
}
.drawer.open { transform: translateX(0); }

.drawer-header {
  position: relative;
  height: 220px;
  background: linear-gradient(135deg, var(--lavender), var(--mist));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 5rem;
  flex-shrink: 0;
}
.drawer-close {
  position: absolute;
  top: 16px; right: 16px;
  width: 36px; height: 36px;
  border-radius: 50%;
  background: rgba(255,255,255,0.9);
  backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
}
.drawer-close:hover { transform: rotate(90deg) scale(1.1); }

.drawer-verified {
  position: absolute;
  bottom: 16px; left: 16px;
  display: flex; gap: 6px;
}
.verified-badge {
  padding: 4px 10px;
  border-radius: var(--radius-full);
  background: rgba(255,255,255,0.9);
  backdrop-filter: blur(8px);
  font-size: 0.7rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 4px;
}

.drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
}

.drawer-name {
  font-size: 1.5rem;
  margin-bottom: 4px;
}
.drawer-tagline {
  color: var(--slate);
  font-size: 0.9rem;
  margin-bottom: 16px;
}

.drawer-stats {
  display: flex;
  gap: 20px;
  margin-bottom: 20px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--mist);
}
.drawer-stat { text-align: center; }
.drawer-stat-val {
  font-family: var(--font-accent);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--navy);
}
.drawer-stat-label {
  font-size: 0.75rem;
  color: var(--slate);
}

.drawer-section { margin-bottom: 20px; }
.drawer-section h4 {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--slate);
  margin-bottom: 10px;
}
.drawer-section p {
  font-size: 0.9rem;
  line-height: 1.7;
  color: var(--charcoal);
}

.drawer-services-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.drawer-service-tag {
  padding: 6px 14px;
  border-radius: var(--radius-full);
  background: var(--cloud);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--charcoal);
}

.drawer-reviews {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.mini-review {
  padding: 12px;
  background: var(--cloud);
  border-radius: var(--radius-md);
}
.mini-review-stars { color: var(--gold); font-size: 0.8rem; margin-bottom: 4px; }
.mini-review-text { font-size: 0.85rem; color: var(--charcoal); font-style: italic; line-height: 1.5; }
.mini-review-author { font-size: 0.75rem; color: var(--slate); margin-top: 6px; }

/* Drawer Footer CTA */
.drawer-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--mist);
  background: var(--white);
  flex-shrink: 0;
}
.drawer-footer-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}
.drawer-price {
  font-family: var(--font-accent);
  font-size: 1.5rem;
  font-weight: 700;
}
.drawer-price span {
  font-size: 0.85rem;
  font-weight: 400;
  color: var(--slate);
}
.drawer-eta-label {
  font-size: 0.85rem;
  color: var(--green);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 4px;
}

.drawer-book-btn {
  width: 100%;
  padding: 16px;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, var(--coral), var(--coral-dark));
  color: var(--white);
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 700;
  transition: all 0.2s var(--ease-spring);
  box-shadow: 0 4px 15px rgba(50,205,50,0.4);
}
.drawer-book-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(50,205,50,0.5);
}

/* ===== BOOKING CONFIRMATION MODAL ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(6px);
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s;
}
.modal-overlay.open { opacity: 1; visibility: visible; }

.modal {
  background: var(--white);
  border-radius: var(--radius-xl);
  width: 420px;
  max-width: 90vw;
  overflow: hidden;
  transform: scale(0.9) translateY(20px);
  transition: transform 0.4s var(--ease-spring);
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}
.modal-overlay.open .modal { transform: scale(1) translateY(0); }

.modal-success {
  padding: 40px 32px;
  text-align: center;
}
.modal-success-icon {
  width: 80px; height: 80px;
  border-radius: 50%;
  background: var(--green-light);
  display: flex; align-items: center; justify-content: center;
  font-size: 2.5rem;
  margin: 0 auto 20px;
  animation: successPop 0.5s var(--ease-spring);
}
@keyframes successPop {
  0% { transform: scale(0); }
  100% { transform: scale(1); }
}
.modal-success h2 { font-size: 1.5rem; margin-bottom: 8px; }
.modal-success p { color: var(--slate); margin-bottom: 24px; line-height: 1.6; }
.modal-success .detail-row {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--mist);
  font-size: 0.9rem;
}
.modal-success .detail-row:last-of-type { border-bottom: none; }
.modal-success .detail-label { color: var(--slate); }
.modal-success .detail-value { font-weight: 600; }
.modal-success .btn-done {
  margin-top: 24px;
  padding: 14px 40px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--green), #059669);
  color: var(--white);
  font-weight: 700;
  font-size: 1rem;
  transition: all 0.2s;
}
.modal-success .btn-done:hover { transform: translateY(-2px); }

.modal-success .track-btn {
  margin-top: 12px;
  padding: 12px 40px;
  border-radius: var(--radius-full);
  background: transparent;
  color: var(--coral);
  font-weight: 700;
  font-size: 0.9rem;
  border: 2px solid var(--coral);
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.modal-success .track-btn:hover { background: rgba(50,205,50,0.05); }

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
  .app-layout {
    grid-template-columns: 1fr;
  }
  .map-panel {
    position: relative;
    top: 0;
    height: 300px;
    order: -1;
  }
}

@media (max-width: 768px) {
  .topbar-location, .topbar .btn-outline { display: none; }
  .topbar-search { max-width: none; }
  .providers-grid { grid-template-columns: 1fr; }
  .drawer { width: 100%; }
  .quick-book { flex-direction: column; text-align: center; gap: 16px; }
}

/* Mobile Landscape Optimization */
@media (max-height: 550px) and (orientation: landscape) {
  .topbar { height: 52px; padding: 0 16px; }
  .map-panel { height: 220px; }
  .drawer { max-height: 94vh; overflow-y: auto; }
  .modal-card { max-height: 90vh; overflow-y: auto; }
}

