/* ============================================================
   YUCO — Design System
   Source: ai/BRAND_COLORS_FOR_AI.md
   ============================================================ */

/* TOKENS */
:root {
  --green:         #1D9E75;
  --green-dark:    #0F6E56;
  --green-darker:  #085041;
  --green-mid:     #5DCAA5;
  --green-light:   #9FE1CB;
  --green-pale:    #E1F5EE;

  --black:         #1a1a1a;
  --gray-700:      #444441;
  --gray-500:      #5F5E5A;
  --gray-400:      #717171;
  --gray-300:      #888780;
  --gray-200:      #B4B2A9;
  --gray-100:      #D3D1C7;
  --gray-50:       #EBEBEB;
  --gray-25:       #F7F7F7;
  --white:         #FFFFFF;

  --error:         #E24B4A;
  --error-light:   #FCEBEB;
  --warning:       #E65100;
  --warning-light: #FFF3E0;
  --star:          #f4a020;

  --font:      'DM Sans', system-ui, sans-serif;
  --font-mono: 'DM Mono', 'Courier New', monospace;

  --r-xs:   4px;
  --r-sm:   8px;
  --r-md:   12px;
  --r-card: 14px;
  --r-lg:   16px;
  --r-xl:   20px;
  --r-full: 100px;
}

/* RESET */
*, *::before, *::after {
  box-sizing: border-box; margin: 0; padding: 0;
  -webkit-tap-highlight-color: transparent;
}
html, body {
  height: 100%; font-family: var(--font); font-size: 14px;
  line-height: 1.5; color: var(--black); background: var(--white);
  overflow: hidden; -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font-family: var(--font); }
a { color: var(--green); text-decoration: none; }
img { display: block; max-width: 100%; }

/* APP TOP BAR — persistent across all views */
#app-top-bar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 16px 20px;
  background: var(--white);
  border-bottom: 1px solid var(--gray-50);
  flex-shrink: 0;
  z-index: 900;
}
.app-logo {
  grid-column: 1;
  font-size: 26px; font-weight: 700; color: var(--green);
  letter-spacing: -0.5px; background: none; border: none;
  cursor: pointer; font-family: var(--font); padding: 0;
  justify-self: start;
}
.top-search-pill {
  grid-column: 2;
  display: flex; align-items: center; gap: 8px;
  background: var(--white); border: 1px solid var(--gray-50);
  border-radius: var(--r-full); padding: 9px 16px;
  box-shadow: 0 1px 6px rgba(0,0,0,0.08);
  cursor: pointer; font-size: 14px; color: var(--gray-400);
  white-space: nowrap;
  transition: box-shadow 0.15s;
}
.top-search-pill:hover { box-shadow: 0 2px 10px rgba(0,0,0,0.12); }
.top-avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--green); color: var(--white);
  font-size: 12px; font-weight: 600;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; flex-shrink: 0;
  box-shadow: 0 1px 4px rgba(0,0,0,0.15);
  transition: opacity 0.15s;
}
.top-avatar:hover { opacity: 0.85; }

/* RIGHT SIDE NAV (Links + Hamburger) */
.top-bar-right {
  grid-column: 3;
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 20px;
}
.top-bar-link {
  font-size: 14px;
  color: var(--black);
  text-decoration: none;
  font-weight: 500;
  cursor: pointer;
  transition: color 0.15s;
}
.top-bar-link:hover { color: var(--gray-400); }

/* Hide links on mobile so the top bar doesn't overflow */
@media (max-width: 767px) {
  .top-bar-link { display: none !important; }
}

/* HAMBURGER + AVATAR PILL (replaces bare avatar) */
.user-menu-btn {
  display: flex; align-items: center; gap: 8px;
  border: 1px solid var(--gray-100); border-radius: var(--r-full);
  padding: 5px 6px 5px 10px;
  cursor: pointer; background: var(--white);
  transition: box-shadow 0.15s;
}
.user-menu-btn:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.12); }
.user-menu-btn svg { color: var(--gray-500); flex-shrink: 0; }

/* DROPDOWN MENU */
.user-dropdown {
  position: fixed;
  top: 62px; right: 12px;
  background: var(--white);
  border: 1px solid var(--gray-50);
  border-radius: var(--r-md);
  box-shadow: 0 4px 20px rgba(0,0,0,0.12);
  min-width: 220px;
  z-index: 1000;
  overflow: hidden;
  animation: dropIn 0.15s ease-out;
}
@keyframes dropIn {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.dropdown-item {
  padding: 13px 18px; font-size: 14px;
  cursor: pointer; display: block; width: 100%;
  background: none; border: none; text-align: left;
  font-family: var(--font); color: var(--black);
  transition: background 0.1s;
}
.dropdown-item:hover   { background: var(--gray-25); }
.dropdown-item.bold    { font-weight: 600; }
.dropdown-item.danger  { color: var(--error); }
.dropdown-divider      { height: 1px; background: var(--gray-50); }

/* LAYOUT */
#app {
  display: flex; flex-direction: column;
  height: 100dvh;
  position: relative; background: var(--white);
}
#view { flex: 1; overflow-y: auto; overflow-x: hidden; position: relative; }

/* ── RESPONSIVE ────────────────────────────────────────────────────────────── */
/* Mobile: full-screen, phone-style layout */
@media (max-width: 767px) {
  #app { max-width: 430px; margin: 0 auto; }
}

/* Desktop: full browser width */
@media (min-width: 768px) {
  /* Content views (auth, listing, bookings, profile) — centered column */
  #view.view-content {
    display: flex;
    flex-direction: column;
    align-items: center;
  }
  #view.view-content > * {
    width: 100%;
    max-width: 680px;
  }

  /* Cap the search pill width on wide screens — logo+pill+avatar stay compact */
  .map-search-pill { max-width: 360px; }

  /* Bottom sheet is replaced by the side panel on desktop */
  .bottom-sheet { display: none !important; }

  /* Sticky bottom bar stays at bottom of centered column */
  .sticky-bar {
    max-width: 680px;
    width: 100%;
    align-self: center;
  }

  /* LISTING SIDE PANEL (Airbnb style — slides in from left, map stays visible) */
  #listing-panel {
    position: fixed;
    top: 0; left: 0; bottom: 0;
    width: 420px;
    background: var(--white);
    z-index: 800;
    overflow-y: auto;
    transform: translateX(-100%);
    transition: transform 0.35s cubic-bezier(0.32, 0.72, 0, 1);
    box-shadow: 4px 0 24px rgba(0,0,0,0.12);
  }
  #listing-panel.open {
    transform: translateX(0);
  }
}

/* TYPOGRAPHY */
h1 { font-size: 22px; font-weight: 600; line-height: 1.3; }
h2 { font-size: 20px; font-weight: 600; line-height: 1.3; }
h3 { font-size: 18px; font-weight: 600; }
.mono { font-family: var(--font-mono); }
.text-muted { color: var(--gray-400); }
.text-xs  { font-size: 11px; }
.text-sm  { font-size: 12px; }
.text-md  { font-size: 15px; }

/* BUTTONS */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 6px; border: none; border-radius: var(--r-md);
  font-size: 15px; font-weight: 600; cursor: pointer;
  padding: 0 20px; height: 52px; width: 100%;
  transition: opacity 0.15s, background 0.15s; text-decoration: none;
}
.btn:disabled { opacity: 0.4; pointer-events: none; }
.btn-primary   { background: var(--green);  color: var(--white); }
.btn-primary:active { background: var(--green-dark); }
.btn-secondary { background: var(--white); color: var(--black); border: 1px solid var(--black); }
.btn-sm { height: 38px; font-size: 13px; padding: 0 14px; }
.btn-outline-sm {
  height: 36px; font-size: 13px; padding: 0 14px; border-radius: var(--r-sm);
  border: 1px solid var(--black); background: transparent; color: var(--black); width: auto;
}
.btn-danger-ghost { background: transparent; color: var(--error); font-weight: 500; width: auto; padding: 0; height: auto; border: none; cursor: pointer; }

/* INPUTS */
.field { display: flex; flex-direction: column; gap: 6px; }
.field label {
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px;
  color: var(--gray-400); font-weight: 500;
}
.input {
  background: var(--white); border: 1px solid var(--gray-100);
  border-radius: var(--r-sm); padding: 12px 14px; font-size: 14px;
  color: var(--black); outline: none; width: 100%;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.input::placeholder { color: var(--gray-200); }
.input:focus { border-color: var(--green); box-shadow: 0 0 0 3px var(--green-pale); }
.input.error  { border-color: var(--error); box-shadow: 0 0 0 3px var(--error-light); }
.input-wrapper { position: relative; }
.input-wrapper .input { padding-right: 44px; }
.input-icon {
  position: absolute; right: 14px; top: 50%; transform: translateY(-50%);
  cursor: pointer; color: var(--gray-300); font-size: 16px; background: none; border: none;
}

/* BADGES */
.badge {
  display: inline-flex; align-items: center;
  padding: 3px 10px; border-radius: var(--r-full);
  font-size: 11px; font-weight: 500;
}
.badge-confirmed  { background: var(--green-pale);    color: var(--green-dark); }
.badge-pending    { background: var(--warning-light);  color: var(--warning); }
.badge-completed  { background: var(--gray-25);        color: var(--gray-500); }
.badge-cancelled,
.badge-declined   { background: var(--error-light);    color: var(--error); }
.badge-verified   { background: var(--green-pale);     color: var(--green-dark); }
.badge-neutral    { background: var(--gray-25);        color: var(--gray-500); }

/* CHIPS */
.chip {
  display: inline-flex; align-items: center; gap: 4px;
  background: var(--gray-25); color: var(--gray-500);
  border-radius: var(--r-full); padding: 4px 10px; font-size: 12px;
}

/* BOTTOM NAV */
.bottom-nav {
  display: flex; background: var(--white);
  border-top: 0.5px solid var(--gray-50);
  padding: 8px 0 calc(8px + env(safe-area-inset-bottom, 0px));
  flex-shrink: 0;
}
.bottom-nav.hidden { display: none !important; }
.nav-tab {
  flex: 1; display: flex; flex-direction: column; align-items: center;
  gap: 2px; background: none; border: none; cursor: pointer;
  color: var(--gray-200); font-size: 11px; padding: 4px 0;
  transition: color 0.15s;
}
.nav-tab.active { color: var(--black); font-weight: 500; }

/* TOP BAR */
.top-bar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; border-bottom: 1px solid var(--gray-50);
  flex-shrink: 0; background: var(--white);
}
.top-bar-title { font-size: 16px; font-weight: 600; }
.top-bar-btn {
  background: none; border: none; cursor: pointer;
  display: flex; align-items: center; color: var(--black); padding: 4px;
}

/* DIVIDER */
.divider { width: 100%; height: 1px; background: var(--gray-50); margin: 16px 0; }

/* SPEC GRID */
.spec-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.spec-item {
  background: var(--gray-25); border-radius: var(--r-sm); padding: 12px;
  display: flex; flex-direction: column; gap: 4px;
}
.spec-value { font-size: 15px; font-weight: 600; color: var(--black); }
.spec-label { font-size: 11px; color: var(--gray-400); text-transform: uppercase; letter-spacing: 0.5px; }

/* STICKY BOTTOM BAR */
.sticky-bar {
  position: sticky; bottom: 0; background: var(--white);
  border-top: 1px solid var(--gray-50);
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px));
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  z-index: 10;
}
.price-block { display: flex; flex-direction: column; }
.price-main { font-family: var(--font-mono); font-size: 18px; font-weight: 500; color: var(--black); }
.price-sub  { font-size: 12px; color: var(--gray-400); }
.sticky-bar .btn { flex: 1; max-width: 160px; height: 48px; font-size: 15px; }

/* MAP */
#map-container { position: relative; height: 100%; }
#leaflet-map   { height: 100%; width: 100%; background: #e8e3db; }
.map-overlay-top {
  position: absolute; top: 0; left: 0; right: 0;
  padding: 12px 12px 0; z-index: 1000;
  display: flex; align-items: center; gap: 8px; pointer-events: none;
}
.map-overlay-top > * { pointer-events: auto; }
.map-logo {
  font-size: 22px; font-weight: 700; color: var(--green);
  letter-spacing: -0.5px; flex-shrink: 0; background: none; border: none; cursor: pointer;
}
.map-search-pill {
  flex: 1; display: flex; align-items: center; gap: 8px;
  background: var(--white); border: 1px solid var(--gray-100);
  border-radius: var(--r-full); padding: 9px 14px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.12); font-size: 14px; color: var(--gray-400); cursor: pointer;
}
.map-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--green); color: var(--white); font-size: 12px; font-weight: 600;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--white); box-shadow: 0 2px 6px rgba(0,0,0,0.15); cursor: pointer; flex-shrink: 0;
}

/* PRICE BUBBLES */
.price-bubble {
  background: var(--white); color: var(--black); border: 0.5px solid rgba(0,0,0,0.15);
  border-radius: var(--r-full); padding: 5px 10px;
  font-family: var(--font-mono); font-size: 12px; font-weight: 500;
  white-space: nowrap; cursor: pointer;
  box-shadow: 0 1px 4px rgba(0,0,0,0.15); transition: transform 0.1s;
}
.price-bubble.selected { background: var(--black); color: var(--white); border-color: var(--black); }
.price-bubble:hover    { transform: scale(1.05); }

/* BOTTOM SHEET */
.bottom-sheet {
  position: absolute; bottom: 0; left: 0; right: 0;
  background: var(--white); border-radius: var(--r-xl) var(--r-xl) 0 0;
  padding: 8px 16px 16px; z-index: 1000;
  box-shadow: 0 -4px 20px rgba(0,0,0,0.1);
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.32, 0.72, 0, 1);
}
.bottom-sheet.open { transform: translateY(0); }
.sheet-handle {
  width: 36px; height: 4px; background: var(--gray-100);
  border-radius: 2px; margin: 0 auto 12px;
}
.listing-preview { display: flex; gap: 12px; }
.listing-preview-img {
  width: 88px; height: 88px; border-radius: var(--r-md);
  object-fit: cover; flex-shrink: 0; background: var(--gray-25);
}
.listing-preview-info { flex: 1; display: flex; flex-direction: column; gap: 4px; }
.listing-preview-title { font-size: 15px; font-weight: 600; line-height: 1.3; }

/* TOGGLE PILL */
.toggle-pill {
  display: flex; background: var(--gray-25);
  border-radius: var(--r-full); padding: 4px; gap: 2px;
}
.toggle-tab {
  flex: 1; padding: 9px 12px; border-radius: var(--r-full); border: none;
  font-size: 14px; font-weight: 500; cursor: pointer;
  background: transparent; color: var(--gray-400); transition: all 0.2s;
}
.toggle-tab.active { background: var(--white); color: var(--black); box-shadow: 0 1px 3px rgba(0,0,0,0.1); }

/* ROLE CARDS */
.role-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.role-card {
  border: 1px solid var(--gray-100); border-radius: var(--r-md);
  padding: 14px 12px; cursor: pointer; transition: border-color 0.15s;
  display: flex; flex-direction: column; gap: 4px; background: var(--white);
}
.role-card.selected { border: 1.5px solid var(--black); }
.role-card-emoji { font-size: 20px; }
.role-card-label { font-size: 14px; font-weight: 600; }
.role-card-desc  { font-size: 12px; color: var(--gray-400); }

/* BOOKING CARDS */
.booking-card { border: 1px solid var(--gray-50); border-radius: var(--r-card); overflow: hidden; }
.booking-card-body { padding: 14px; }
.booking-thumb { width: 56px; height: 56px; border-radius: 10px; object-fit: cover; background: var(--gray-25); flex-shrink: 0; }
.booking-price { font-family: var(--font-mono); font-size: 15px; }
.booking-actions { display: flex; align-items: center; gap: 12px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--gray-50); }

/* FILTER TABS */
.filter-tabs {
  display: flex; overflow-x: auto; border-bottom: 1px solid var(--gray-50);
  padding: 0 16px; background: var(--white); flex-shrink: 0;
}
.filter-tabs::-webkit-scrollbar { display: none; }
.filter-tab {
  padding: 12px 16px; font-size: 14px; color: var(--gray-400);
  background: none; border: none; border-bottom: 2px solid transparent;
  cursor: pointer; white-space: nowrap; transition: color 0.15s, border-color 0.15s;
}
.filter-tab.active { color: var(--black); border-bottom-color: var(--black); font-weight: 500; }

/* HOST ROW */
.host-avatar {
  width: 48px; height: 48px; border-radius: 50%;
  background: var(--green); color: var(--white);
  font-size: 14px; font-weight: 600;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}

/* FORM HELPERS */
.form-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* PROFILE */
.profile-header { padding: 24px 16px; display: flex; flex-direction: column; align-items: center; gap: 10px; border-bottom: 1px solid var(--gray-50); }
.profile-avatar { width: 80px; height: 80px; border-radius: 50%; background: var(--green); color: var(--white); font-size: 28px; font-weight: 600; display: flex; align-items: center; justify-content: center; }
.menu-item { display: flex; align-items: center; justify-content: space-between; padding: 16px; border-bottom: 1px solid var(--gray-50); cursor: pointer; }
.menu-item:active { background: var(--gray-25); }

/* SPINNER */
.spinner {
  display: inline-block; width: 20px; height: 20px;
  border: 2px solid rgba(255,255,255,0.3); border-top-color: var(--white);
  border-radius: 50%; animation: spin 0.7s linear infinite;
}
.spinner-green { border-color: var(--gray-25); border-top-color: var(--green); }
@keyframes spin { to { transform: rotate(360deg); } }

/* FEEDBACK */
.error-msg   { background: var(--error-light); color: var(--error); border-radius: var(--r-sm); padding: 10px 12px; font-size: 13px; }
.success-msg { background: var(--green-pale);  color: var(--green-dark); border-radius: var(--r-sm); padding: 10px 12px; font-size: 13px; }

/* EMPTY STATE */
.empty-state { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 64px 32px; text-align: center; gap: 12px; }
.empty-state .icon { font-size: 48px; }

/* UTILITIES */
.hidden { display: none !important; }
.row         { display: flex; align-items: center; }
.row-between { display: flex; align-items: center; justify-content: space-between; }
.gap-1 { gap: 4px;  } .gap-2 { gap: 8px;  } .gap-3 { gap: 12px; } .gap-4 { gap: 16px; }
.mt-1 { margin-top: 4px;  } .mt-2 { margin-top: 8px;  } .mt-3 { margin-top: 12px; } .mt-4 { margin-top: 16px; }
.mb-2 { margin-bottom: 8px; } .mb-3 { margin-bottom: 12px; } .mb-4 { margin-bottom: 16px; }
.px { padding-left: 16px; padding-right: 16px; }
.py { padding-top: 16px; padding-bottom: 16px; }
.p  { padding: 16px; }
::-webkit-scrollbar { width: 0; height: 0; }
