/*!
 * © 2025 diaspora.ro — Toate drepturile rezervate.
 * PROTECTIE COPYRIGHT — COD PROPRIETAR CONFIDENTIAL
 * Utilizarea, copierea sau distributia fara acord scris este INTERZISA.
 * NO-AI-TRAINING: Not licensed for AI training datasets.
 * NO-AI-SCRAPING: Automated collection strictly prohibited.
 */
/* ═══════════════════════════════════════════════════════════════
   dh-header.css — Header unificat diaspora.ro
   Paletă identică cu /intra (violet #7c3aed · roz #ec4899 · amber #f59e0b)
   ═══════════════════════════════════════════════════════════════ */

/* ── Variabile ── */
/* Definite pe header.dh ȘI pe .dh-mobile deoarece overlay-ul mobil
   este un element sibling față de header (nu un descendent), deci
   nu poate moșteni variabilele CSS definite numai pe header.dh. */
header.dh,
.dh-mobile {
  --dh-bg: rgba(7,8,15,.90);
  --dh-border: #1c253a;
  --dh-text: #e8edf8;
  --dh-text2: #c4c9d8;
  --dh-text3: #6272a4;
  --dh-panel: #0f1220;
  --dh-panel2: #141828;
  --dh-brand: #7c3aed;
  --dh-accent: #ec4899;
  --dh-amber: #f59e0b;
  --dh-grad: linear-gradient(135deg,#7c3aed 0%,#ec4899 60%,#f59e0b 100%);
  --dh-hover: rgba(124,58,237,.12);
  --dh-shadow: 0 8px 32px rgba(0,0,0,.55);
}

[data-theme="light"] header.dh,
[data-theme="light"] .dh-mobile {
  --dh-bg: rgba(240,237,255,.93);
  --dh-border: #ddd6fe;
  --dh-text: #1e1b4b;
  --dh-text2: #4b5563;
  --dh-text3: #9ca3af;
  --dh-panel: #ffffff;
  --dh-panel2: #f5f3ff;
  --dh-hover: rgba(124,58,237,.07);
  --dh-shadow: 0 8px 32px rgba(124,58,237,.12);
}

/* ── Reset & Base ── */
header.dh, header.dh * { box-sizing: border-box; }

/* Elimină orice header duplicat */
header.dh ~ header.dh { display: none; }

/* ── Header container ── */
header.dh {
  position: sticky;
  top: 0;
  z-index: 200;
  background: var(--dh-bg);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--dh-border);
  font-family: 'Segoe UI', system-ui, -apple-system, 'Helvetica Neue', Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* ── Wrapper ── */
.dh-wrap {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  height: 58px;
  display: flex;
  align-items: center;
  gap: 10px;
}

/* ── Logo ── */
.dh-logo {
  display: flex;
  align-items: center;
  gap: 9px;
  text-decoration: none;
  flex-shrink: 0;
  border-radius: 10px;
  padding: 4px 6px 4px 2px;
  transition: opacity .15s;
}
.dh-logo:hover { opacity: .85; }

.dh-badge {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: var(--dh-grad);
  color: #fff;
  font-size: 10px;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  letter-spacing: .5px;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(124,58,237,.4);
}

.dh-name {
  font-size: 17px;
  font-weight: 700;
  color: var(--dh-text);
  letter-spacing: -.3px;
  line-height: 1;
}
.dh-name strong { color: var(--dh-brand); }

/* ── Nav ── */
.dh-nav {
  display: flex;
  align-items: center;
  gap: 2px;
  flex: 1;
  margin-left: 6px;
  overflow: hidden;
}

@media (max-width: 800px) { .dh-nav { display: none; } }

.dh-link {
  padding: 7px 11px;
  border-radius: 8px;
  color: var(--dh-text2);
  font-size: 13.5px;
  font-weight: 600;
  text-decoration: none;
  transition: color .15s, background .15s;
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.dh-link:hover, .dh-link.is-active {
  color: var(--dh-text);
  background: var(--dh-hover);
}

/* ── Dropdown ── */
.dh-dd { position: relative; }

.dh-dd-btn { display: flex; align-items: center; gap: 4px; }
.dh-dd-btn svg { transition: transform .15s; flex-shrink: 0; }
.dh-dd.open .dh-dd-btn svg { transform: rotate(180deg); }

.dh-dd-panel {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  background: var(--dh-panel);
  border: 1px solid var(--dh-border);
  border-radius: 13px;
  padding: 6px;
  min-width: 200px;
  box-shadow: var(--dh-shadow);
  z-index: 300;
  display: none;
}
.dh-dd.open .dh-dd-panel { display: block; }

.dh-dd-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  border-radius: 8px;
  color: var(--dh-text);
  font-size: 13.5px;
  font-weight: 500;
  text-decoration: none;
  transition: background .13s, color .13s;
  cursor: pointer;
  background: none;
  border: none;
  width: 100%;
  font-family: inherit;
  text-align: left;
  line-height: 1.3;
}
.dh-dd-item:hover { background: var(--dh-hover); color: var(--dh-text); }
.dh-dd-admin { color: var(--dh-amber); }
.dh-dd-logout { color: #ef4444; }

/* ── CTA zone ── */
.dh-cta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  flex-shrink: 0;
}

.dh-back-btn {
  padding: 7px 15px;
  border-radius: 9px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--dh-text);
  text-decoration: none;
  border: 1px solid var(--dh-border);
  background: transparent;
  cursor: pointer;
  transition: border-color .15s, background .15s;
  font-family: inherit;
  white-space: nowrap;
}
.dh-back-btn:hover { border-color: var(--dh-brand); background: var(--dh-hover); }

.dh-post-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 15px;
  border-radius: 9px;
  font-size: 13.5px;
  font-weight: 700;
  background: var(--dh-grad);
  color: #fff;
  text-decoration: none;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(124,58,237,.38);
  transition: box-shadow .15s, transform .15s;
  font-family: inherit;
  white-space: nowrap;
}
.dh-post-btn:hover { box-shadow: 0 6px 22px rgba(124,58,237,.55); transform: translateY(-1px); }

.dh-admin-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 9px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--dh-amber);
  background: rgba(245,158,11,.10);
  border: 1px solid rgba(245,158,11,.25);
  text-decoration: none;
  transition: background .15s;
  white-space: nowrap;
}
.dh-admin-btn:hover { background: rgba(245,158,11,.20); }

/* ── Butoane vizibile header (logat): Admin Panel / User Panel / Ieșire ── */
.dh-hdr-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  border-radius: 9px;
  font-size: 12.5px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid var(--dh-border);
  background: transparent;
  color: var(--dh-text);
  font-family: inherit;
  white-space: nowrap;
  transition: background .15s, border-color .15s, color .15s;
}
.dh-hdr-btn:hover { background: var(--dh-hover); border-color: var(--dh-brand); }

.dh-hdr-admin {
  color: var(--dh-amber);
  background: rgba(245,158,11,.10);
  border-color: rgba(245,158,11,.30);
}
.dh-hdr-admin:hover { background: rgba(245,158,11,.20); border-color: var(--dh-amber); }

.dh-hdr-user {
  color: var(--dh-brand);
  background: rgba(124,58,237,.08);
  border-color: rgba(124,58,237,.25);
}
.dh-hdr-user:hover { background: rgba(124,58,237,.18); border-color: var(--dh-brand); }

.dh-hdr-logout {
  color: #dc2626;
  background: rgba(220,38,38,.07);
  border-color: rgba(220,38,38,.22);
}
.dh-hdr-logout:hover { background: rgba(220,38,38,.15); border-color: #dc2626; }

/* Pe mobile, ascunde butoanele vizibile din CTA (meniu burger le are deja) */
@media (max-width: 768px) {
  .dh-hdr-btn { display: none; }
}

/* ── User menu ── */
.dh-user { position: relative; }

.dh-user-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 10px 5px 5px;
  border-radius: 99px;
  border: 1px solid var(--dh-border);
  background: rgba(255,255,255,.04);
  cursor: pointer;
  color: var(--dh-text);
  font-size: 13px;
  font-weight: 600;
  transition: border-color .15s, background .15s;
  font-family: inherit;
}
.dh-user-btn:hover { border-color: var(--dh-brand); background: var(--dh-hover); }

.dh-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--dh-grad);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 12px;
  flex-shrink: 0;
}
.dh-avatar-lg { width: 40px; height: 40px; font-size: 15px; }

.dh-user-name {
  font-size: 13px;
  font-weight: 600;
  max-width: 110px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dh-user-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  left: auto;
  min-width: 250px;
  padding: 8px;
  background: var(--dh-panel);
  border: 1px solid var(--dh-border);
  border-radius: 14px;
  box-shadow: var(--dh-shadow);
  z-index: 300;
  display: none;
}
.dh-user.open .dh-user-panel { display: block; }

.dh-user-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 8px 12px;
  border-bottom: 1px solid var(--dh-border);
  margin-bottom: 6px;
}
.dh-user-head-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow: hidden;
  min-width: 0;
}
.dh-user-head-info strong {
  font-size: 13.5px;
  color: var(--dh-text);
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dh-user-head-info span {
  font-size: 11.5px;
  color: var(--dh-text2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dh-role {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 20px;
  background: rgba(124,58,237,.18);
  color: var(--dh-brand);
  border: 1px solid rgba(124,58,237,.3);
  width: fit-content;
  letter-spacing: .5px;
  text-transform: uppercase;
  margin-top: 2px;
}

.dh-panel-sep {
  border: none;
  border-top: 1px solid var(--dh-border);
  margin: 6px 0;
}

/* ── Skeleton ── */
.dh-skeleton {
  width: 80px;
  height: 32px;
  border-radius: 9px;
  background: linear-gradient(90deg, var(--dh-panel2) 25%, #253047 50%, var(--dh-panel2) 75%);
  background-size: 200% 100%;
  animation: dh-sk 1.5s linear infinite;
}
@keyframes dh-sk { 0%{background-position:200%} 100%{background-position:-200%} }

/* ── Burger ── */
.dh-burger {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: none;
  border: 1px solid var(--dh-border);
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
  transition: border-color .15s;
}
.dh-burger:hover { border-color: var(--dh-brand); }
.dh-burger span {
  width: 18px;
  height: 2px;
  background: var(--dh-text);
  border-radius: 2px;
  display: block;
  transition: transform .2s, opacity .2s;
}

@media (max-width: 800px) { .dh-burger { display: flex; } }

/* ── Mobile overlay ── */
.dh-mobile {
  position: fixed;
  inset: 0;
  background: rgba(7,8,15,.65);
  z-index: 190;
  display: none;
}
.dh-mobile.open { display: block; }

.dh-mobile-inner {
  position: absolute;
  top: 58px;
  left: 0;
  right: 0;
  background: var(--dh-panel);
  border-bottom: 1px solid var(--dh-border);
  padding: 16px 18px 28px;
  max-height: calc(100vh - 58px);
  overflow-y: auto;
}

.dh-mobile-section { margin-bottom: 22px; }

.dh-mobile-section h4 {
  font-size: 10.5px;
  font-weight: 700;
  color: var(--dh-text3);
  text-transform: uppercase;
  letter-spacing: .8px;
  margin: 0 0 8px;
}

.dh-mobile-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.dh-mobile-list .dh-link {
  justify-content: flex-start;
  padding: 10px 12px;
  font-size: 14px;
  width: 100%;
}

/* ── Theme toggle button ── */
.dh-theme-btn {
  background: none;
  border: 1px solid var(--dh-border);
  border-radius: 8px;
  color: var(--dh-text2);
  font-size: 16px;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background .15s, border-color .15s, color .15s;
  flex-shrink: 0;
  padding: 0;
  line-height: 1;
}
.dh-theme-btn:hover { background: var(--dh-hover); border-color: var(--dh-brand); color: var(--dh-text); }
