/* =========================================================================
   Tutok — Tutors list + Tutor profile screen styles
   Owned by the tutors screen agent. All classes prefixed `tt-` to avoid
   collisions. Shared component classes (.tutor-card, .chip, .seg, .review,
   .tier-pill, .footer-cta, etc.) are styled in components.css — only add
   screen-specific composition + flourishes here. Everything consumes tokens.
   ========================================================================= */

/* =========================================================================
   TUTORS LIST
   ========================================================================= */

/* The whole list screen is flush so the sticky config bar can span edge-to-edge.
   Inner content gets its own horizontal padding. */
.tt-list { padding: 0 0 var(--s-6); }
.tt-list__pad { padding: 0 var(--s-4); }

/* ---- Sticky config region (mode + when/level) ----------------------------
   Sits under the appbar. Frosted so cards scroll behind it cleanly. */
.tt-config {
  position: sticky;
  top: 0;
  z-index: 20;
  padding: var(--s-2) var(--s-4) var(--s-3);
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: blur(14px) saturate(1.4);
  -webkit-backdrop-filter: blur(14px) saturate(1.4);
  border-bottom: 1px solid var(--line);
}
.tt-config__seg { margin-bottom: var(--s-3); }

/* Row of quick pills (When / Level) — token-shaped buttons */
.tt-quick { display: flex; gap: var(--s-2); }
.tt-quick__btn {
  flex: 1 1 0;
  display: flex;
  align-items: center;
  gap: var(--s-2);
  min-height: 46px;
  padding: var(--s-2) var(--s-3);
  border-radius: var(--r-md);
  background: var(--surface);
  box-shadow: var(--sh-inset);
  text-align: left;
  transition: transform var(--dur-fast) var(--ease),
              box-shadow var(--dur-fast) var(--ease),
              background var(--dur-fast) var(--ease);
}
.tt-quick__btn:hover { background: var(--surface-2); box-shadow: var(--sh-1); }
.tt-quick__btn:active { transform: scale(.98); }
.tt-quick__icon {
  flex: 0 0 auto;
  width: 30px; height: 30px;
  display: grid; place-items: center;
  border-radius: var(--r-sm);
  background: var(--brand-soft);
  color: var(--brand);
}
.tt-quick__icon svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.tt-quick__body { flex: 1 1 auto; min-width: 0; }
.tt-quick__label {
  display: block;
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--muted);
  line-height: 1.2;
}
.tt-quick__value {
  display: block;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--fs-sm);
  color: var(--ink);
  line-height: 1.25;
  margin-top: 1px;
}
.tt-quick__value .truncate { display: block; }
.tt-quick__chev { flex: 0 0 auto; color: var(--muted); display: inline-flex; }
.tt-quick__chev svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ---- Tier selector ------------------------------------------------------- */
.tt-tier { margin-top: var(--s-4); }
.tt-tier__chips { padding: var(--s-1) var(--s-4) 0; }
/* Each tier chip carries a little price-level meter ($, $$, $$$) */
.tt-tierchip__price {
  display: inline-flex;
  align-items: center;
  gap: 1.5px;
  margin-left: 2px;
}
.tt-tierchip__dot {
  width: 4px; height: 4px;
  border-radius: 50%;
  background: currentColor;
  opacity: .28;
}
.tt-tierchip__dot.is-on { opacity: 1; }

/* Active-tier tagline strip — explains the selected band */
.tt-tier__hint {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  margin: var(--s-3) var(--s-4) 0;
  padding: var(--s-2) var(--s-3);
  border-radius: var(--r-md);
  background: var(--brand-soft);
  color: var(--brand-ink);
}
.tt-tier__hint-emoji {
  flex: 0 0 auto;
  width: 26px; height: 26px;
  display: grid; place-items: center;
  border-radius: var(--r-sm);
  background: color-mix(in srgb, var(--surface) 65%, transparent);
  font-size: 1rem;
}
.tt-tier__hint-text {
  font-size: var(--fs-sm);
  font-weight: 600;
  line-height: 1.35;
}
.tt-tier__hint-text strong { font-weight: 800; }

/* ---- Sort row ------------------------------------------------------------ */
.tt-sort {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  margin: var(--s-4) 0 var(--s-1);
  padding: 0 var(--s-4);
}
.tt-sort__label {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: var(--fs-xs);
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--muted);
}
.tt-sort__label svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.tt-sort__chips {
  display: flex;
  gap: var(--s-2);
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  padding-bottom: var(--s-1);
  margin-left: -2px;
}
.tt-sort__chips::-webkit-scrollbar { display: none; }
.tt-sort__chips > * { flex: 0 0 auto; }

/* ---- Result count -------------------------------------------------------- */
.tt-count {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--s-3);
  margin: var(--s-4) var(--s-4) var(--s-3);
}
.tt-count__num {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: var(--fs-h3);
  color: var(--ink);
}
.tt-count__num span { color: var(--muted); font-weight: 700; }
.tt-count__mode {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: var(--fs-xs);
  font-weight: 700;
  color: var(--brand-ink);
  background: var(--brand-soft);
  padding: 4px 10px;
  border-radius: var(--r-pill);
}
.tt-count__mode svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ---- The card list ------------------------------------------------------- */
.tt-results {
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
  padding: 0 var(--s-4);
}
/* Gentle staggered entrance for the cards */
.tt-results > * {
  animation: ttCardIn var(--dur-slow) var(--ease) both;
}
.tt-results > *:nth-child(1) { animation-delay: 0ms; }
.tt-results > *:nth-child(2) { animation-delay: 40ms; }
.tt-results > *:nth-child(3) { animation-delay: 80ms; }
.tt-results > *:nth-child(4) { animation-delay: 120ms; }
.tt-results > *:nth-child(5) { animation-delay: 160ms; }
.tt-results > *:nth-child(n+6) { animation-delay: 200ms; }
@keyframes ttCardIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
  .tt-results > * { animation: none; }
}

/* =========================================================================
   TUTOR PROFILE
   ========================================================================= */
.tt-profile { padding: 0 0 var(--s-7); }

/* The header floats over the gradient hero, so give it light controls */
.tt-profile__appbar {
  position: relative;
  z-index: 3;
}

/* ---- Hero --------------------------------------------------------------- */
.tt-hero {
  position: relative;
  margin-top: calc(var(--bar-h) * -1 - var(--s-2));
  padding: calc(var(--bar-h) + var(--s-5)) var(--s-4) var(--s-6);
  background:
    radial-gradient(120% 80% at 12% -10%, rgba(255,255,255,.22), transparent 55%),
    var(--grad-brand);
  color: #fff;
  text-align: center;
  overflow: hidden;
}
/* soft decorative orb */
.tt-hero::after {
  content: "";
  position: absolute;
  right: -22%;
  bottom: -48%;
  width: 70%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(50% 50% at 50% 50%, rgba(255,255,255,.28), transparent 70%);
  pointer-events: none;
}
.tt-hero__avatar {
  position: relative;
  display: inline-grid;
  place-items: center;
  margin-bottom: var(--s-3);
}
/* override the helper's brand ring with a white ring on the gradient */
.tt-hero__avatar .avatar--ring {
  box-shadow: 0 0 0 4px rgba(255,255,255,.9), 0 12px 30px rgba(20,18,31,.28);
}
/* "Online now" status badge over the avatar */
.tt-hero__status {
  position: absolute;
  right: 50%;
  bottom: 2px;
  transform: translateX(58px);
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px 4px 8px;
  border-radius: var(--r-pill);
  background: var(--surface);
  color: var(--success);
  font-size: var(--fs-xs);
  font-weight: 800;
  box-shadow: var(--sh-2);
}
.tt-hero__status-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 3px var(--success-soft);
}
.tt-hero__name-row {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  justify-content: center;
}
.tt-hero__name {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: var(--fs-h1);
  letter-spacing: -.02em;
  color: #fff;
  line-height: 1.1;
}
.tt-hero__verify {
  display: inline-flex;
  flex: 0 0 auto;
  color: #fff;
}
.tt-hero__verify svg { width: 22px; height: 22px; filter: drop-shadow(0 1px 2px rgba(20,18,31,.25)); }
.tt-hero__headline {
  font-size: var(--fs-body);
  font-weight: 700;
  color: rgba(255,255,255,.95);
  margin-top: var(--s-2);
}
.tt-hero__school {
  font-size: var(--fs-sm);
  font-weight: 600;
  color: rgba(255,255,255,.78);
  margin-top: 2px;
}
.tt-hero__langs {
  display: inline-flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  margin-top: var(--s-3);
}
.tt-hero__lang {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: var(--r-pill);
  background: rgba(255,255,255,.18);
  color: #fff;
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: .01em;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

/* ---- Stat strip — overlaps the hero bottom on a white card ------------- */
.tt-stats {
  position: relative;
  z-index: 3;
  margin: calc(var(--s-5) * -1) var(--s-4) 0;
  padding: var(--s-3) var(--s-2);
  background: var(--surface);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-2);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
}
.tt-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: var(--s-1) 2px;
  text-align: center;
  position: relative;
}
.tt-stat + .tt-stat::before {
  content: "";
  position: absolute;
  left: 0; top: 50%;
  transform: translateY(-50%);
  height: 60%;
  width: 1px;
  background: var(--line);
}
.tt-stat__value {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: var(--fs-h3);
  color: var(--ink);
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
  display: inline-flex;
  align-items: center;
  gap: 3px;
}
.tt-stat__value svg { width: 15px; height: 15px; }
.tt-stat__value--star { color: var(--star); }
.tt-stat__label {
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: .02em;
  text-transform: uppercase;
  color: var(--muted);
  line-height: 1.2;
}

/* ---- Generic profile body section -------------------------------------- */
.tt-body { padding: 0 var(--s-4); }
.tt-section { margin-top: var(--s-5); }
.tt-section__title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--fs-h3);
  letter-spacing: -.01em;
  color: var(--ink);
  margin-bottom: var(--s-3);
}
.tt-bio {
  font-size: var(--fs-body);
  color: var(--ink-soft);
  line-height: var(--lh-body);
}

/* Badge / chip clusters */
.tt-chiprow { display: flex; flex-wrap: wrap; gap: var(--s-2); }
/* Non-interactive subject/level chips: look like the chip but no hover lift */
.tt-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  padding: 6px 13px;
  border-radius: var(--r-pill);
  background: var(--surface-2);
  color: var(--ink-soft);
  font-weight: 700;
  font-size: var(--fs-sm);
}
.tt-tag__emoji { font-size: 1.05em; line-height: 1; }

/* ---- Rate card ---------------------------------------------------------- */
.tt-rate {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  padding: var(--s-4);
  border-radius: var(--r-lg);
  background: var(--surface);
  box-shadow: var(--sh-1);
  position: relative;
  overflow: hidden;
}
.tt-rate::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 4px;
  background: var(--grad-brand);
}
.tt-rate__body { flex: 1 1 auto; min-width: 0; }
.tt-rate__top { display: flex; align-items: center; gap: var(--s-2); flex-wrap: wrap; }
.tt-rate__amount {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: var(--fs-h1);
  letter-spacing: -.02em;
  color: var(--brand-ink);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.tt-rate__unit { font-size: var(--fs-sm); color: var(--muted); font-weight: 700; }
.tt-rate__note {
  font-size: var(--fs-sm);
  color: var(--ink-soft);
  font-weight: 500;
  margin-top: var(--s-2);
  display: flex;
  align-items: center;
  gap: 6px;
}
.tt-rate__note svg { width: 15px; height: 15px; color: var(--success); flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.tt-rate__slot { color: var(--ink); font-weight: 700; }

/* ---- Reviews ------------------------------------------------------------ */
.tt-reviews {
  background: var(--surface);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-1);
  padding: 0 var(--s-4);
}
.tt-reviews .review:first-child { padding-top: var(--s-3); }
.tt-reviews .review:last-child { padding-bottom: var(--s-4); }

/* Rating summary header above the reviews */
.tt-revhead {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  margin-bottom: var(--s-3);
}
.tt-revhead__big {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: var(--fs-display);
  letter-spacing: -.03em;
  color: var(--ink);
  line-height: 1;
}
.tt-revhead__meta { display: flex; flex-direction: column; gap: 3px; }
.tt-revhead__count { font-size: var(--fs-sm); color: var(--muted); font-weight: 600; }

.tt-noreviews {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  padding: var(--s-4);
  border-radius: var(--r-lg);
  background: var(--surface-2);
  color: var(--ink-soft);
  font-size: var(--fs-sm);
  font-weight: 600;
}
.tt-noreviews__emoji {
  flex: 0 0 auto;
  width: 40px; height: 40px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--brand-soft);
  font-size: 1.25rem;
}

/* ---- Sticky footer extras (uses shared .footer-cta) -------------------- */
.tt-footer__cta { flex: 1 1 auto; }

/* =========================================================================
   Responsive — keep everything readable on small + large frames
   ========================================================================= */
@media (max-width: 360px) {
  .tt-stat__value { font-size: var(--fs-body); }
  .tt-stat__label { font-size: 0.5625rem; }
  .tt-quick__value { font-size: var(--fs-xs); }
}
