/* ============================================================
   atlas-header.css – Header, Menü, Avatar/Name, Logout, Tablet-Burger und mobile Leisten
   Übernahme des HUB-Looks für ATLAS (Stand 10.11.2026). Quelle: hub.transpera.de,
   assets/css/style.css (Abschnitt HEADER) und assets/css/mobile.css (SHELL).
   Werte sind aufgelöst (keine HUB-Variablen), damit nichts mit ATLAS' eigenen Variablen kollidiert
   (in ATLAS ist --tp-primary Petrol #005a76, im HUB ist es #00202a).
   Handover und Einbau: deploy/atlas-header-handover.md

   Als eigene Datei /assets/atlas-header.css einbinden, NACH atlas.css.
   Im ATLAS-CSS gleichzeitig entfernen: Abschnitt HEADER (atlas.css ca. 73-114), Abschnitt FOOTER
   (ca. 332-369), den @media-Block "max-width: 640px" (ca. 377-383) und "padding-bottom: 90px" in main.
   ============================================================ */

/* ===== 1. Tokens ===== */
:root {
  --hd-h:        150px;      /* Höhe der Kopfzeile (Desktop und Tablet) */
  --hd-ink:      #00202a;    /* Kopfzeile, dunkle Flächen, aktiver Text */
  --hd-petrol:   #005a76;    /* Icon im aktiven Menüpunkt */
  --hd-cyan:     #00d1ff;    /* Avatar, Fokus-Ring, Tablet-Markierung (gleich wie im HUB, bewusst nicht die App-Farbe) */
  --hd-surface:  #ffffff;
  --hd-surface-3:#eef1f3;
  --hd-line:     #e5e8eb;
  --hd-text:     #23343c;
  --hd-text-2:   #5f6e74;
  --hd-text-4:   #9aacb5;

  /* --tp-app-accent, --tp-app-accent-rgb, --tp-app-accent-strong: definiert in atlas.css (:root) */
}

/* ===== 2. Schrift Inter (lokal, Datei aus dem HUB: assets/fonts/inter/InterVariable.woff2) ===== */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('/assets/fonts/inter/InterVariable.woff2') format('woff2');
}
header, .mobile-top-bar, .mobile-tab-bar, .mobile-more-sheet {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

/* ===== 3. Kopfzeile (Desktop ab 1024 px, Tablet 768-1023 px) ===== */
/* Logo mittig über dem Menü (Segmented Control), Benutzer und Aktionen oben rechts */
header { position:relative; flex-shrink:0; height:var(--hd-h); padding:0; color:#fff; background:var(--hd-ink); z-index:10000; box-shadow:0 4px 20px rgba(0,0,0,0.3); }
/* Leuchtlinie in der App-Farbe */
header::after { content:""; position:absolute; bottom:0; left:0; right:0; height:2px; background:linear-gradient(90deg, transparent 0%, rgba(var(--tp-app-accent-rgb),0.9) 50%, transparent 100%); }
.app-header-inner { position:relative; height:100%; display:flex; flex-direction:column; align-items:center; justify-content:center; }

/* Logo: einzeilige Fassung, Höhe verbindlich 44 px (Desktop) / 36 px (Tablet), Breite ergibt sich */
header .logo { position:relative; z-index:2; margin-bottom:12px; transition:transform 0.3s ease, filter 0.3s ease; }
header .logo:hover { transform:translateY(-3px); filter:drop-shadow(0 6px 20px rgba(var(--tp-app-accent-rgb),0.6)); }
header .logo img { display:block; height:44px; width:auto; filter:drop-shadow(0 2px 8px rgba(var(--tp-app-accent-rgb),0.3)); transition:filter 0.3s ease; }
header .logo:hover img { filter:drop-shadow(0 4px 16px rgba(var(--tp-app-accent-rgb),0.7)); }

/* Menü: Segmented Control */
header .menu { position:relative; z-index:2; display:flex; gap:2px; padding:4px; border-radius:12px; background:rgba(255,255,255,0.06); border:1px solid rgba(255,255,255,0.10); }
header .menu a { text-decoration:none; }
header .menu a button { display:inline-flex; align-items:center; gap:7px; background:transparent; color:rgba(255,255,255,0.72); border:0; padding:7px 14px; border-radius:9px; font-size:13px; font-weight:500; white-space:nowrap; cursor:pointer; font-family:inherit; transition:background 0.15s, color 0.15s; }
header .menu a button:hover { background:rgba(255,255,255,0.06); color:#fff; }
header .menu a button i { font-size:14px; color:inherit; }
header .menu a button.active { background:var(--hd-surface); color:var(--hd-ink); font-weight:600; }
header .menu a button.active i { color:var(--hd-petrol); }
header .menu a button:focus-visible, header .burger:focus-visible { outline:2px solid var(--hd-cyan); outline-offset:2px; }

/* Nur im Tablet-Menü sichtbar (Abschnitt 4) */
.menu-user-info { display:none; }
.menu-divider { display:none; border:none; border-top:1px solid rgba(255,255,255,0.08); margin:4px 0 8px; }

.burger { display:none; width:40px; height:40px; flex-shrink:0; border:0; border-radius:10px; background:rgba(255,255,255,0.08); align-items:center; justify-content:center; font-size:20px; color:#fff; cursor:pointer; }

/* Aktionen oben rechts: Benutzer (Avatar + Name), Logout, Burger */
.header-actions { position:absolute; top:42px; right:28px; transform:translateY(-50%); z-index:10; display:flex; align-items:center; gap:10px; color:rgba(255,255,255,0.85); font-size:13px; }

/* Benutzer: Avatar mit Kürzel (max. 3 Zeichen) und Name */
.app-user { display:inline-flex; align-items:center; gap:10px; padding:4px 4px; border-radius:999px; background:rgba(255,255,255,0.06); border:1px solid rgba(255,255,255,0.12); color:#fff; cursor:default; }
.app-avatar { width:32px; height:32px; border-radius:50%; flex-shrink:0; display:inline-flex; align-items:center; justify-content:center; background:var(--tp-app-accent); color:var(--hd-ink); font-weight:700; font-size:12px; }   /* App-Farbe statt HUB-Cyan (Wunsch Marc, 10.11.2026) */
.app-user-name { display:none; max-width:200px; padding-right:10px; font-size:13px; font-weight:500; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
@media (min-width:1100px) { .app-user-name { display:block; } }
/* Breite Fenster: Benutzer und Aktionen auf Höhe der Menüleiste (darunter würden sie das Menü überdecken) */
@media (min-width:1500px) { .header-actions { top:106px; } }
@media (min-width:1500px) and (max-width:1699px) { .app-user-name { display:none; } }

/* Logout-Knopf. content-box ist Absicht: im HUB gibt es kein globales border-box, der Knopf misst dort 35x35 px
   (34 + 2 x 0,5 px Rand). ATLAS hat "* { box-sizing: border-box }", daher hier ausdrücklich zurücksetzen. */
.btn-logout { box-sizing:content-box; display:inline-flex; align-items:center; justify-content:center; width:34px; height:34px; background:rgba(255,255,255,0.08); color:rgba(255,255,255,0.6); border:0.5px solid rgba(255,255,255,0.15); border-radius:8px; font-size:15px; cursor:pointer; font-family:inherit; transition:all 0.2s; text-decoration:none; }
.btn-logout:hover { background:rgba(255,255,255,0.15); color:#fff; border-color:rgba(255,255,255,0.3); }
.btn-logout i { font-size:15px; color:inherit; }

/* ===== 4. Tablet 768-1023 px: Logo 36 px, Menü hinter dem Burger ===== */
@media (max-width:1023px) { header .logo img { height:36px; } }
@media (min-width:768px) and (max-width:1023px) {
  .burger { display:flex; }
  header .menu { display:none; flex-direction:column; position:fixed; top:var(--hd-h); left:12px; right:12px; padding:14px; background:rgba(0,32,42,0.97); backdrop-filter:blur(12px); border-radius:14px; border:1px solid rgba(255,255,255,0.08); box-shadow:0 14px 36px rgba(0,0,0,0.45); z-index:999; }
  header .menu.show { display:flex; }
  header .menu a button { width:100%; justify-content:flex-start; border-radius:10px; padding:11px 14px; }
  header .menu a button.active { background:rgba(255,255,255,0.08); color:#fff; border-left:3px solid var(--hd-cyan); }
  header .menu a button.active i { color:var(--hd-cyan); }
  .menu-user-info { display:flex; align-items:center; gap:9px; padding:6px 14px 10px; color:rgba(255,255,255,0.55); font-size:12px; font-weight:600; text-transform:uppercase; letter-spacing:0.5px; }
  .menu-user-info i { color:var(--hd-cyan); font-size:15px; }
  .menu-divider { display:block; }
  .app-user { display:none; }
}

/* ===== 5. Mobil unter 768 px: Kopfzeile weg, obere Leiste + untere Tab-Leiste ===== */
@media (max-width: 767px) {

  /* Desktop-Header komplett ausblenden, Navigation übernimmt die Tab-Leiste */
  header { display: none !important; }

  /* Body: kein Hintergrundbild, solide Fläche; Platz für die Tab-Leiste */
  body {
    background-image: none;
    background-color: var(--hd-surface-3);
    padding-bottom: calc(62px + env(safe-area-inset-bottom, 0px));
  }

  /* Main füllt den Raum zwischen oberer Leiste (44 px) und Tab-Leiste (62 px + Safe-Area). Nicht 100dvh verwenden,
     sonst ist die Seite immer höher als der Viewport. Unten kein Innenabstand (die Tab-Leiste bekommt ihren Platz
     über das body-padding oben); Seitenabstände und Hintergrund von main bleiben ATLAS-eigen. */
  main {
    min-height: calc(100dvh - 44px - 62px - env(safe-area-inset-bottom, 0px));
    padding-bottom: 0;
  }

  /* ---- Obere Leiste: Seitenname links, Logo mittig (32 px hoch), rechts leer ---- */
  /* content-box wie im HUB: 44 px Höhe + 1 px Linie = 45 px */
  .mobile-top-bar {
    box-sizing: content-box;
    position: relative;
    display: flex;
    align-items: center;
    background: linear-gradient(180deg, rgb(0,45,59) 0%, rgb(0,35,46) 100%);
    color: #fff;
    padding: 0 16px;
    height: 44px;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    border-bottom: 1px solid rgba(0,184,212,0.3);
  }
  .mobile-top-bar__logo   { position: absolute; left: 50%; transform: translateX(-50%); height: 32px; width: auto; }
  /* Seitenname endet vor dem zentrierten Logo (ATLAS-Logo bei 32 px: ca. 177 px breit, also halbe Breite 88 px) */
  .mobile-top-bar__page   { flex: 1; max-width: calc(50% - 16px - 88px - 8px); font-size: 13px; font-weight: 500; opacity: 0.85; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .mobile-top-bar__spacer { flex: 1; }

  /* ---- Untere Tab-Leiste: 62 px + Safe-Area ---- */
  .mobile-tab-bar {
    box-sizing: content-box;
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 62px;
    padding-bottom: env(safe-area-inset-bottom, 0px);
    background: var(--hd-surface);
    border-top: 1px solid var(--hd-line);
    box-shadow: 0 -2px 10px rgba(0,0,0,0.08);
    z-index: 900;
  }
  .mtb-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: 8px 4px;
    color: var(--hd-text-4);
    text-decoration: none;
    font-size: 10px;
    font-weight: 500;
    line-height: 1.2;
    background: none;
    border: none;
    cursor: pointer;
    transition: color 0.15s;
    -webkit-tap-highlight-color: transparent;
    font-family: inherit;
  }
  .mtb-item i { font-size: 20px; line-height: 1; }
  .mtb-item.active,
  .mtb-item.active i { color: var(--hd-ink); }

  /* ---- "Mehr"-Sheet (Bottom Drawer) ---- */
  .mobile-more-sheet { position: fixed; inset: 0; z-index: 950; }
  .mobile-more-sheet[hidden] { display: none; }
  .mobile-more-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,0.35); }
  .mobile-more-menu {
    position: absolute;
    bottom: 62px;
    left: 0;
    right: 0;
    background: var(--hd-surface);
    border-radius: 14px 14px 0 0;
    padding: 12px 0 calc(4px + env(safe-area-inset-bottom, 0px));
    box-shadow: 0 -4px 20px rgba(0,0,0,0.12);
  }
  .mobile-more-handle { width: 36px; height: 4px; background: var(--hd-line); border-radius: 2px; margin: 0 auto 12px; }
  .more-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 20px;
    color: var(--hd-text);
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
  }
  .more-item i { width: 22px; text-align: center; color: var(--hd-text-2); font-size: 17px; }
  .more-item.active,
  .more-item.active i { color: var(--hd-ink); }
  .more-divider { height: 1px; background: var(--hd-line); margin: 6px 0; }
  .more-item--logout { color: var(--hd-text-4); }
  .more-item--logout i { color: var(--hd-text-4); }
}

/* Desktop und Tablet: mobile Leisten ausblenden */
@media (min-width: 768px) {
  .mobile-tab-bar,
  .mobile-more-sheet,
  .mobile-top-bar { display: none !important; }
}
