/* LOCATION: public/css/header.css */
/* ============================================================
   HEADER — APPLE LIQUID GLASS · PREMIUM EDITION
   Floating pill · Ambient aurora · Scroll-reactive
   ============================================================ */

/* ============================================================
   1. VARIABILE (moștenesc din base.css)
   ============================================================ */
:root {
  --header-gradient-primary: linear-gradient(135deg, #007aff 0%, #0a84ff 50%, #5ac8fa 100%);
  --header-gradient-accent:  linear-gradient(135deg, #00c7be 0%, #30d5c8 50%, #5ac8fa 100%);

  --header-glass-bg:      var(--glass-bg,     rgba(255, 255, 255, 0.55));
  --header-glass-strong:  var(--glass-strong, rgba(255, 255, 255, 0.82));
  --header-glass-border:  var(--glass-border, rgba(255, 255, 255, 0.65));
  --header-glass-highlight: var(--glass-highlight,
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    inset 0 -1px 0 rgba(255, 255, 255, 0.15));
  --header-glass-sheen: var(--glass-sheen, linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.35) 0%,
    rgba(255, 255, 255, 0.08) 45%,
    rgba(255, 255, 255, 0.04) 100%
  ));

  --header-transition:      280ms cubic-bezier(0.22, 1, 0.36, 1);
  --header-transition-fast: 180ms cubic-bezier(0.22, 1, 0.36, 1);
  --header-spring:          cubic-bezier(0.34, 1.56, 0.64, 1);
}

[data-theme="dark"] {
  --header-glass-bg:      var(--glass-bg,     rgba(28, 28, 30, 0.55));
  --header-glass-strong:  var(--glass-strong, rgba(28, 28, 30, 0.88));
  --header-glass-border:  var(--glass-border, rgba(255, 255, 255, 0.12));
  --header-glass-highlight: var(--glass-highlight,
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    inset 0 -1px 0 rgba(255, 255, 255, 0.04));
  --header-glass-sheen: var(--glass-sheen, linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.10) 0%,
    rgba(255, 255, 255, 0.03) 45%,
    rgba(255, 255, 255, 0.05) 100%
  ));
}

/* ============================================================
   2. RESET LOCAL
   ============================================================ */
.site-header *,
.site-header *::before,
.site-header *::after { box-sizing: border-box; }

/* ============================================================
   3. HEADER CONTAINER — floating pill
   ============================================================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  width: 100%;
  padding: 14px 16px;
  padding-left: max(16px, env(safe-area-inset-left, 16px));
  padding-right: max(16px, env(safe-area-inset-right, 16px));
  background: transparent;
  pointer-events: none;
  transition: padding var(--header-transition);
  isolation: isolate;
}

/* ✨ AURORA — halo ambiental în spate, se intensifică la scroll */
.site-header::before {
  content: '';
  position: absolute;
  top: -20px;
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 32px);
  max-width: 1300px;
  height: calc(100% + 40px);
  pointer-events: none;
  background:
    radial-gradient(ellipse 100% 60% at 30% 0%,
      rgba(0, 122, 255, 0.18), transparent 65%),
    radial-gradient(ellipse 100% 60% at 70% 0%,
      rgba(0, 199, 190, 0.14), transparent 65%);
  filter: blur(48px);
  opacity: 0.55;
  z-index: -1;
  transition: opacity var(--header-transition), transform var(--header-transition);
}

[data-theme="dark"] .site-header::before {
  background:
    radial-gradient(ellipse 100% 60% at 30% 0%,
      rgba(0, 122, 255, 0.30), transparent 65%),
    radial-gradient(ellipse 100% 60% at 70% 0%,
      rgba(0, 199, 190, 0.22), transparent 65%);
  opacity: 0.45;
}

/* Stare scroll — aurora devine mai intensă + header se contractă */
.site-header.is-scrolled {
  padding: 8px 16px;
  padding-left: max(16px, env(safe-area-inset-left, 16px));
  padding-right: max(16px, env(safe-area-inset-right, 16px));
}

.site-header.is-scrolled::before {
  opacity: 0.85;
  transform: translateX(-50%) translateY(-6px) scaleY(1.08);
}

[data-theme="dark"] .site-header.is-scrolled::before {
  opacity: 0.65;
}

/* ============================================================
   4. NAV — glass pill
   ============================================================ */
.site-header nav {
  pointer-events: auto;
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 20px;
  border-radius: 22px;

  background: var(--header-glass-sheen), var(--header-glass-bg);
  backdrop-filter: blur(30px) saturate(180%);
  -webkit-backdrop-filter: blur(30px) saturate(180%);
  border: 1px solid var(--header-glass-border);
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.08),
    0 2px 6px rgba(0, 0, 0, 0.04),
    var(--header-glass-highlight);

  position: relative;
  isolation: isolate;
  min-width: 0;
  transition:
    border-radius var(--header-transition),
    padding var(--header-transition),
    box-shadow var(--header-transition),
    background var(--header-transition);
}

/* Sheen overlay — reflexie diagonală */
.site-header nav::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.40) 0%,
    rgba(255, 255, 255, 0.08) 30%,
    transparent 50%,
    rgba(0, 199, 190, 0.05) 80%,
    rgba(255, 255, 255, 0.20) 100%
  );
  pointer-events: none;
  opacity: 0.75;
  mix-blend-mode: overlay;
  z-index: -1;
}

[data-theme="dark"] .site-header nav::before {
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.15) 0%,
    rgba(255, 255, 255, 0.03) 30%,
    transparent 50%,
    rgba(0, 199, 190, 0.08) 80%,
    rgba(255, 255, 255, 0.08) 100%
  );
}

/* Scroll — pill-ul se condensează */
.site-header.is-scrolled nav {
  padding: 8px 18px;
  border-radius: 18px;
  background: var(--header-glass-sheen), var(--header-glass-strong);
  box-shadow:
    0 12px 40px rgba(0, 0, 0, 0.12),
    0 3px 8px rgba(0, 0, 0, 0.06),
    var(--header-glass-highlight);
}

[data-theme="dark"] .site-header.is-scrolled nav {
  box-shadow:
    0 12px 40px rgba(0, 0, 0, 0.55),
    0 3px 8px rgba(0, 0, 0, 0.40),
    var(--header-glass-highlight);
}

.site-header nav > * { min-width: 0; }

/* Fallback backdrop-filter */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .site-header nav { background: var(--header-glass-strong); }
}

/* ============================================================
   5. LOGO — cu micro-glow pe hover
   ============================================================ */
.site-header .logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text, #1d1d1f);
  font-weight: 700;
  font-size: 17px;
  letter-spacing: -0.025em;
  transition: transform var(--header-spring);
  flex-shrink: 0;
  min-width: 0;
}

.site-header .logo:hover {
  transform: scale(1.04);
}

.site-header .logo svg,
.site-header .logo img {
  filter: drop-shadow(0 4px 14px rgba(0, 122, 255, 0.30));
  transition: filter var(--header-transition), transform var(--header-transition);
  flex-shrink: 0;
  display: block;
}

[data-theme="dark"] .site-header .logo svg,
[data-theme="dark"] .site-header .logo img {
  filter: drop-shadow(0 4px 14px rgba(90, 200, 250, 0.35));
}

.site-header .logo:hover svg,
.site-header .logo:hover img {
  filter: drop-shadow(0 6px 20px rgba(0, 122, 255, 0.55));
  transform: rotate(-3deg);
}

[data-theme="dark"] .site-header .logo:hover svg,
[data-theme="dark"] .site-header .logo:hover img {
  filter: drop-shadow(0 6px 20px rgba(90, 200, 250, 0.60));
}

.site-header .logo-text {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.site-header .logo img {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  object-fit: contain;
}

/* ============================================================
   6. NAV LINKS — active state cu glow difuz
   ============================================================ */
.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1;
  margin-left: 16px;
  min-width: 0;
  overflow: visible;
}

.nav-links a {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary, #3a3a3c);
  text-decoration: none;
  letter-spacing: -0.01em;
  white-space: nowrap;
  transition:
    background var(--header-transition-fast),
    color var(--header-transition-fast),
    box-shadow var(--header-transition-fast),
    transform var(--header-spring);
  flex-shrink: 0;
}

.nav-links a svg {
  flex-shrink: 0;
  opacity: 0.85;
  display: block;
  transition: opacity var(--header-transition-fast);
}

.nav-links a:hover {
  background: rgba(0, 122, 255, 0.10);
  color: var(--accent, #007aff);
  transform: translateY(-1px);
}

.nav-links a:hover svg { opacity: 1; }

/* Active — glow difuz + inner light */
.nav-links a.active {
  background: rgba(0, 122, 255, 0.15);
  color: var(--accent, #007aff);
  font-weight: 600;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.45),
    0 0 0 1px rgba(0, 122, 255, 0.20),
    0 4px 14px rgba(0, 122, 255, 0.15);
}

/* Sub-glow difuz sub active (Apple-style soft focus) */
.nav-links a.active::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: -6px;
  transform: translateX(-50%);
  width: 60%;
  height: 8px;
  background: radial-gradient(ellipse, rgba(0, 122, 255, 0.55), transparent 70%);
  filter: blur(6px);
  border-radius: 50%;
  pointer-events: none;
  opacity: 0.8;
}

[data-theme="dark"] .nav-links a:hover,
[data-theme="dark"] .nav-links a.active {
  background: rgba(0, 122, 255, 0.22);
  color: #5ac8fa;
}

[data-theme="dark"] .nav-links a.active::after {
  background: radial-gradient(ellipse, rgba(90, 200, 250, 0.60), transparent 70%);
}

.nav-link-text { white-space: nowrap; }

/* ============================================================
   7. BADGE — cu pulse când e unread
   ============================================================ */
.site-header .badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: linear-gradient(135deg, #ff3b30, #ff2d55);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  box-shadow:
    0 2px 6px rgba(255, 59, 48, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.30);
  flex-shrink: 0;
  position: relative;
  animation: badgePulse 2.4s ease-in-out infinite;
}

.site-header .badge::after {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: inherit;
  border: 2px solid rgba(255, 59, 48, 0.40);
  animation: badgeRing 2.4s ease-out infinite;
  pointer-events: none;
}

@keyframes badgePulse {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.06); }
}

@keyframes badgeRing {
  0%   { opacity: 0.7; transform: scale(1); }
  100% { opacity: 0; transform: scale(1.6); }
}

/* Animația se oprește la hover — userul e deja focusat */
.nav-links a:hover .badge,
.nav-links a:hover .badge::after {
  animation: none;
}

/* ============================================================
   8. NAV ACTIONS
   ============================================================ */
.nav-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  min-width: 0;
}

/* ============================================================
   9. ICON BUTTON — cu glow spring
   ============================================================ */
.site-header .btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border-radius: 999px;
  background: var(--header-glass-bg);
  border: 1px solid var(--header-glass-border);
  color: var(--text-secondary, #3a3a3c);
  cursor: pointer;
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  box-shadow:
    0 2px 8px rgba(0, 0, 0, 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 0.60);
  transition:
    transform var(--header-spring),
    box-shadow var(--header-transition-fast),
    background var(--header-transition-fast),
    color var(--header-transition-fast);
  flex-shrink: 0;
  font-family: inherit;
}

.site-header .btn-icon:hover {
  transform: translateY(-1px) scale(1.06);
  background: var(--header-glass-strong);
  color: var(--accent, #007aff);
  box-shadow:
    0 4px 16px rgba(0, 122, 255, 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 0.75);
}

.site-header .btn-icon:active {
  transform: translateY(0) scale(0.96);
}

.site-header .btn-icon svg {
  display: block;
  flex-shrink: 0;
  transition: transform var(--header-transition);
}

.site-header .btn-icon:hover svg {
  transform: rotate(15deg);
}

/* ============================================================
   10. AUTH BUTTONS
   ============================================================ */
.nav-auth-buttons {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  min-width: 0;
}

.btn-header-auth {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: -0.01em;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
  white-space: nowrap;
  flex-shrink: 0;
  font-family: inherit;
  position: relative;
  overflow: hidden;
  isolation: isolate;
  transition:
    transform var(--header-spring),
    box-shadow var(--header-transition-fast),
    background var(--header-transition-fast);
  min-width: 0;
}

.btn-header-auth svg {
  flex-shrink: 0;
  display: block;
  transition: transform var(--header-transition);
}

.btn-header-auth-primary {
  background: var(--header-gradient-primary);
  color: #fff;
  box-shadow:
    0 4px 14px rgba(0, 122, 255, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.30);
}

/* Sheen animat pe primary */
.btn-header-auth-primary::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(
    105deg,
    transparent 0%,
    transparent 40%,
    rgba(255, 255, 255, 0.35) 50%,
    transparent 60%,
    transparent 100%
  );
  transform: translateX(-100%);
  transition: transform 700ms var(--header-transition);
  pointer-events: none;
}

.btn-header-auth-primary:hover::before {
  transform: translateX(100%);
}

.btn-header-auth-primary:hover {
  transform: translateY(-1px);
  box-shadow:
    0 6px 22px rgba(0, 122, 255, 0.55),
    inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

.btn-header-auth-primary:hover svg {
  transform: translateX(2px);
}

.btn-header-auth-secondary {
  background: var(--header-glass-bg);
  color: var(--text, #1d1d1f);
  border-color: var(--header-glass-border);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  box-shadow:
    0 2px 8px rgba(0, 0, 0, 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 0.60);
}

.btn-header-auth-secondary:hover {
  transform: translateY(-1px);
  background: var(--header-glass-strong);
  box-shadow:
    0 4px 14px rgba(0, 0, 0, 0.10),
    inset 0 1px 0 rgba(255, 255, 255, 0.75);
}

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .btn-header-auth-secondary,
  .site-header .btn-icon { background: var(--header-glass-strong); }
}

/* ============================================================
   11. ⌘K CHIP — opțional, adaugă dacă vrei (vezi HTML)
   ============================================================ */
.nav-kbd {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 5px 9px;
  border-radius: 8px;
  font-family: var(--font-mono, ui-monospace, "SF Mono", monospace);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text-muted, #86868b);
  background: rgba(120, 120, 128, 0.10);
  border: 1px solid rgba(120, 120, 128, 0.18);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5);
  transition: all var(--header-transition-fast);
  cursor: pointer;
  user-select: none;
}

.nav-kbd:hover {
  background: rgba(0, 122, 255, 0.10);
  color: var(--accent, #007aff);
  border-color: rgba(0, 122, 255, 0.25);
}

[data-theme="dark"] .nav-kbd {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

/* ============================================================
   12. USER DROPDOWN
   ============================================================ */
.nav-dropdown {
  position: relative;
  flex-shrink: 0;
  min-width: 0;
}

.nav-dropdown-trigger {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px 6px 6px;
  border-radius: 999px;
  background: var(--header-glass-bg);
  border: 1px solid var(--header-glass-border);
  cursor: pointer;
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  box-shadow:
    0 2px 8px rgba(0, 0, 0, 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 0.60);
  transition:
    transform var(--header-spring),
    box-shadow var(--header-transition-fast),
    background var(--header-transition-fast);
  flex-shrink: 0;
  min-width: 0;
  font-family: inherit;
  position: relative;
}

.nav-dropdown-trigger:hover {
  transform: translateY(-1px);
  background: var(--header-glass-strong);
  box-shadow:
    0 4px 14px rgba(0, 0, 0, 0.10),
    inset 0 1px 0 rgba(255, 255, 255, 0.75);
}

.nav-dropdown-trigger .avatar-img,
.nav-dropdown-trigger .avatar-initials {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  flex-shrink: 0;
  position: relative;
}

/* Status dot online */
.nav-dropdown-trigger .avatar-img,
.nav-dropdown-trigger .avatar-initials {
  position: relative;
}

.nav-dropdown-trigger .avatar-status {
  position: absolute;
  bottom: -1px;
  right: -1px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #34c759;
  border: 2px solid var(--glass-strong, rgba(255,255,255,0.9));
  box-shadow: 0 0 0 1px rgba(52, 199, 89, 0.30);
  z-index: 1;
  animation: statusPulse 2s ease-in-out infinite;
}

[data-theme="dark"] .nav-dropdown-trigger .avatar-status {
  border-color: rgba(28, 28, 30, 0.92);
}

@keyframes statusPulse {
  0%, 100% { box-shadow: 0 0 0 1px rgba(52, 199, 89, 0.30); }
  50%      { box-shadow: 0 0 0 4px rgba(52, 199, 89, 0.10); }
}

.nav-user-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary, #3a3a3c);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 120px;
}

.nav-user-caret {
  color: var(--text-muted, #86868b);
  transition: transform var(--header-transition);
  flex-shrink: 0;
  display: block;
}

.nav-dropdown-trigger[aria-expanded="true"] .nav-user-caret {
  transform: rotate(180deg);
}

/* Dropdown menu */
.nav-dropdown-menu {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  min-width: 260px;
  max-width: calc(100vw - 32px);
  padding: 8px;
  border-radius: 20px;

  background: var(--header-glass-sheen), var(--header-glass-strong);
  backdrop-filter: blur(40px) saturate(200%);
  -webkit-backdrop-filter: blur(40px) saturate(200%);
  border: 1px solid var(--header-glass-border);
  box-shadow:
    0 16px 48px rgba(0, 0, 0, 0.20),
    0 4px 12px rgba(0, 0, 0, 0.08),
    var(--header-glass-highlight);

  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px) scale(0.96);
  transform-origin: top right;
  transition:
    opacity var(--header-transition),
    visibility var(--header-transition),
    transform var(--header-spring);
  z-index: 100;
}

.nav-dropdown-menu[data-open="true"] {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

.nav-dropdown-user {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
}

.nav-dropdown-user .avatar-img,
.nav-dropdown-user .avatar-initials {
  width: 42px;
  height: 42px;
  border-radius: 999px;
  flex-shrink: 0;
}

.nav-dropdown-user-info { min-width: 0; flex: 1; }

.nav-dropdown-user-name {
  font-weight: 600;
  font-size: 14px;
  color: var(--text, #1d1d1f);
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-dropdown-user-email {
  font-size: 12px;
  color: var(--text-muted, #86868b);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-dropdown-divider {
  height: 1px;
  background: var(--header-glass-border);
  margin: 6px 8px;
}

.nav-dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 12px;
  border-radius: 14px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary, #3a3a3c);
  text-decoration: none;
  background: transparent;
  border: 0;
  cursor: pointer;
  text-align: left;
  letter-spacing: -0.01em;
  font-family: inherit;
  transition:
    background var(--header-transition-fast),
    color var(--header-transition-fast),
    transform var(--header-transition-fast);
}

.nav-dropdown-item svg {
  flex-shrink: 0;
  opacity: 0.80;
  display: block;
}

.nav-dropdown-item:hover {
  background: rgba(0, 122, 255, 0.12);
  color: var(--accent, #007aff);
  transform: translateX(2px);
}

.nav-dropdown-item:hover svg { opacity: 1; }

.nav-dropdown-item-danger { color: #ff3b30; }
.nav-dropdown-item-danger svg { opacity: 0.90; }

.nav-dropdown-item-danger:hover {
  background: rgba(255, 59, 48, 0.12);
  color: #ff3b30;
}

.nav-dropdown-mobile-links { display: none; }
.nav-dropdown-mobile-only  { display: none; }

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .nav-dropdown-menu,
  .nav-dropdown-trigger { background: var(--header-glass-strong); }
}

/* ============================================================
   13. RESPONSIVE
   ============================================================ */

/* Tabletă (≤900px) — nav în dropdown */
@media (max-width: 900px) {
  .nav-links { display: none; }
  .nav-dropdown-mobile-links,
  .nav-dropdown-mobile-only { display: block; }

  .site-header nav {
    padding: 10px 16px;
    gap: 12px;
    backdrop-filter: blur(24px) saturate(170%);
    -webkit-backdrop-filter: blur(24px) saturate(170%);
  }
}

/* Mobil (≤700px) */
@media (max-width: 700px) {
  .nav-link-text { display: none; }
  .btn-header-auth-label { display: none; }
  .btn-header-auth { padding: 8px 10px; gap: 0; }
  .nav-kbd { display: none; }
}

/* Mobil (≤600px) */
@media (max-width: 600px) {
  .site-header {
    padding: 10px 12px;
    padding-left: max(12px, env(safe-area-inset-left, 12px));
    padding-right: max(12px, env(safe-area-inset-right, 12px));
  }

  .site-header.is-scrolled {
    padding: 6px 12px;
    padding-left: max(12px, env(safe-area-inset-left, 12px));
    padding-right: max(12px, env(safe-area-inset-right, 12px));
  }

  .site-header nav {
    padding: 8px 14px;
    border-radius: 18px;
    gap: 8px;
    backdrop-filter: blur(20px) saturate(170%);
    -webkit-backdrop-filter: blur(20px) saturate(170%);
  }

  .site-header .logo { gap: 8px; font-size: 15px; }
  .site-header .logo svg { width: 30px; height: 30px; }
  .site-header .logo img { width: 32px; height: 32px; }

  .nav-user-name,
  .nav-user-caret { display: none; }

  .nav-dropdown-trigger { padding: 4px; gap: 4px; }

  .nav-dropdown-trigger .avatar-img,
  .nav-dropdown-trigger .avatar-initials {
    width: 34px;
    height: 34px;
  }

  .nav-dropdown-menu { right: -8px; min-width: 240px; }

  .site-header .btn-icon { width: 36px; height: 36px; }
  .site-header .btn-icon svg { width: 18px; height: 18px; }

  .nav-auth-buttons { gap: 6px; }
  .btn-header-auth { padding: 7px 10px; font-size: 13px; }

  /* Aurora mai mică pe mobil */
  .site-header::before {
    filter: blur(32px);
    opacity: 0.45;
  }
}

/* Mobil (≤480px) */
@media (max-width: 480px) {
  .site-header { padding: 8px 10px; }

  .site-header nav {
    padding: 6px 12px;
    border-radius: 16px;
    backdrop-filter: blur(16px) saturate(160%);
    -webkit-backdrop-filter: blur(16px) saturate(160%);
  }

  .site-header .logo-text { display: none; }
  .site-header .logo { gap: 0; }
  .site-header .logo svg { width: 28px; height: 28px; }
  .site-header .logo img { width: 30px; height: 30px; }

  .site-header .btn-icon { width: 34px; height: 34px; }
  .site-header .btn-icon svg { width: 16px; height: 16px; }

  .nav-dropdown-trigger { padding: 3px; }
  .nav-dropdown-trigger .avatar-img,
  .nav-dropdown-trigger .avatar-initials { width: 32px; height: 32px; }

  .nav-auth-buttons { gap: 4px; }
  .btn-header-auth { padding: 6px 8px; }
  .btn-header-auth svg { width: 15px; height: 15px; }
}

@media (max-width: 400px) {
  .btn-header-auth-secondary { display: none; }
}

@media (max-width: 360px) {
  .site-header { padding: 6px 8px; }

  .site-header nav {
    padding: 5px 10px;
    border-radius: 14px;
    gap: 6px;
    backdrop-filter: blur(14px) saturate(150%);
    -webkit-backdrop-filter: blur(14px) saturate(150%);
  }

  .site-header .logo svg { width: 26px; height: 26px; }
  .site-header .logo img { width: 28px; height: 28px; }

  .site-header .btn-icon { width: 32px; height: 32px; }
  .site-header .btn-icon svg { width: 15px; height: 15px; }

  .nav-dropdown-trigger .avatar-img,
  .nav-dropdown-trigger .avatar-initials { width: 30px; height: 30px; }

  .btn-header-auth { padding: 5px 8px; }
  .btn-header-auth svg { width: 14px; height: 14px; }
}

@media (max-width: 320px) {
  .site-header { padding: 4px 6px; }

  .site-header nav {
    padding: 4px 8px;
    gap: 4px;
    backdrop-filter: blur(12px) saturate(140%);
    -webkit-backdrop-filter: blur(12px) saturate(140%);
  }

  .site-header .logo svg { width: 24px; height: 24px; }
  .site-header .logo img { width: 26px; height: 26px; }

  .site-header .btn-icon { width: 30px; height: 30px; }
  .site-header .btn-icon svg { width: 14px; height: 14px; }

  .btn-header-auth { padding: 5px 6px; }
  .btn-header-auth svg { width: 13px; height: 13px; }

  .nav-dropdown-trigger .avatar-img,
  .nav-dropdown-trigger .avatar-initials { width: 28px; height: 28px; }
}

/* ============================================================
   14. TOUCH — fără hover-uri inutile
   ============================================================ */
@media (hover: none) {
  .site-header .logo:hover { transform: none; }
  .site-header .logo:hover svg,
  .site-header .logo:hover img { transform: none; }

  .site-header .btn-icon:hover {
    transform: none;
    background: var(--header-glass-bg);
    color: var(--text-secondary, #3a3a3c);
  }

  .site-header .btn-icon:hover svg { transform: none; }

  .nav-links a:hover {
    background: transparent;
    color: var(--text-secondary, #3a3a3c);
    transform: none;
  }

  .nav-dropdown-trigger:hover { transform: none; background: var(--header-glass-bg); }
  .nav-dropdown-item:hover { transform: none; background: transparent; color: var(--text-secondary, #3a3a3c); }

  .btn-header-auth-primary:hover { transform: none; }
  .btn-header-auth-primary:hover::before { transform: translateX(-100%); }
  .btn-header-auth-primary:hover svg { transform: none; }

  /* Oprește pulse-ul pe touch — salvează baterie */
  .site-header .badge,
  .site-header .badge::after,
  .nav-dropdown-trigger .avatar-status { animation: none; }
}

/* ============================================================
   15. ACCESSIBILITY
   ============================================================ */
.site-header a:focus-visible,
.site-header button:focus-visible,
.site-header [role="button"]:focus-visible {
  outline: 2px solid var(--accent, #007aff);
  outline-offset: 2px;
  border-radius: 999px;
}

[data-theme="dark"] .site-header a:focus-visible,
[data-theme="dark"] .site-header button:focus-visible,
[data-theme="dark"] .site-header [role="button"]:focus-visible {
  outline-color: #5ac8fa;
}

@media (prefers-reduced-motion: reduce) {
  .site-header *,
  .site-header *::before,
  .site-header *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .site-header .logo:hover { transform: none !important; }
  .nav-user-caret { transition: none !important; }
  .site-header .badge,
  .site-header .badge::after,
  .nav-dropdown-trigger .avatar-status { animation: none !important; }
}

@media (prefers-reduced-transparency: reduce) {
  .site-header nav,
  .site-header .btn-icon,
  .nav-dropdown-trigger,
  .btn-header-auth-secondary,
  .nav-dropdown-menu {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }

  .site-header nav,
  .nav-dropdown-menu { background: var(--header-glass-strong) !important; }
  .site-header nav::before { opacity: 0 !important; }
  .site-header::before { display: none !important; }
}

/* ============================================
   LOGO THEME SWITCHING
   ============================================ */
.logo-icon-light { display: inline-block !important; }
.logo-icon-dark  { display: none !important; }
[data-theme="dark"] .logo-icon-light { display: none !important; }
[data-theme="dark"] .logo-icon-dark  { display: inline-block !important; }

@media (prefers-color-scheme: dark) {
  html:not([data-theme="light"]) .logo-icon-light { display: none !important; }
  html:not([data-theme="light"]) .logo-icon-dark  { display: inline-block !important; }
}

/* Wrapper avatar cu status dot */
.avatar-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.avatar-wrap .avatar-img,
.avatar-wrap .avatar-initials {
  display: block;
}

.avatar-wrap .avatar-status {
  position: absolute;
  bottom: -1px;
  right: -1px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #34c759;
  border: 2px solid var(--glass-strong, rgba(255, 255, 255, 0.9));
  box-shadow: 0 0 0 1px rgba(52, 199, 89, 0.30);
  z-index: 1;
  animation: statusPulse 2s ease-in-out infinite;
  pointer-events: none;
}

[data-theme="dark"] .avatar-wrap .avatar-status {
  border-color: rgba(28, 28, 30, 0.92);
}

.nav-dropdown-user .avatar-wrap .avatar-status {
  width: 12px;
  height: 12px;
}

/* ============================================================
   THEME ICON SWAP (Specificitate corectată)
   ============================================================ */

/* Ascundem luna pe Light Mode */
.site-header .btn-icon .theme-icon-dark {
  display: none !important; 
}

/* Pe Dark Mode: ascundem soarele, arătăm luna */
[data-theme="dark"] .site-header .btn-icon .theme-icon-light {
  display: none !important;
}

[data-theme="dark"] .site-header .btn-icon .theme-icon-dark {
  display: block !important;
}

/* Suport pentru system preference (dacă nu e setat data-theme explicit) */
@media (prefers-color-scheme: dark) {
  html:not([data-theme="light"]) .site-header .btn-icon .theme-icon-light {
    display: none !important;
  }
  html:not([data-theme="light"]) .site-header .btn-icon .theme-icon-dark {
    display: block !important;
  }
}

/* ============================================
   FIX: SCROLL STATE FĂRĂ LAYOUT SHIFT
   ============================================ */

/* Header-ul NU își mai schimbă înălțimea la scroll */
.site-header.is-scrolled {
  padding: 14px 16px !important; /* Aceeași valoare ca la top */
}

/* Nav-ul interior la fel — păstrează padding constant */
.site-header.is-scrolled nav {
  padding: 10px 20px !important; /* Identic cu starea normală */
  border-radius: 20px !important; /* Nu schimbăm nici border-radius */
}

/* Schimbăm DOAR umbra și opacitatea — fără layout shift */
.site-header.is-scrolled nav {
  background: var(--header-glass-sheen), var(--header-glass-strong) !important;
  box-shadow: 
    0 12px 40px rgba(0, 0, 0, 0.10),
    0 2px 6px rgba(0, 0, 0, 0.06),
    var(--header-glass-highlight) !important;
}

[data-theme="dark"] .site-header.is-scrolled nav {
  box-shadow: 
    0 12px 40px rgba(0, 0, 0, 0.55),
    0 2px 6px rgba(0, 0, 0, 0.40),
    var(--header-glass-highlight) !important;
}

/* Eliminăm tranziția pe padding (nu mai are sens, nu se schimbă) */
.site-header {
  transition: none !important;
}

.site-header nav {
  transition: box-shadow var(--header-transition), background var(--header-transition) !important;
}

/* GPU compositing hints pentru smooth scrolling */
.site-header,
.site-header nav {
  transform: translateZ(0);
  -webkit-transform: translateZ(0);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}