/* ============================================================
   shared-header.css — Chinese Language Tutor
   Shared site header: brand, home-btn, nav dropdowns, toast
   ============================================================ */

/* ── Shared design tokens ────────────────────────────────── */
:root {
  --text: #ffffff;
}

/* ── Site header shell — full-width, frosted glass ───────── */
#site-header {
  width: 100%;
  background: rgba(10, 10, 15, 0.78);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  position: sticky;
  top: 0;
  z-index: 50;
  flex-shrink: 0;
}

/* ── Inner content — constrained width, centered ─────────── */
.site-header-inner {
  max-width: 960px;
  margin: 0 auto;
  padding: 10px 20px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
}

/* ── Brand (center cell) ─────────────────────────────────── */
.site-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: center;
}

.brand-icon {
  font-family: 'Noto Serif SC', serif;
  font-size: clamp(1.375rem, 3.125vh, 1.875rem);
  font-weight: 700;
  color: var(--t4);
  line-height: 1;
  letter-spacing: 0;
  /* subtle glow to set the icon off */
  text-shadow: 0 0 16px rgba(77, 157, 224, 0.45);
}

.brand-name {
  font-size: clamp(1.125rem, 3vh, 1.69rem);
  line-height: 1;
  white-space: nowrap;
  letter-spacing: -0.3px;
}

/* "Chinese" — bold white */
.brand-name strong {
  font-weight: 800;
  color: #ffffff;
}

/* "Tutor" — bold light blue */
.brand-name em {
  font-weight: 800;
  font-style: normal;
  color: var(--t4);
}

/* ── Home button (left cell) ─────────────────────────────── */
.home-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  background: none;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 8px;
  color: rgba(255, 255, 255, 0.6);
  font-family: 'DM Sans', sans-serif;
  font-size: clamp(10px, 1.3vh, 13px);
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  padding: clamp(5px, 0.8vh, 8px) clamp(8px, 1.4vw, 14px);
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s, background 0.2s, opacity 0.2s;
  justify-self: start;
  white-space: nowrap;
}

.home-btn:hover {
  border-color: rgba(255, 255, 255, 0.7);
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
}

/* ── Header icons (right cell) ───────────────────────────── */
.header-icons {
  display: flex;
  align-items: center;
  gap: 14px;
  justify-content: flex-end;
  z-index: 30;
  position: relative;
}

/* ── User icon button ────────────────────────────────────── */
.user-icon-wrap { position: relative; }

.user-icon-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  transition: background 0.2s, border-color 0.2s;
  color: rgba(255, 255, 255, 0.7);
}
.user-icon-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.25);
  color: #ffffff;
}

.user-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  min-width: 150px;
  z-index: 999;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
}
.user-dropdown.open { display: block; }

.user-dd-item {
  display: block;
  width: 100%;
  background: none;
  border: none;
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.85rem;
  font-weight: 500;
  padding: 11px 16px;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s;
}
.user-dd-item:hover { background: var(--border); }
.user-dd-item + .user-dd-item { border-top: 1px solid var(--border); }
.user-dd-item.logout { color: var(--t1); }
.user-dd-item.logout:hover { background: rgba(255, 107, 107, 0.12); }

/* ── Hamburger menu ──────────────────────────────────────── */
.hamburger-wrap { position: relative; z-index: 30; }

.hamburger-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  width: 36px;
  height: 36px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  cursor: pointer;
  padding: 0;
  transition: background 0.2s, border-color 0.2s;
}
.hamburger-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.25);
}
.hamburger-btn span {
  display: block;
  width: 16px;
  height: 2px;
  background: rgba(255, 255, 255, 0.75);
  border-radius: 2px;
  transition: background 0.2s;
}
.hamburger-btn:hover span { background: #ffffff; }

.hamburger-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  min-width: 150px;
  z-index: 999;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
}
.hamburger-dropdown.open { display: block; }

.hamburger-item {
  display: block;
  width: 100%;
  background: none;
  border: none;
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.85rem;
  font-weight: 500;
  padding: 11px 16px;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s;
}
.hamburger-item:hover { background: var(--border); }
.hamburger-item + .hamburger-item { border-top: 1px solid var(--border); }
.hamburger-divider {
  height: 1px;
  background: var(--border);
  margin: 4px 0;
}

/* Current page item — dimmed, non-clickable */
.hamburger-item.current-page {
  color: var(--t4);
  cursor: default;
  pointer-events: none;
  opacity: 0.65;
}

/* Home item highlighted — shown on all pages except the tone-tutor landing */
.hamburger-item.nav-home-active {
  color: var(--t4);
  font-weight: 700;
}
.hamburger-item.nav-home-active::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--t4);
  margin-right: 8px;
  vertical-align: middle;
  flex-shrink: 0;
}

/* ── Toast notification ──────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(12px);
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.85rem;
  font-weight: 500;
  padding: 10px 22px;
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  z-index: 9999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
  white-space: nowrap;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
