/* ── ZITLAS Nutritionist Marketplace — coaches.css ── */

/* ─── CSS Variables ──────────────────────────────────────────────── */
:root {
  --primary:      var(--primary);
  --primary-dark: var(--primary-dark);
  --bg:           var(--bg-primary);
  --surface:      var(--bg-card-light);
  --surface2:     var(--border);
  --border:       var(--border);
  --text:         var(--text-primary);
  --text-muted:   var(--text-muted);
  --text-dim:     var(--text-muted);
  --green:        var(--success);
  --yellow:       var(--primary-hover);
  --radius:       16px;
  --radius-sm:    10px;
  --shadow:       0 2px 12px rgba(var(--black-rgb),.45);
  --nav-h:        72px;
  --header-h:     65px;
}
@media (min-width: 768px) {
  :root { --header-h: 75px; }
}
@media (min-width: 1024px) {
  :root { --header-h: 90px; }
}

/* ─── Reset ─────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body {
  height: 100%;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* ─── Drawer Overlay ─────────────────────────────────────────────── */
.drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(var(--black-rgb),.6);
  z-index: 800;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s ease;
}
.drawer-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

/* ─── Side Drawer ────────────────────────────────────────────────── */
.side-drawer {
  position: fixed;
  top: 0;
  left: -100%;
  width: min(320px, 88vw);
  height: 100%;
  background: var(--surface);
  border-right: 1px solid var(--border);
  z-index: 900;
  display: flex;
  flex-direction: column;
  transition: left .28s cubic-bezier(.4,0,.2,1);
  overflow: hidden;
}
.side-drawer.open { left: 0; }

.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px 16px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.drawer-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
}
.drawer-close-btn {
  background: var(--surface2);
  border: none;
  color: var(--text-muted);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s;
}
.drawer-close-btn:hover { background: var(--border); }

.drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.drawer-section {}
.drawer-section-label {
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.drawer-pill-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.drawer-pill {
  background: var(--surface2);
  border: 1.5px solid var(--border);
  color: var(--text-muted);
  border-radius: 20px;
  padding: 6px 14px;
  font-size: .82rem;
  font-weight: 500;
  cursor: pointer;
  transition: all .15s;
}
.drawer-pill:hover { border-color: var(--primary); color: var(--primary); }
.drawer-pill.active {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--text-primary);
  font-weight: 600;
}

.drawer-earnings {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px;
}
.drawer-earnings-icon { font-size: 1.3rem; flex-shrink: 0; }
.drawer-earnings-title {
  font-size: .82rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}
.drawer-earnings-desc {
  font-size: .75rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.drawer-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}
.drawer-apply-btn {
  width: 100%;
  background: var(--primary);
  color: var(--text-primary);
  border: none;
  border-radius: var(--radius-sm);
  padding: 13px;
  font-size: .95rem;
  font-weight: 700;
  cursor: pointer;
  transition: background .15s;
}
.drawer-apply-btn:hover { background: var(--primary-dark); }

/* ─── Header ─────────────────────────────────────────────────────── */
.coaches-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}
.logo-text {
  height: 42px;
  width: auto;
  object-fit: contain;
}
@media (min-width: 768px) {
  .logo-text { height: 50px; }
}
@media (min-width: 1024px) {
  .logo-text { height: 60px; }
}
.icon-btn {
  background: none;
  border: none;
  color: var(--text);
  cursor: pointer;
  padding: 8px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s;
}
.icon-btn:hover { background: var(--surface2); }

.notif-wrap { position: relative; }
.notif-dot {
  position: absolute;
  top: 1px;
  right: 1px;
  width: 7px;
  height: 7px;
  background: var(--primary);
  border-radius: 50%;
  border: 1.5px solid var(--bg);
}

/* ─── Page Title Block ───────────────────────────────────────────── */
.page-title-block {
  padding: 18px 16px 0;
}
/* Sits directly on the homebg.png photo — soft halo for legibility. */
.page-heading {
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--text);
  line-height: 1.2;
  text-shadow: 0 1px 8px rgba(244,247,237,0.7);
}
.page-subheading {
  font-size: .78rem;
  color: var(--text-muted);
  margin-top: 4px;
  text-shadow: 0 1px 6px rgba(244,247,237,0.85);
}

/* ─── Main Content ───────────────────────────────────────────────── */
.main-content {
  padding: 14px 0 calc(var(--nav-h) + env(safe-area-inset-bottom, 0px) + 30px);
}

/* ─── Search ─────────────────────────────────────────────────────── */
.search-row {
  padding: 0 16px 12px;
}
.search-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 12px;
  padding: 10px 14px;
  transition: border-color .15s;
}
.search-bar:focus-within { border-color: var(--primary); }
.search-icon { color: var(--text-muted); flex-shrink: 0; }
.search-input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: var(--text);
  font-size: .9rem;
}
.search-input::placeholder { color: var(--text-dim); }
.search-clear-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 2px;
  display: flex;
  align-items: center;
  border-radius: 50%;
}
.search-clear-btn:hover { color: var(--text); }

/* ─── Filter Pills ───────────────────────────────────────────────── */
.categories-outer {
  overflow: hidden;
  padding: 0 0 0 16px;
  margin-bottom: 10px;
}
.categories-scroll {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 8px;
  padding-right: 16px;
  scrollbar-width: none;
}
.categories-scroll::-webkit-scrollbar { display: none; }

.cat-pill {
  display: flex;
  align-items: center;
  gap: 5px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  color: var(--text-muted);
  border-radius: 20px;
  padding: 7px 14px;
  font-size: .8rem;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  flex-shrink: 0;
  transition: all .15s;
}
.cat-pill:hover { border-color: var(--primary); color: var(--primary); }
.cat-pill.active {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--text-primary);
  font-weight: 600;
}
.cat-pill svg { flex-shrink: 0; }
.cat-icon { font-size: .9rem; }

/* ─── Results Row ────────────────────────────────────────────────── */
.results-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px 10px;
}
.results-count {
  font-size: .78rem;
  font-weight: 600;
  color: var(--text-muted);
}
.sort-toggle-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  color: var(--text-muted);
  border-radius: 8px;
  padding: 6px 12px;
  font-size: .78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all .15s;
}
.sort-toggle-btn:hover { border-color: var(--primary); color: var(--primary); }

/* ─── Nutritionist Cards ─────────────────────────────────────────── */
.all-coaches-section { padding: 0 16px; }

.coaches-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.nutri-card {
  display: flex;
  gap: 14px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  cursor: pointer;
  transition: border-color .18s, box-shadow .18s, transform .15s;
  outline: none;
  position: relative;
  overflow: hidden;
}
.nutri-card:hover,
.nutri-card:focus-visible {
  border-color: var(--primary);
  box-shadow: 0 4px 20px rgba(var(--primary-rgb),.12);
  transform: translateY(-1px);
}
.nutri-card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  width: 3px;
  height: 100%;
  background: var(--primary);
  opacity: 0;
  transition: opacity .18s;
}
.nutri-card:hover::before,
.nutri-card:focus-visible::before { opacity: 1; }

/* Avatar */
.nutri-left { flex-shrink: 0; }
.nutri-avatar-wrap {
  position: relative;
  width: 60px;
  height: 60px;
}
.nutri-avatar {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}
.nutri-avatar-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}
.nutri-initials {
  font-size: 1.1rem;
  font-weight: 800;
  z-index: 1;
  pointer-events: none;
  /* shown only if image fails via onerror */
}
.avail-dot {
  position: absolute;
  bottom: 2px;
  right: 2px;
  width: 12px;
  height: 12px;
  background: var(--green);
  border-radius: 50%;
  border: 2px solid var(--surface);
  z-index: 2;
}

/* Card body */
.nutri-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.nutri-name-row {
  display: flex;
  align-items: center;
  gap: 6px;
}
.nutri-name {
  font-size: .98rem;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.verified-icon { flex-shrink: 0; }
.nutri-role {
  font-size: .78rem;
  color: var(--text-muted);
  font-weight: 500;
}

.nutri-rating-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 2px;
}
.n-star { color: var(--yellow); font-size: .85rem; }
.n-score { font-size: .82rem; font-weight: 700; color: var(--text); }
.n-reviews, .n-exp, .n-lang { font-size: .73rem; color: var(--text-muted); }
.n-sep { color: var(--text-dim); font-size: .72rem; }

.nutri-avail-row { margin-top: 4px; }
.avail-tag {
  display: inline-flex;
  align-items: center;
  border-radius: 6px;
  padding: 3px 8px;
  font-size: .7rem;
  font-weight: 600;
}
.avail-tag--now {
  background: rgba(var(--success-rgb),.12);
  color: var(--green);
}
.avail-tag--later {
  background: rgba(234,179,8,.1);
  color: var(--yellow);
}

/* Fee row (legacy — kept only for the empty-state "Become an Expert" link
   and any code path that hasn't been migrated to .nutri-pricing-row) */
.nutri-fee-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 8px;
  gap: 8px;
}
.fee-info {
  display: flex;
  align-items: baseline;
  gap: 3px;
  flex-shrink: 0;
}
.fee-amount {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--primary);
}
.fee-duration {
  font-size: .72rem;
  color: var(--text-muted);
}

/* Ask Nutritionist button (legacy — empty-state "Become an Expert" link) */
.ask-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  background: var(--primary);
  color: var(--text-primary);
  border: none;
  border-radius: 8px;
  padding: 8px 13px;
  font-size: .78rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: background .15s, transform .1s;
  flex-shrink: 0;
}
.ask-btn:hover { background: var(--primary-dark); transform: scale(1.02); }
.ask-btn:active { transform: scale(0.98); }

/* ─── Dual pricing (Priority 2: review price vs coaching price must never
   be a single ambiguous line) ──────────────────────────────────────── */
.nutri-pricing-row {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}
.price-chip {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 7px 10px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface2);
}
.price-chip-label {
  font-size: .66rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .03em;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.price-chip-value {
  font-size: .95rem;
  font-weight: 800;
  display: flex;
  align-items: baseline;
  gap: 4px;
  white-space: nowrap;
}
.price-chip-value small {
  font-size: .68rem;
  font-weight: 600;
  color: var(--text-muted);
}
/* Review is the primary reason athletes land on this page — give it the
   brand color; coaching (a bigger, separate commitment) stays neutral so
   the two are never mistaken for the same thing at a glance. */
.price-chip--review { border-color: rgba(var(--primary-rgb),.35); }
.price-chip--review .price-chip-value { color: var(--primary); }
.price-chip--coaching .price-chip-value { color: var(--text); }

/* ─── Card action rows: Request Review (own row, most prominent — this
   page is mainly used for diet review) then Personal Coach + Chat on a
   second row. Two rows instead of cramming three buttons onto one line
   is deliberate: at a standard 390px phone width, three side-by-side
   buttons truncated "Personal Coach" to "Personal Coac…". ───────────── */
.nutri-actions-row {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}
.nutri-actions-row--primary { margin-top: 10px; }
.nutri-action-btn {
  border: none;
  border-radius: 10px;
  cursor: pointer;
  font-size: .78rem;
  font-weight: 700;
  white-space: nowrap;
  transition: filter .15s, transform .1s, background .15s;
  padding: 10px 12px;
}
.nutri-action-btn:active { transform: scale(0.97); }
.nutri-action-btn--primary {
  flex: 1;
  width: 100%;
  background: var(--primary);
  color: var(--text-primary);
}
.nutri-action-btn--primary:hover { background: var(--primary-dark); }
.nutri-action-btn--secondary {
  flex: 1;
  min-width: 0;
  background: var(--surface2);
  border: 1.5px solid var(--border);
  color: var(--text);
}
.nutri-action-btn--secondary:hover { border-color: var(--primary); color: var(--primary); }
.nutri-action-btn--chat {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface2);
  border: 1.5px solid var(--border);
  color: var(--text-muted);
}
.nutri-action-btn--chat:hover { border-color: var(--primary); color: var(--primary); }

/* Very narrow phones: stack the price chips too, so "Personal Coaching"'s
   label never competes for width with its own price. */
@media (max-width: 360px) {
  .nutri-pricing-row { flex-direction: column; }
}

/* Tablet/desktop: this page is a mobile-shell layout by default (full-
   bleed, bottom nav) — center it into a readable column instead of
   stretching cards edge-to-edge across a wide viewport. */
@media (min-width: 720px) {
  /* .page-title-block sits OUTSIDE <main class="main-content"> in the
     markup — center both to the same column width so the heading lines
     up with the search bar/cards below it instead of hugging the true
     left edge while everything else is inset. */
  .page-title-block, .main-content { max-width: 720px; margin-left: auto; margin-right: auto; }
  .nutri-card { padding: 20px; }
}

/* ─── Empty State ────────────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 48px 20px;
}
.empty-icon { font-size: 2.8rem; margin-bottom: 12px; }
.empty-heading {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
}
.empty-desc {
  font-size: .82rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* ─── Toast ──────────────────────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px) + 16px);
  left: 50%;
  transform: translateX(-50%) translateY(16px);
  background: var(--surface2);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 18px;
  font-size: .83rem;
  font-weight: 500;
  white-space: nowrap;
  pointer-events: none;
  z-index: 999;
  opacity: 0;
  transition: opacity .25s, transform .25s;
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
