/* ═══════════════════════════════════════════════════════
   GOOVA · Pages — pages.css
   Home hero, search card, destinations, driver view
   ═══════════════════════════════════════════════════════ */

/* ═══════════════════ PAGE HOME ═══════════════════════ */

#page-home.active {
  display: flex;
  flex-direction: column;
  height: 100svh;
  overflow: hidden;
  padding-bottom: 0;
  min-height: unset;
}

/* ── HERO ── */
.home-hero {
  background: linear-gradient(165deg, var(--primary) 0%, var(--primary-deep) 100%);
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
  padding-bottom: 100px;
}

/* Dunes SVG overlay */
.hero-dunes {
  position: absolute; inset: 0;
  pointer-events: none; overflow: hidden;
}
.hero-dunes svg {
  position: absolute; bottom: 0; left: 0;
  width: 100%; height: auto;
}

/* Top bar */
.hero-topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: max(40px, calc(28px + env(safe-area-inset-top, 0px))) 16px 0;
  position: relative; z-index: 2;
}
.hero-logo { display: flex; flex-direction: column; }
.hero-logo-text {
  font: 800 28px/1 'Plus Jakarta Sans', sans-serif;
  color: white; letter-spacing: -1.3px;
}
/* petit point au-dessus du premier "o" via position relative */
.hero-logo-dot {
  position: relative; display: inline-block;
}
.hero-logo-dot::before {
  content: '·';
  position: absolute; top: -6px; left: 50%; transform: translateX(-50%);
  font-size: 18px; color: var(--accent); line-height: 1;
}
.hero-logo-arabic {
  font: 500 10px/1 'Noto Naskh Arabic', serif;
  color: rgba(255,255,255,.55); direction: rtl;
  text-align: left; margin-top: 6px;
}
.hero-topbar-right { display: flex; align-items: center; gap: 8px; }
.hero-lang-pill {
  background: rgba(255,255,255,.18);
  border: 1px solid rgba(255,255,255,.28);
  border-radius: 20px; padding: 5px 11px;
  font: 700 12px/1 'Inter Tight', sans-serif;
  color: white; cursor: pointer; transition: background .15s;
  white-space: nowrap;
}
.hero-lang-pill:hover { background: rgba(255,255,255,.30); }
.hero-bell-btn, .hero-avatar-btn {
  width: 36px; height: 36px; border-radius: 50%;
  background: rgba(255,255,255,.18);
  border: 1px solid rgba(255,255,255,.25);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: background .15s; flex-shrink: 0;
}
.hero-bell-btn:hover, .hero-avatar-btn:hover { background: rgba(255,255,255,.30); }
.hero-bell-btn svg, .hero-avatar-btn svg { width: 18px; height: 18px; color: white; }
#hero-avatar-initials {
  color: white;
  font: 800 13px/1 'Plus Jakarta Sans', sans-serif;
}

/* Hero content (greeting + headline) */
.hero-content { padding: 24px 16px 8px; position: relative; z-index: 2; }
.hero-greeting {
  font: 500 14px/1 'Inter Tight', sans-serif;
  color: rgba(255,255,255,.80); margin-bottom: 8px;
}
.hero-headline {
  font: 800 30px/1.12 'Plus Jakarta Sans', sans-serif;
  letter-spacing: -0.8px; color: white; margin-bottom: 6px;
}
.hero-sub-arabic {
  display: block;
  font: 500 13px/1.6 'Noto Naskh Arabic', serif;
  color: rgba(255,255,255,.55); direction: rtl;
}

/* ── HOME SCROLLABLE BODY ── */
.home-body {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  background: var(--bg);
  margin-top: -82px;
  border-radius: 24px 24px 0 0;
  padding-bottom: calc(80px + 24px + env(safe-area-inset-bottom, 0px));
}

/* ── FLOATING SEARCH CARD ── */
.home-search-card {
  background: var(--surface);
  border-radius: var(--radius);
  margin: 16px 12px 0;
  padding: 14px 16px;
  box-shadow: var(--shadow-md);
  position: relative; z-index: 10;
}

/* Search card inner elements */
.hsc-row {
  display: flex; align-items: center; gap: 12px;
  padding: 9px 0; cursor: pointer;
  width: 100%; background: none; border: none;
  font-family: 'Inter Tight', sans-serif; text-align: left;
}
.hsc-row:active { opacity: .75; }
.hsc-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.hsc-dot-from { background: var(--primary); box-shadow: 0 0 0 3px var(--primary-lo); }
.hsc-dot-to { background: var(--fg-subtle); }
.hsc-connector { width: 10px; display: flex; justify-content: center; flex-shrink: 0; }
.hsc-connector-line { width: 1.5px; height: 14px; background: var(--border); }
.hsc-code { font: 800 10px/1 'Inter Tight', sans-serif; color: var(--fg-subtle); text-transform: uppercase; letter-spacing: .5px; min-width: 22px; }
.hsc-val { font: 600 15px/1.2 'Inter Tight', sans-serif; color: var(--fg); }
.hsc-placeholder { font: 500 15px/1.2 'Inter Tight', sans-serif; color: var(--fg-subtle); }
.hsc-divider { height: 1px; background: var(--border); margin: 4px 0; }
.hsc-date-row {
  display: flex; align-items: center; gap: 12px;
  padding: 9px 0; cursor: pointer;
}
.hsc-date-row svg { width: 18px; height: 18px; color: var(--primary); flex-shrink: 0; }
.hsc-date-row input { flex: 1; border: none; outline: none; font: 500 15px/1 'Inter Tight', sans-serif; color: var(--fg); background: transparent; }

/* ── SEARCH TOGGLE (Je cherche / Je propose) ── */
.home-toggle-row {
  display: flex; background: var(--surface-2);
  border-radius: var(--radius-sm); padding: 3px;
  margin: 10px 12px 0;
}
.home-toggle-btn {
  flex: 1; padding: 9px 4px; border: none;
  border-radius: 11px;
  font: 600 13px/1.2 'Inter Tight', sans-serif;
  cursor: pointer; background: transparent; color: var(--fg-subtle);
  transition: all .15s; font-family: 'Inter Tight', sans-serif;
  display: flex; align-items: center; justify-content: center; gap: 5px;
}
.home-toggle-btn.active {
  background: var(--surface); color: var(--fg);
  box-shadow: var(--shadow-sm);
}
.home-toggle-btn svg { flex-shrink: 0; }

/* ── HOME DRIVER VIEW ── */
.driver-pending-notice {
  background: var(--surface-2); border: 1.5px solid var(--border);
  border-radius: 14px; padding: 16px;
  margin: 16px 12px 12px; text-align: center;
}

.home-action-btn {
  width: calc(100% - 24px); margin: 0 12px;
  padding: 15px 18px; border-radius: var(--radius-sm);
  font: 700 15px/1.2 'Plus Jakarta Sans', sans-serif;
  cursor: pointer; display: flex; align-items: center; gap: 14px;
  border: none; font-family: 'Plus Jakarta Sans', sans-serif;
  transition: transform .1s, box-shadow .1s;
  text-align: left; box-sizing: border-box;
}
.home-action-btn:active { transform: scale(.98); }
.home-action-btn.publish {
  background: var(--primary); color: white;
  box-shadow: 0 4px 18px rgba(31,138,91,.35);
  margin-top: 16px; margin-bottom: 10px;
}
.home-action-btn.find {
  background: var(--surface); color: var(--fg);
  border: 2px solid var(--border); box-shadow: var(--shadow-sm);
}
.home-action-btn.find.open { border-color: var(--primary); border-radius: var(--radius-sm) var(--radius-sm) 0 0; }
.home-action-icon { flex-shrink: 0; display: flex; align-items: center; }
.home-action-label { font: 700 15px/1.2 'Plus Jakarta Sans', sans-serif; }
.home-action-sub { font: 500 12px/1.3 'Inter Tight', sans-serif; opacity: .65; margin-top: 2px; }
.home-action-arrow { margin-left: auto; flex-shrink: 0; transition: transform .25s; }

.home-search-expanded {
  background: var(--surface);
  border: 2px solid var(--primary); border-top: none;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  padding: 4px 14px 14px;
  margin: 0 12px 16px;
}

/* ── HOME TRIPS (inline section) ── */
#home-trips { padding: 0 12px; }

/* Home trip card */
.home-trip-card {
  background: var(--surface); border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm); border-left: 4px solid var(--primary);
  padding: 14px 16px; margin-bottom: 10px;
  cursor: pointer; transition: box-shadow .15s, transform .15s;
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
}
.home-trip-card:hover { box-shadow: var(--shadow); }
.home-trip-card:active { transform: scale(.98); }
.htc-left { flex: 1; min-width: 0; }
.htc-route { font: 700 15px/1.2 'Plus Jakarta Sans', sans-serif; color: var(--fg); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.htc-meta { font: 400 12px/1.4 'Inter Tight', sans-serif; color: var(--fg-subtle); margin-top: 4px; }
.htc-right { text-align: right; flex-shrink: 0; }
.htc-price { font: 800 17px/1 'Plus Jakarta Sans', sans-serif; color: var(--primary); }
.htc-time { font: 400 12px/1.3 'Inter Tight', sans-serif; color: var(--fg-subtle); margin-top: 3px; }

/* ── DRIVER PROFILE MODAL ── */
#driver-profile-modal > div {
  background: var(--bg);
  border-radius: 20px 20px 0 0;
  box-shadow: 0 -4px 32px rgba(21,25,26,.12);
}

/* ── BOOKING SUCCESS ── */
#booking-success-overlay > div {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
}

/* ── PUBLISH MODAL ── */
#publish-modal > div {
  background: var(--bg);
  border-radius: 20px 20px 0 0;
  box-shadow: 0 -4px 32px rgba(21,25,26,.12);
}

/* ═══════════════════ PAGE SEARCH ═══════════════════ */

#page-search.active {
  display: flex;
  flex-direction: column;
  height: 100svh;
  overflow: hidden;
}

/* Hero compact gradient */
.sp-hero {
  background: linear-gradient(160deg, var(--primary) 0%, var(--primary-deep) 100%);
  padding: max(40px, calc(28px + env(safe-area-inset-top, 0px))) 16px 16px;
  flex-shrink: 0;
}

/* Top bar : back + title + spacer */
.sp-topbar {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 14px;
}
.sp-back {
  width: 36px; height: 36px; border-radius: 50%;
  background: rgba(255,255,255,.18);
  border: 1px solid rgba(255,255,255,.25);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; flex-shrink: 0; color: white;
  transition: background .15s;
}
.sp-back:active { background: rgba(255,255,255,.30); }
.sp-title {
  flex: 1;
  font: 700 17px/1.2 'Plus Jakarta Sans', sans-serif;
  color: white; letter-spacing: -0.3px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.sp-topbar-spacer { width: 36px; flex-shrink: 0; }

/* "Modifier la recherche" pill */
.sp-edit-pill {
  display: flex; align-items: center; gap: 8px;
  background: rgba(255,255,255,.14);
  border: 1px solid rgba(255,255,255,.22);
  border-radius: 20px;
  padding: 9px 14px;
  cursor: pointer;
  font: 500 13px/1 'Inter Tight', sans-serif;
  color: rgba(255,255,255,.88);
  width: 100%;
  transition: background .15s;
}
.sp-edit-pill:active { background: rgba(255,255,255,.24); }

/* Scrollable results body */
.sp-body {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  background: var(--bg);
  padding: 14px 12px calc(80px + env(safe-area-inset-bottom, 0px));
}

/* Compteur de résultats (injecté par JS inline style) */
#search-results > p {
  font: 500 13px/1.4 'Inter Tight', sans-serif !important;
  color: var(--fg-subtle) !important;
  margin-bottom: 10px !important;
}

/* ═══════════════════ PAGE TRAJETS ═══════════════════ */
#page-trajets .header { /* inherits .header */ }

/* ═══════════════════ PAGE COMPTE ═══════════════════ */
/* Welcome screen (not logged in) */
#welcome-form .card {
  margin-top: 24px;
  border-radius: var(--radius);
}

/* Help section */
#page-compte > div:last-of-type > div {
  background: var(--surface-2);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}
