/* ===== InterviewLab — shared design tokens & components ===== */

:root {
  --bg: oklch(0.99 0.003 250);
  --surface: oklch(1 0 0);
  --ink: oklch(0.22 0.02 255);
  --ink-soft: oklch(0.46 0.02 255);
  --ink-faint: oklch(0.63 0.015 255);
  --line: oklch(0.9 0.008 255);
  --line-soft: oklch(0.94 0.006 255);
  --brand: oklch(0.42 0.135 255);
  --brand-hover: oklch(0.36 0.14 255);
  --brand-soft: oklch(0.94 0.03 255);
  --teal: oklch(0.58 0.1 180);
  --teal-text: oklch(0.36 0.09 180);
  --teal-soft: oklch(0.94 0.04 180);
  --amber: oklch(0.78 0.14 85);
  --amber-text: oklch(0.42 0.12 75);
  --amber-soft: oklch(0.96 0.05 90);

  /* Fluid horizontal page padding: 16px on phones up to 64px on desktop */
  --page-pad: clamp(16px, 5vw, 64px);
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  font-family: 'Public Sans', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  margin: 0;
}

a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-hover); }

button { font-family: inherit; cursor: pointer; border: none; background: none; }
input { font-family: inherit; }

img, svg { display: block; }

/* ---------- Layout shells ---------- */

.site-header {
  height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 64px;
  border-bottom: 1px solid var(--line);
  background: #fff;
  position: sticky;
  top: 0;
  z-index: 30;
}

.brand-mark {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-mark .brand-logo {
  height: 34px;
  width: auto;
  display: block;
}

.main-nav { display: flex; align-items: center; gap: 26px; }
.main-nav a {
  font-size: 14px; font-weight: 600; color: var(--ink-soft);
}
.main-nav a.active { color: var(--brand); }

.header-actions { display: flex; align-items: center; gap: 18px; }

.dashboard-shell { display: flex; min-height: 100vh; }

.sidebar {
  width: 260px; flex: none; background: #fff;
  border-right: 1px solid var(--line);
  padding: 26px 18px; display: flex; flex-direction: column; gap: 26px;
  position: sticky; top: 0; height: 100vh;
}

.sidebar-profile {
  display: flex; align-items: center; gap: 12px;
  padding: 12px; background: var(--bg); border-radius: 12px;
}

.dashboard-main { flex: 1; min-width: 0; }

.dashboard-topbar {
  height: 76px; border-bottom: 1px solid var(--line); background: #fff;
  display: flex; align-items: center; justify-content: space-between; padding: 0 40px;
}

.dashboard-content { padding: 32px 40px 60px; max-width: 1280px; }

/* ---------- Buttons ---------- */

.btn-primary {
  background: var(--brand); color: #fff;
  padding: 11px 20px; border-radius: 9px;
  font-weight: 700; font-size: 14px; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  transition: background .15s;
}
.btn-primary:hover { background: var(--brand-hover); color: #fff; }

.btn-outline {
  background: #fff; color: var(--brand); border: 1.5px solid var(--brand);
  padding: 9px 18px; border-radius: 9px; font-weight: 600; font-size: 13.5px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
}
.btn-outline:hover { background: var(--brand-soft); color: var(--brand); }

.btn-line {
  color: var(--ink-soft); border: 1.5px solid var(--line);
  padding: 8.5px 16px; border-radius: 8px; font-weight: 600; font-size: 13px;
  display: inline-flex; align-items: center; justify-content: center;
}
.btn-line:hover { background: var(--line-soft); color: var(--ink-soft); }

.btn-ghost {
  color: var(--ink-soft); padding: 13px 18px; border-radius: 9px;
  font-weight: 600; font-size: 14.5px;
}
.btn-ghost:hover { background: var(--line-soft); }

/* ---------- Chips / badges ---------- */

.chip {
  padding: 8px 16px; border-radius: 100px; font-size: 13.5px; font-weight: 600;
  border: 1.5px solid var(--line); color: var(--ink-soft); background: #fff; white-space: nowrap;
}
.chip:hover { border-color: var(--brand); color: var(--brand); }
.chip.active { background: var(--brand); border-color: var(--brand); color: #fff; }

.option {
  padding: 12px 18px; border-radius: 11px; border: 1.5px solid var(--line);
  font-size: 14px; font-weight: 600; color: var(--ink-soft); background: #fff; text-align: left;
}
.option:hover { border-color: var(--brand); }
.option.active { border-color: var(--brand); background: var(--brand-soft); color: var(--brand); }

.badge {
  padding: 4px 10px; border-radius: 6px; font-size: 11.5px; font-weight: 700; display: inline-block;
}
.badge.amber { background: var(--amber-soft); color: var(--amber-text); }
.badge.teal { background: var(--teal-soft); color: var(--teal-text); }
.badge.brand { background: var(--brand-soft); color: var(--brand); }
.badge.neutral { background: var(--line-soft); color: var(--ink-soft); }

/* ---------- Cards ---------- */

.card {
  background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 22px;
  display: flex; flex-direction: column; gap: 14px;
  transition: box-shadow .15s;
}
.card:hover { box-shadow: 0 8px 24px oklch(0.2 0.03 255 / 0.08); }

.avatar {
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-family: 'Plus Jakarta Sans', sans-serif; font-weight: 800; flex: none;
}

/* ---------- Tabs ---------- */

.tabs { display: flex; gap: 28px; border-bottom: 1px solid var(--line); }
.tab {
  padding: 14px 4px; font-size: 14.5px; font-weight: 700; color: var(--ink-faint);
  border-bottom: 2.5px solid transparent;
}
.tab.active { color: var(--brand); border-bottom-color: var(--brand); }

/* ---------- Nav (sidebar) items ---------- */

.navitem {
  display: flex; align-items: center; gap: 11px; padding: 11px 14px; border-radius: 9px;
  font-size: 14px; font-weight: 600; color: var(--ink-soft); width: 100%; text-align: left;
}
.navitem:hover { background: var(--bg); }
.navitem.active { background: var(--brand-soft); color: var(--brand); }
.navitem svg { flex: none; }

/* ---------- Misc ---------- */

.metric-tile, .stat-tile {
  background: var(--bg); border: 1px solid var(--line-soft); border-radius: 14px;
  padding: 18px; display: flex; flex-direction: column; gap: 4px;
}

.panel { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 32px; }

.icon-btn { display: inline-flex; align-items: center; justify-content: center; }

.avail-cell { border-radius: 8px; height: 38px; font-size: 11px; font-weight: 700; flex: 1; }
.avail-cell.on { background: var(--teal-soft); color: var(--teal-text); }
.avail-cell.off { background: var(--line-soft); color: var(--ink-faint); }

::selection { background: var(--brand-soft); color: var(--brand); }

/* ---------- Accessibility ---------- */

a:focus-visible, button:focus-visible, input:focus-visible,
select:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ---------- Empty states ---------- */

.empty-state {
  display: flex; flex-direction: column; align-items: center; text-align: center;
  gap: 10px; padding: 56px 24px; border: 1.5px dashed var(--line); border-radius: 16px;
  color: var(--ink-faint);
}
.empty-state svg { color: var(--line); }
.empty-state .empty-title { font-size: 14.5px; font-weight: 700; color: var(--ink-soft); }
.empty-state .empty-desc { font-size: 13px; max-width: 320px; line-height: 1.5; }

/* ---------- Student Feedback / trust section (Module 9 — homepage) ---------- */

.testimonial-card {
  background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 22px;
  display: flex; flex-direction: column; gap: 12px; position: relative;
}
.testimonial-quote-mark {
  font-family: 'Plus Jakarta Sans', sans-serif; font-weight: 800; font-size: 40px; line-height: 1;
  color: var(--brand-soft); position: absolute; top: 14px; right: 18px;
}
.testimonial-text {
  font-size: 14px; line-height: 1.6; color: var(--ink-soft); margin: 0;
  display: -webkit-box; -webkit-line-clamp: 5; -webkit-box-orient: vertical; overflow: hidden;
}

/* ---------- Star rating input (Module 9 — student ratings) ---------- */

.star-input { display: inline-flex; gap: 3px; }
.star-input button {
  padding: 3px; border-radius: 6px; line-height: 0;
  transition: transform .1s;
}
.star-input button:hover { transform: scale(1.12); }
.star-input.readonly { gap: 2px; }
.star-input.readonly span { padding: 1px; line-height: 0; }

/* ---------- Messaging (Module 21 — student-interviewer chat) ---------- */

.msg-list { display: flex; flex-direction: column; gap: 16px; }
.msg-row { display: flex; gap: 10px; max-width: 100%; }
.msg-row.mine { flex-direction: row-reverse; }
.msg-bubble-wrap { display: flex; flex-direction: column; max-width: 78%; }
.msg-row.mine .msg-bubble-wrap { align-items: flex-end; }
.msg-row.theirs .msg-bubble-wrap { align-items: flex-start; }
.msg-bubble {
  padding: 10px 14px; border-radius: 14px; font-size: 13.5px; line-height: 1.55;
  word-break: break-word;
}
.msg-row.theirs .msg-bubble { background: var(--line-soft); color: var(--ink); border-bottom-left-radius: 4px; }
.msg-row.mine .msg-bubble { background: var(--brand); color: #fff; border-bottom-right-radius: 4px; }
.msg-meta { font-size: 11px; color: var(--ink-faint); margin-top: 5px; padding: 0 2px; }
.msg-attachment {
  display: flex; align-items: center; gap: 7px; margin-top: 8px;
  padding: 7px 12px; border-radius: 9px; font-size: 12px; font-weight: 600;
}
.msg-row.theirs .msg-attachment { background: #fff; color: var(--ink-soft); border: 1px solid var(--line); }
.msg-row.mine .msg-attachment { background: oklch(1 0 0 / 0.16); color: #fff; }

.msg-composer {
  display: flex; gap: 10px; align-items: flex-end;
  padding-top: 16px; border-top: 1px solid var(--line-soft);
}
.msg-composer textarea {
  flex: 1; min-width: 0; resize: none; padding: 11px 14px; border: 1.5px solid var(--line);
  border-radius: 11px; font-size: 13.5px; font-family: inherit; line-height: 1.5;
}
.msg-composer textarea:focus { outline: none; border-color: var(--brand); }
.msg-composer-actions { display: flex; gap: 8px; flex: none; }

.msg-quick-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 2px; }

/* ---------- Sidebar nav (extracted so mobile media queries can retarget it) ---------- */

.sidebar-nav { display: flex; flex-direction: column; gap: 4px; }
.sidebar-bottom-link { margin-top: auto; padding: 0 6px; }

/* ---------- Responsive: tablet & below ---------- */

@media (max-width: 860px) {
  /* The site header is a fixed-height flex row with no wrap, which is fine
     for the two short logged-out links (Log In / Sign Up) but not for the
     logged-in state home.js swaps in ("Hi, <name>" + Dashboard + Log Out) —
     that's noticeably wider and, combined with .main-nav's four links still
     showing at this width, overflowed the header horizontally (visible only
     when logged in, since the logged-out header never got wide enough to
     trigger it). Let it wrap and grow, same fix already used for
     .dashboard-topbar below. */
  .site-header { flex-wrap: wrap; height: auto; min-height: 76px; padding-top: 14px; padding-bottom: 14px; row-gap: 10px; }

  .dashboard-shell { flex-direction: column; }

  .sidebar {
    position: static; width: 100%; height: auto;
    flex-direction: row; align-items: center; gap: 16px;
    padding: 12px var(--page-pad);
  }
  .sidebar-profile { display: none; }
  .sidebar-nav { flex-direction: row; gap: 6px; flex: 1; min-width: 0; overflow-x: auto; }
  .navitem { white-space: nowrap; flex: none; }
  .sidebar-bottom-link { display: none; }

  .dashboard-topbar { padding: 0 var(--page-pad); flex-wrap: wrap; gap: 10px; height: auto; min-height: 76px; padding-top: 14px; padding-bottom: 14px; }
  .dashboard-content { padding: 24px var(--page-pad) 48px; }
}

/* ---------- Responsive: phones ---------- */

@media (max-width: 640px) {
  /* left/right only (not the `padding` shorthand) so this doesn't clobber
     the top/bottom padding + wrap fix set at the 860px breakpoint above */
  .site-header { padding-left: var(--page-pad); padding-right: var(--page-pad); }
  .main-nav { display: none; }

  h1 { font-size: clamp(24px, 7vw, 32px) !important; }

  .profile-header {
    align-items: flex-start !important;
    margin-top: -34px !important;
  }
  .profile-header > .avatar {
    width: 76px !important; height: 76px !important; font-size: 22px !important;
  }
}
