/* ═══════════════════════════════════════════════
   CEVIO STEAM IDLER — SITE HEADER
   public/css/header.css
   Always visible on ALL pages.
   ═══════════════════════════════════════════════ */

/* ═══ HIDE OLD DASHBOARD / LANDING NAV ═══ */
.dash-nav   { display: none !important }
.land-nav   { display: none !important }

/* Pricing-nav: keep only back button */
.pricing-nav .nav-icon-btn,
.pricing-nav .lang-switch-mini,
.pricing-nav .lang-mini { display: none !important }
.pricing-nav {
  justify-content: flex-start !important;
  gap: 0 !important;
}

/* ═══ BODY PADDING ═══ */
#app { padding-top: 7em }

/* ═══ HIDE HEADER ON AUTH PAGES ═══ */
body:has(#app .auth-page) .site-header { display: none !important }
body:has(#app .auth-page) #app         { padding-top: 0 !important }
body.auth-route .site-header            { display: none !important }
body.auth-route #app                    { padding-top: 0 !important }

/* ═══════════════════════════════════════════════
   BASE HEADER
   ═══════════════════════════════════════════════ */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 7em;
  backdrop-filter: blur(1em);
  -webkit-backdrop-filter: blur(1em);
  background: rgba(255, 255, 255, 0.65);
  border-bottom: 0.08em solid rgba(0, 0, 0, 0.1);
  z-index: 1000;
  transition: background 0.3s, border-color 0.3s;
}
[data-theme="dark"] .site-header {
  background: rgba(12, 10, 20, 0.8);
  border-bottom-color: rgba(255, 255, 255, 0.06);
}

/* ═══ LIQUID WAVE TOP ═══ */
@keyframes liquid-flow-top {
  from { transform: translateX(0) }
  to   { transform: translateX(-50%) }
}
.site-header::before {
  content: "";
  position: absolute;
  left: 0;
  top: -0.9em;
  width: 200vw;
  height: 3.4em;
  background: linear-gradient(
    90deg,
    #4f46ff, #7a3cff, #c026ff, #7a3cff, #4f46ff,
    #7a3cff, #c026ff, #7a3cff, #4f46ff
  );
  background-size: 50% 100%;
  mask-image: url("data:image/svg+xml;utf8,\
<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 2880 80' preserveAspectRatio='none'>\
<path d='M0,40 C180,80 360,0 540,40 C720,80 900,0 1080,40 C1260,80 1440,0 1620,40 C1800,80 1980,0 2160,40 C2340,80 2520,0 2700,40 L2880,40 L2880,0 L0,0 Z' />\
</svg>");
  -webkit-mask-image: url("data:image/svg+xml;utf8,\
<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 2880 80' preserveAspectRatio='none'>\
<path d='M0,40 C180,80 360,0 540,40 C720,80 900,0 1080,40 C1260,80 1440,0 1620,40 C1800,80 1980,0 2160,40 C2340,80 2520,0 2700,40 L2880,40 L2880,0 L0,0 Z' />\
</svg>");
  mask-size: 100% 100%;
  -webkit-mask-size: 100% 100%;
  mask-repeat: no-repeat;
  -webkit-mask-repeat: no-repeat;
  animation: liquid-flow-top 20s linear infinite;
  filter: blur(4px);
  opacity: 0.75;
  pointer-events: none;
}

/* ═══ HEADER INNER ═══ */
.header-inner {
  width: 100%;
  height: 100%;
  padding: 0 2vw;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
}

/* ═══════════════════════════════════════════════
   LOGO  (identical to cevio.at header style)
   ═══════════════════════════════════════════════ */
.site-header .logo {
  display: flex;
  align-items: center;
  gap: 0;
  cursor: pointer;
  text-decoration: none;
  z-index: 2;
  transition: opacity 0.2s;
}
.site-header .logo:hover { opacity: 0.95 }

.site-header .logo img {
  width: 8em;
  height: auto;
}

.site-header .logo-text {
  display: flex;
  flex-direction: column;
  line-height: 1.1em;
}

.site-header .brand-name {
  font-size: 2.2em;
  font-weight: 600;
  color: #111827;
  letter-spacing: 0.04em;
  line-height: 1;
  font-family: 'Playfair Display', serif;
}
[data-theme="dark"] .site-header .brand-name { color: #eae7f2 }

.site-header .brand-sub {
  font-size: 0.8em;
  font-weight: 400;
  color: #4b5563;
  letter-spacing: 0.06em;
  line-height: 1.25;
  margin-top: 0.5em;
  text-transform: none;
  font-family: 'Playfair Display', serif;
}
[data-theme="dark"] .site-header .brand-sub { color: #9e98b4 }

/* ═══════════════════════════════════════════════
   MAIN NAV (centered)
   ═══════════════════════════════════════════════ */
.site-header .main-nav {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 2em;
}

.site-header .nav-btn {
  position: relative;
  background: none;
  border: none;
  padding: 0.4em 0.2em;
  cursor: pointer;
  color: #1f2937;
  font-size: 1.2em;
  font-weight: 500;
  font-family: inherit;
  transition: color 0.25s, transform 0.2s;
}
[data-theme="dark"] .site-header .nav-btn { color: #d1d5db }

.site-header .nav-btn:hover              { color: #111827; transform: scale(1.12) }
[data-theme="dark"] .site-header .nav-btn:hover { color: #fff }
.site-header .nav-btn:active             { transform: scale(0.96) }

/* ═══════════════════════════════════════════════
   RIGHT SIDE
   ═══════════════════════════════════════════════ */
.site-header .header-right {
  display: flex;
  align-items: center;
  gap: 0.8em;
  z-index: 2;
}

/* Lang switch */
.site-header .lang-switch {
  display: flex;
  align-items: center;
  gap: 0.35em;
  font-size: 0.9em;
}
.site-header .lang-btn {
  background: none;
  border: none;
  padding: 0.4em 0.5em;
  cursor: pointer;
  font-size: 0.9em;
  font-family: inherit;
  color: #6b7280;
  border-radius: 0.4em;
  transition: color 0.2s, background 0.2s, transform 0.15s;
}
.site-header .lang-btn:hover             { color: #111827; transform: scale(1.1) }
[data-theme="dark"] .site-header .lang-btn:hover { color: #f3f4f6 }
.site-header .lang-btn:active            { transform: scale(0.95) }
.site-header .lang-btn.active {
  color: #111827;
  font-weight: 600;
  background: rgba(0, 0, 0, 0.06);
}
[data-theme="dark"] .site-header .lang-btn.active {
  color: #f3f4f6;
  background: rgba(255, 255, 255, 0.08);
}
.site-header .lang-sep {
  color: #d1d5db;
  font-size: 0.85em;
  user-select: none;
}
[data-theme="dark"] .site-header .lang-sep { color: #4b5563 }

/* Theme toggle */
.site-header .theme-toggle {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.1em;
  padding: 0.3em;
  border-radius: 0.4em;
  line-height: 1;
  transition: transform 0.2s, background 0.2s;
}
.site-header .theme-toggle:hover {
  transform: scale(1.12);
  background: rgba(0, 0, 0, 0.04);
}
[data-theme="dark"] .site-header .theme-toggle:hover {
  background: rgba(255, 255, 255, 0.06);
}

/* Start button (logged out) */
.site-header .start-btn {
  background: linear-gradient(135deg, #4f46ff, #c026ff);
  border: none;
  border-radius: 0.6em;
  padding: 0.5em 1.1em;
  font-size: 1em;
  font-weight: 600;
  font-family: inherit;
  color: #ffffff;
  cursor: pointer;
  box-shadow: 0 0.4em 1.2em rgba(79, 70, 255, 0.35);
  transition: transform 0.2s, box-shadow 0.2s;
}
.site-header .start-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 0.8em 2em rgba(192, 38, 255, 0.45);
}
.site-header .start-btn:active { transform: scale(0.96) }

/* ═══════════════════════════════════════════════
   USER AREA (logged in — filled by header.js)
   ═══════════════════════════════════════════════ */
.hdr-user-area {
  display: none;
  align-items: center;
  gap: 0.5em;
}
.hdr-user-area.visible { display: flex }

.hdr-divider {
  width: 1px;
  height: 1.6em;
  background: rgba(0, 0, 0, 0.1);
  margin: 0 0.2em;
}
[data-theme="dark"] .hdr-divider { background: rgba(255, 255, 255, 0.08) }

/* Icon buttons (settings, logout etc.) */
.hdr-icon-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: #6b7280;
  padding: 0.35em;
  border-radius: 0.4em;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s, background 0.2s, transform 0.15s;
}
.hdr-icon-btn:hover {
  color: #111827;
  background: rgba(0, 0, 0, 0.04);
  transform: scale(1.08);
}
[data-theme="dark"] .hdr-icon-btn            { color: #9ca3af }
[data-theme="dark"] .hdr-icon-btn:hover {
  color: #f3f4f6;
  background: rgba(255, 255, 255, 0.06);
}
.hdr-icon-btn svg { width: 16px; height: 16px }

/* User info chip */
.hdr-user-info {
  display: flex;
  align-items: center;
  gap: 0.45em;
  cursor: pointer;
  padding: 0.25em 0.6em 0.25em 0.3em;
  border-radius: 0.5em;
  transition: background 0.2s;
}
.hdr-user-info:hover { background: rgba(0, 0, 0, 0.04) }
[data-theme="dark"] .hdr-user-info:hover { background: rgba(255, 255, 255, 0.04) }

.hdr-avatar {
  width: 1.8em;
  height: 1.8em;
  border-radius: 50%;
  background: linear-gradient(135deg, #4f46ff, #c026ff);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.78em;
  color: #fff;
  flex-shrink: 0;
  overflow: hidden;
}

.hdr-username {
  font-size: 0.82em;
  font-weight: 600;
  color: #1f2937;
  max-width: 8em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
[data-theme="dark"] .hdr-username { color: #e5e7eb }

/* Plan badge in header */
.hdr-user-area .plan-badge { font-size: 0.6em }

/* Logout */
.hdr-logout { color: #9ca3af }
.hdr-logout:hover {
  color: #ef4444 !important;
  background: rgba(239, 68, 68, 0.06) !important;
}

/* Admin link */
.hdr-admin-link {
  font-size: 0.82em;
  font-weight: 500;
  color: #6b7280;
  padding: 0.3em 0.5em;
  border-radius: 0.35em;
  cursor: pointer;
  background: none;
  border: none;
  font-family: inherit;
  transition: color 0.2s, background 0.2s;
}
.hdr-admin-link:hover             { color: #111827; background: rgba(0,0,0,0.04) }
[data-theme="dark"] .hdr-admin-link           { color: #9ca3af }
[data-theme="dark"] .hdr-admin-link:hover {
  color: #f3f4f6;
  background: rgba(255,255,255,0.06);
}

/* ═══════════════════════════════════════════════
   MOBILE HAMBURGER + PANEL
   ═══════════════════════════════════════════════ */

/* Default: hidden on desktop */
.site-header .mobile-hamburger {
  display: none;
  width: 2.6em;
  height: 2.6em;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  z-index: 2;
}

.site-header .mobile-hamburger span {
  display: block;
  width: 26px;
  height: 2.5px;
  background: #374151;
  border-radius: 2px;
  transition: transform 0.35s cubic-bezier(.22, 1, .36, 1),
              opacity 0.25s ease,
              background 0.3s ease;
  transform-origin: center;
}
[data-theme="dark"] .site-header .mobile-hamburger span {
  background: #d1d5db;
}

/* X animation when open */
.site-header .mobile-hamburger.open span:nth-child(1) {
  transform: translateY(8.5px) rotate(45deg);
}
.site-header .mobile-hamburger.open span:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}
.site-header .mobile-hamburger.open span:nth-child(3) {
  transform: translateY(-8.5px) rotate(-45deg);
}

.site-header .mobile-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.3);
  z-index: 2999;
}
.site-header .mobile-overlay.open { display: block }

.site-header .mobile-panel {
  display: none;
  position: fixed;
  top: 0; right: 0;
  width: 75vw;
  max-width: 300px;
  height: 100vh;
  background: rgba(255, 255, 255, 0.97);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: -4px 0 30px rgba(0, 0, 0, 0.1);
  z-index: 3000;
  flex-direction: column;
  padding: 1.5em;
  gap: 0.3em;
  transform: translateX(100%);
  transition: transform 0.35s cubic-bezier(.22, 1, .36, 1);
  overflow-y: auto;
}
[data-theme="dark"] .site-header .mobile-panel {
  background: rgba(12, 10, 20, 0.97);
  box-shadow: -4px 0 30px rgba(0, 0, 0, 0.4);
}
.site-header .mobile-panel.open   { transform: translateX(0) }

.site-header .mobile-panel-close {
  align-self: flex-end;
  background: none;
  border: none;
  font-size: 1.3em;
  cursor: pointer;
  color: #374151;
  padding: 0.3em;
  margin-bottom: 0.5em;
  line-height: 1;
}
[data-theme="dark"] .site-header .mobile-panel-close { color: #d1d5db }

/* Mobile links */
.site-header .mobile-panel a,
.site-header .mobile-panel button.mob-link {
  display: flex;
  align-items: center;
  gap: 0.7em;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  font-family: inherit;
  font-size: 1em;
  font-weight: 500;
  color: #1f2937;
  padding: 0.75em 0.7em;
  border-radius: 0.6em;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.2s, transform 0.15s;
}
[data-theme="dark"] .site-header .mobile-panel a,
[data-theme="dark"] .site-header .mobile-panel button.mob-link { color: #e5e7eb }
.site-header .mobile-panel a:hover,
.site-header .mobile-panel button.mob-link:hover {
  background: rgba(79, 70, 255, 0.06);
}
.site-header .mobile-panel a:active,
.site-header .mobile-panel button.mob-link:active {
  transform: scale(0.98);
}
.site-header .mobile-panel button.mob-link svg {
  flex-shrink: 0;
  color: #6b7280;
}
[data-theme="dark"] .site-header .mobile-panel button.mob-link svg { color: #9ca3af }

/* Logout button */
.mob-logout-btn { color: #ef4444 !important }
.mob-logout-btn svg { color: #ef4444 !important }
[data-theme="dark"] .mob-logout-btn { color: #f87171 !important }
[data-theme="dark"] .mob-logout-btn svg { color: #f87171 !important }

/* Start button */
.mob-start-btn { color: #4f46ff !important; font-weight: 600 !important }
.mob-start-btn svg { color: #4f46ff !important }
[data-theme="dark"] .mob-start-btn { color: #818cf8 !important }
[data-theme="dark"] .mob-start-btn svg { color: #818cf8 !important }

.mob-divider {
  height: 1px;
  background: rgba(0, 0, 0, 0.08);
  margin: 0.5em 0;
}
[data-theme="dark"] .mob-divider { background: rgba(255, 255, 255, 0.06) }

/* Mobile user section */
.mob-user-section {
  display: none;
  padding: 0.6em;
  border-radius: 0.6em;
  background: rgba(79, 70, 255, 0.04);
  margin-bottom: 0.3em;
}
.mob-user-section.visible { display: block }
.mob-user-header {
  display: flex;
  align-items: center;
  gap: 0.5em;
  margin-bottom: 0.5em;
}
.mob-user-header .hdr-avatar { width: 2em; height: 2em; font-size: 0.85em }
.mob-user-name {
  font-weight: 700;
  font-size: 0.95em;
  color: #1f2937;
}
[data-theme="dark"] .mob-user-name { color: #e5e7eb }

/* Mobile bottom bar */
.mob-bottom-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5em 0.2em;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
}
[data-theme="dark"] .mob-bottom-bar { border-top-color: rgba(255, 255, 255, 0.06) }
.mob-lang-row {
  display: flex;
  align-items: center;
  gap: 0.35em;
}
.mob-theme-toggle {
  font-size: 1.2em;
  padding: 0.3em;
}

/* ═══════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════ */
@media (max-width: 860px) {
  .site-header { height: 5.5em }
  #app          { padding-top: 5.5em }

  /* ── Hide wave on mobile ── */
  .site-header::before { display: none }

  .site-header .header-inner { padding: 0 1.2em }

  .site-header .logo          { transform: translateY(0) }
  .site-header .logo img      { width: 5em }
  .site-header .brand-name    { font-size: 2em }
  .site-header .brand-sub     { font-size: 0.75em; margin-top: 0.15em }

  .site-header .main-nav      { display: none }
  .site-header .lang-switch   { display: none }
  .site-header .theme-toggle  { display: none }
  .site-header .start-btn     { display: none }
  .hdr-user-area              { display: none !important }
  .site-header .header-right  { transform: translateY(0); margin-right: 0.3em }

  .site-header .mobile-hamburger { display: flex }
  .site-header .mobile-panel     { display: flex }

  body:has(#app .auth-page) #app { padding-top: 0 !important }
}