/* ─── HEADER SHARED STYLES ─── */

/* slideDown animation used by theme-menu and user-menu */
@keyframes slideDown {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ─── DESKTOP NAV ─── */
.desktop-nav {
  display: none;
  align-items: center;
  gap: 2px;
}

.desktop-nav-link {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 10px;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--muted);
  text-decoration: none;
  cursor: pointer;
  border: none;
  background: transparent;
  font-family: inherit;
  white-space: nowrap;
  transition: background 0.18s, color 0.18s;
}

.desktop-nav-link:hover {
  background: var(--green-dim);
  color: var(--text);
}

.desktop-nav-link.active {
  background: var(--green-dim);
  color: var(--green);
}

@media (min-width: 768px) {
  body.has-desktop-nav .hamburger-button { display: none !important; }
  body.has-desktop-nav .desktop-nav     { display: flex; }
}

@media (max-width: 767px) {
  body.has-desktop-nav .hamburger-button { display: flex !important; }
  body.has-desktop-nav .desktop-nav     { display: none !important; }
}

.header-container {
  position: sticky;
  top: 0;
  z-index: 200;
  background: rgba(243,250,225,0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}

[data-theme="dark"]    .header-container { background: rgba(14,11,26,0.92); }
[data-theme="festive"] .header-container { background: rgba(255,245,245,0.92); }
[data-theme="custom"]  .header-container { background: rgba(253,240,255,0.92); }

.main-header {
  height: 60px;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.header-left, .header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.hamburger-button {
  width: 36px; height: 36px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 18px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.2s;
  flex-shrink: 0;
}
.hamburger-button:hover { background: var(--green-dim); }

.logo { cursor: pointer; display: flex; align-items: center; text-decoration: none; }
.logo img {
  height: 44px; width: auto;
  filter: brightness(0) saturate(100%) invert(16%) sepia(78%) saturate(5000%) hue-rotate(248deg) brightness(90%);
  transition: transform 0.3s, filter 0.3s;
}
[data-theme="dark"]    .logo img { filter: brightness(0) invert(1); }
[data-theme="festive"] .logo img { filter: brightness(0) saturate(100%) invert(12%) sepia(90%) saturate(4000%) hue-rotate(338deg) brightness(85%); }
[data-theme="custom"]  .logo img { filter: brightness(0) saturate(100%) invert(35%) sepia(80%) saturate(3000%) hue-rotate(268deg) brightness(100%); }
.logo:hover img { transform: scale(1.06); }

/* ─── XP / POINTS BADGE ─── */
.points-badge {
  display: flex; align-items: center; gap: 5px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 5px 12px;
  font-family: var(--mono);
  font-size: 0.8rem; font-weight: 600;
  color: var(--text);
  white-space: nowrap;
}

/* ─── THEME BUTTON ─── */
.theme-button {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--surface-2);
  border: 1px solid var(--border);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
  transition: background 0.2s;
  position: relative;
}
.theme-button:hover { background: var(--green-dim); }

/* ─── THEME BUTTON WRAP ─── */
.theme-button-wrap { position: relative; }

/* ─── THEME MENU ─── */
.theme-menu {
  position: absolute;
  top: calc(100% + 8px); right: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 8px;
  box-shadow: 0 12px 40px var(--shadow);
  display: none;
  z-index: 1000;
  min-width: 190px;
}
.theme-menu.show { display: block; animation: slideDown 0.2s ease; }

.theme-option {
  padding: 10px 14px;
  margin: 3px 0;
  border-radius: 9px;
  cursor: pointer;
  display: flex; align-items: center; gap: 10px;
  color: var(--text);
  font-family: var(--ff);
  font-size: 0.9rem; font-weight: 600;
  transition: background 0.15s;
  border: 1px solid transparent;
}
.theme-option:hover { background: var(--surface-2); }
.theme-option.active { background: var(--green-dim); border-color: var(--border); color: var(--green); }
.theme-icon { font-size: 1.2rem; }
.theme-label { flex: 1; }

/* ─── LOGIN BUTTON ─── */
.login-button {
  height: 36px; padding: 0 18px;
  border-radius: 18px;
  background: var(--green);
  border: none;
  color: #fff;
  font-family: var(--ff);
  font-size: 14px; font-weight: 800;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
  display: flex; align-items: center;
}
.login-button:hover {
  transform: scale(1.05);
  box-shadow: 0 0 20px var(--shadow);
}

/* Show short/full login label based on screen width */
.login-short { display: none; }

@media (max-width: 480px) {
  .login-button { padding: 0 12px; font-size: 13px; }
  .login-full  { display: none; }
  .login-short { display: inline; }
  .points-badge { display: none; }
}

/* ─── USER MENU ─── */
.user-menu-container { position: relative; }

.user-button {
  height: 36px; padding: 0 14px;
  border-radius: 18px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  cursor: pointer;
  display: flex; align-items: center; gap: 8px;
  color: var(--text);
  font-family: var(--ff);
  font-size: 14px; font-weight: 600;
  transition: all 0.2s;
}
.user-button:hover { background: var(--green-dim); }

.user-avatar { font-size: 16px; }
.user-name { max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

@media (max-width: 768px) {
  .user-name { display: none; }
  .user-button { width: 36px; height: 36px; padding: 0; border-radius: 50%; justify-content: center; }
}

.user-menu {
  position: absolute;
  top: 46px; right: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 10px;
  box-shadow: 0 12px 40px var(--shadow);
  display: none;
  z-index: 1000;
  min-width: 240px;
}
.user-menu.show { display: block; animation: slideDown 0.2s ease; }

.user-menu-header { display: flex; align-items: center; gap: 10px; padding: 8px; }
.user-menu-avatar {
  width: 38px; height: 38px; border-radius: 50%;
  background: var(--green-dim);
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; flex-shrink: 0;
}
.user-menu-info { flex: 1; min-width: 0; }
.user-menu-name { font-size: 14px; font-weight: 700; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-menu-email { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-menu-divider { height: 1px; background: var(--border); margin: 8px 0; }

.user-menu-item {
  width: 100%; padding: 9px 12px;
  border-radius: 8px; cursor: pointer;
  display: flex; align-items: center; gap: 10px;
  color: var(--text);
  background: transparent; border: none;
  font-family: var(--ff);
  font-size: 14px; font-weight: 600;
  transition: background 0.15s;
}
.user-menu-item:hover { background: var(--surface-2); }
.user-menu-item span:first-child { font-size: 16px; }

/* ─── BREADCRUMB BAR ─── */
.breadcrumb-bar {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--mono);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
  padding: 10px 0;
}

.breadcrumb-item {
  display: flex; align-items: center; gap: 4px;
  cursor: pointer;
  text-decoration: none;
  color: var(--muted);
  transition: color 0.15s;
  padding: 2px 4px;
  border-radius: 4px;
}
.breadcrumb-item:hover { color: var(--green); }
.breadcrumb-item:last-child { color: var(--text); cursor: default; }
.breadcrumb-item:last-child:hover { color: var(--text); }
.breadcrumb-separator { opacity: 0.4; }

@media (max-width: 600px) {
  .breadcrumb-bar { padding: 0 16px; }
  .breadcrumb { flex-wrap: wrap; gap: 4px; font-size: 0.72rem; }
  .breadcrumb-item { padding: 1px 3px; }
}

