/* ============================================================
   GQ Header v1 — globale Komponente.
   Eigenes Scope unter .gq-header-* damit es nicht mit Page-CSS
   kollidiert. Inline-SVG-IDs eindeutig (gqHeaderLogoGrad).
   ============================================================ */

.gq-header {
  position: relative;
  z-index: 100;
  padding: 22px 0;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  background: rgba(6,6,11,0.55);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

.gq-header-container {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  gap: 24px;
}

.gq-header-logo {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  flex-shrink: 0;
}
.gq-header-logo svg {
  width: 180px;
  height: 50px;
  display: block;
}

/* Hamburger (Mobile) */
.gq-header-hamburger {
  display: none;
  margin-left: auto;
  width: 40px;
  height: 40px;
  background: transparent;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 10px;
  cursor: pointer;
  padding: 0;
  position: relative;
}
.gq-header-hamburger span {
  position: absolute;
  left: 10px;
  width: 20px;
  height: 2px;
  background: #fff;
  border-radius: 2px;
  transition: transform .25s ease, opacity .25s ease, top .25s ease;
}
.gq-header-hamburger span:nth-child(1) { top: 13px; }
.gq-header-hamburger span:nth-child(2) { top: 19px; }
.gq-header-hamburger span:nth-child(3) { top: 25px; }
.gq-header-hamburger.is-open span:nth-child(1) { top: 19px; transform: rotate(45deg); }
.gq-header-hamburger.is-open span:nth-child(2) { opacity: 0; }
.gq-header-hamburger.is-open span:nth-child(3) { top: 19px; transform: rotate(-45deg); }

/* Nav */
.gq-header-nav {
  display: flex;
  align-items: center;
  gap: 26px;
  margin-left: auto;
  flex-wrap: wrap;
}
.gq-header-nav-link {
  color: rgba(255,255,255,0.62);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: color .2s ease;
  position: relative;
  padding: 4px 0;
}
.gq-header-nav-link:hover { color: #fff; }
.gq-header-nav-link.gq-header-nav-active {
  color: #fff;
}
.gq-header-nav-link.gq-header-nav-active::after {
  content: "";
  position: absolute;
  bottom: -3px;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, #7C3AED 0%, #A855F7 50%, #EC4899 100%);
  border-radius: 2px;
}

/* Mobile-only Slot — auf Desktop (>= 881px) immer hidden, unabhaengig
   vom hidden-Attribut. Auf Mobile gilt das normale hidden-Verhalten
   (von JS gesteuert je nach Login-Status). */
@media (min-width: 881px) {
  .gq-header-mobile-only { display: none !important; }
}

/* Dashboard-Link (sichtbar wenn eingeloggt) — Brand-Gradient-Text */
.gq-header-dashboard-link {
  font-weight: 600;
  background: linear-gradient(135deg, #A855F7 0%, #EC4899 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  /* Fallback fuer Browser ohne Background-Clip-Support */
  color: #c4b5fd;
}
.gq-header-dashboard-link:hover {
  background: linear-gradient(135deg, #7C3AED 0%, #EC4899 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.gq-header-dashboard-link.gq-header-nav-active::after {
  background: linear-gradient(90deg, #A855F7 0%, #EC4899 100%);
}

/* Sub-Links unter Mission-Control (Analysen / Abo / Daten) — Direktsprung
   in die jeweilige Pro-Dashboard-Karte via #anchor. Auf Desktop dezent,
   auf Mobile als Liste mit Einrueckung sichtbar. */
.gq-header-dashboard-sublink {
  font-size: 13px;
  font-weight: 500;
  color: rgba(196,181,253,0.78);  /* dezenter als Mission Control */
  position: relative;
  padding-left: 18px;
}
.gq-header-dashboard-sublink::before {
  content: "·";
  position: absolute;
  left: 6px;
  top: 0;
  color: rgba(168,85,247,0.55);
  font-weight: 700;
}
.gq-header-dashboard-sublink:hover {
  color: #fff;
}
.gq-header-dashboard-sublink.gq-header-nav-active::after { display: none; }

/* Sprach-Switcher Slot (footer-css setzt eigene .gq-lang-* Styles) */
.gq-header-lang-slot {
  display: inline-flex;
  align-items: center;
}

/* Login-Link */
.gq-header-login {
  color: rgba(255,255,255,0.78);
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 500;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.12);
  transition: border-color .2s ease, background .2s ease, color .2s ease;
}
.gq-header-login:hover {
  border-color: rgba(168,85,247,0.4);
  background: rgba(168,85,247,0.08);
  color: #fff;
}

/* Auth-Slot (Login-Link ODER User-Dropdown) */
.gq-header-auth { position: relative; display: inline-flex; align-items: center; }
.gq-header-auth [hidden] { display: none !important; }

/* User-Dropdown */
.gq-header-user { position: relative; display: inline-flex; align-items: center; }
.gq-header-user-trigger {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px 6px 8px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 999px;
  color: #fff;
  font-family: 'Inter', sans-serif;
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  transition: border-color .2s ease, background .2s ease;
}
.gq-header-user-trigger:hover {
  border-color: rgba(168,85,247,0.4);
  background: rgba(168,85,247,0.08);
}
.gq-header-user-email {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12.5px;
  color: rgba(255,255,255,0.85);
  letter-spacing: -0.005em;
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.gq-header-user-chevron { opacity: 0.6; }
.gq-header-user-trigger[aria-expanded="true"] .gq-header-user-chevron {
  transform: rotate(180deg);
}

/* Plan-Badge */
.gq-header-user-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-family: 'Outfit', sans-serif;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: #fff;
  text-transform: uppercase;
  line-height: 1.4;
}
.gq-header-user-badge--pro {
  background: linear-gradient(135deg, #7C3AED 0%, #A855F7 50%, #EC4899 100%);
  box-shadow: 0 4px 12px -4px rgba(168,85,247,0.55);
}
.gq-header-user-badge--pro-plus {
  background: linear-gradient(135deg, #F59E0B 0%, #EC4899 50%, #A855F7 100%);
  box-shadow: 0 4px 12px -4px rgba(236,72,153,0.55);
}

/* User-Menu */
.gq-header-user-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  min-width: 200px;
  background: rgba(15,15,24,0.97);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(168,85,247,0.25);
  border-radius: 12px;
  padding: 6px;
  box-shadow: 0 14px 40px -10px rgba(0,0,0,0.6);
  display: none;
  flex-direction: column;
  z-index: 110;
}
.gq-header-user-menu.is-open { display: flex; }
.gq-header-user-menu-item {
  display: block;
  width: 100%;
  padding: 8px 12px;
  border-radius: 8px;
  background: transparent;
  border: none;
  color: rgba(255,255,255,0.85);
  font-family: 'Inter', sans-serif;
  font-size: 13.5px;
  font-weight: 500;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  transition: background .15s ease, color .15s ease;
}
.gq-header-user-menu-item:hover {
  background: rgba(168,85,247,0.12);
  color: #fff;
}
.gq-header-user-menu-logout {
  border-top: 1px solid rgba(255,255,255,0.06);
  margin-top: 4px;
  padding-top: 10px;
  color: rgba(252,165,165,0.92);
}
.gq-header-user-menu-logout:hover {
  background: rgba(239,68,68,0.12);
  color: #fca5a5;
}

/* Mobile: User-Dropdown wird zu Stack-Layout */
@media (max-width: 880px) {
  .gq-header-user { width: 100%; margin-top: 6px; }
  .gq-header-user-trigger { width: 100%; justify-content: center; box-sizing: border-box; }
  .gq-header-user-email { max-width: none; }
  .gq-header-user-menu {
    position: static;
    margin-top: 8px;
    width: 100%;
    box-sizing: border-box;
  }
}

/* CTA */
.gq-header-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 20px;
  background: linear-gradient(135deg, #7C3AED 0%, #A855F7 50%, #EC4899 100%);
  color: #fff !important;
  font-size: 13.5px;
  font-weight: 600;
  text-decoration: none;
  border-radius: 999px;
  box-shadow: 0 6px 20px rgba(168,85,247,0.45);
  transition: transform .2s ease, box-shadow .2s ease;
  white-space: nowrap;
}
.gq-header-cta:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 28px rgba(168,85,247,0.65);
}

/* Mobile Layout */
@media (max-width: 880px) {
  .gq-header { padding: 14px 0; }
  .gq-header-container { gap: 12px; }
  .gq-header-logo svg { width: 150px; height: 42px; }
  .gq-header-hamburger { display: block; }
  .gq-header-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: rgba(10,10,15,0.97);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid rgba(255,255,255,0.06);
    border-bottom: 1px solid rgba(168,85,247,0.2);
    padding: 14px 24px 22px;
    margin: 0;
  }
  .gq-header-nav.is-open { display: flex; }
  .gq-header-nav-link {
    padding: 12px 4px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    font-size: 15px;
  }
  .gq-header-nav-link:last-of-type { border-bottom: none; }
  .gq-header-nav-link.gq-header-nav-active::after { display: none; }
  /* Dashboard-Link auf Mobile: visuell von Public-Nav getrennt */
  .gq-header-dashboard-link {
    margin-top: 8px;
    padding-top: 14px !important;
    border-top: 1px solid rgba(168,85,247,0.30);
    font-size: 16px;
    font-weight: 700;
  }
  /* Sub-Links auf Mobile: eingerueckte Liste unter Mission Control */
  .gq-header-dashboard-sublink {
    padding: 10px 4px 10px 22px !important;
    font-size: 14.5px;
    border-bottom: 1px solid rgba(255,255,255,0.04);
  }
  .gq-header-dashboard-sublink::before {
    left: 8px;
    top: 10px;
  }
  .gq-header-lang-slot,
  .gq-header-login,
  .gq-header-cta {
    width: 100%;
    margin-top: 6px;
    justify-content: center;
    text-align: center;
  }
  .gq-header-login { box-sizing: border-box; }
}

@media (prefers-reduced-motion: reduce) {
  .gq-header-cta,
  .gq-header-nav-link,
  .gq-header-hamburger span { transition: none !important; }
}
