/* ========================================
   base_pwa.css
   Globale Layout-Korrekturen für iOS/Android PWA
   + einheitlicher Footer für alle Seiten
   ======================================== */

/* Standard-Layout (Browser) – keine Safe-Area Tricks */
body {
  padding-top: 0;
  padding-bottom: 0;
}

/* -------------------------------------------------
   PWA-Modus (body.pwa-mode wird in app.js gesetzt)
------------------------------------------------- */
body.pwa-mode {
  background-color: var(--cc-content-bg, #0d1b2a);
  color: var(--cc-content-text, #fff);
  overscroll-behavior: none;
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* === HEADER (nur in PWA fixen) === */
body.pwa-mode .cc-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: var(--cc-header-footer-bg, var(--cc-bg, #0d1b2a));
  border-bottom: 1px solid var(--cc-border, #23364f);
  padding-top: env(safe-area-inset-top);
  height: calc(60px + env(safe-area-inset-top));
  z-index: 200;

  display: flex;
  align-items: flex-end;
}

/* Innerer Header-Container – Inhalt bleibt gleich,
   nur die Geometrie kommt von hier */
body.pwa-mode .cc-header-inner {
  height: 60px;
  width: 100%;
  display: flex;
  justify-content: center; /* Titel mittig, Icons können absolut sein */
  align-items: center;
  padding: 0 16px;
}

/* === MAIN CONTENT (z. B. Chats, Profile) === */
body.pwa-mode main,
body.pwa-mode .cc-main {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-top: calc(60px + env(safe-area-inset-top));           /* Platz unter dem Header */
  padding-bottom: calc(60px + env(safe-area-inset-bottom));     /* Platz über dem Footer */
  background: var(--cc-content-bg, var(--cc-bg, #0d1b2a));
}

/* ========================================
   GLOBAL FOOTER – für Browser & PWA gleich
   ======================================== */

/* Standard-Footer (Browser + PWA-Basis) */
.cc-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;

  background: var(--cc-header-footer-bg, var(--cc-bg, #0d1b2a));
  border-top: 1px solid var(--cc-border, #23364f);

  display: flex;
  justify-content: space-around;
  align-items: stretch;

  height: 60px;
  z-index: 150;
}

/* Footer in PWA mit Safe-Area unten */
body.pwa-mode .cc-footer {
  height: calc(60px + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
}

/* Footer-Links (Tabs) – füllen immer die komplette Footer-Höhe */
.cc-footer a {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;

  height: 100%;
  color: var(--cc-muted, #8ca3bc);
  font-size: 13px;
  text-decoration: none;
  line-height: 1;
}

/* Icons im Footer – überall identisch */
.cc-footer a i {
  font-size: 18px;
  margin-bottom: 4px;
  line-height: 1;
}

/* Active/Hover Zustand */
.cc-footer a.active,
.cc-footer a:hover {
  color: var(--cc-accent-2, #5aa0ff);
}

/* === MODALS === */
body.pwa-mode .cc-modal {
  inset: 0;
  padding-top: env(safe-area-inset-top);
  padding-bottom: env(safe-area-inset-bottom);
}

/* === COMPOSER (z. B. Chatrooms) === */
body.pwa-mode .gc-composer {
  padding-bottom: calc(env(safe-area-inset-bottom) + 8px);
}

/* === INPUT FIXES (verhindert iOS Zoom bei Fokus) === */
body.pwa-mode input,
body.pwa-mode textarea {
  font-size: 16px;
}

/* === Utility === */
body.pwa-mode .hidden {
  display: none !important;
}