/* design-system.css */

/* =========================
   RESET + VARS
========================= */
*,
*::before,
*::after { box-sizing: border-box; }

:root{
  --textwhite: #ffffff;
  --textblack: #000000;

  --mainbuttonbg: #cc0000;
  --mainbuttontxt: #ffffff;

  --background: #05064f;

  --headerbg: #cc0000;
  --headertxt: #ffffff;

  --footerbg: #cc0000;
  --footertxt: #ffffff;

  --toastbg: #ffffff;
  --toasttxt: #ff0000;

  --header-h: 40px;
  --footer-h: 30px;

  /* Footer-Gesamthöhe inkl. Safe-Area */
 --footer-total: var(--footer-h);
}

/* =========================
   HARD LOCK PAGE (PWA-sicher)
========================= */
html, body{
  margin: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--background);

  /* ✅ Fix #1: iOS / PWA Overscroll killen */
  overscroll-behavior: none;
}

body.mainbody{
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;

  font-family: system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--textwhite);
}

/* =========================
   APPFRAME: OHNE Footer-Row
   -> Footer ist fixed ausserhalb
========================= */
.appframe{
  position: fixed;
  inset: 0;

  /* Platz für fixed Footer reservieren */
  padding-bottom: var(--footer-total);

  display: grid;
  grid-template-rows:
    calc(var(--header-h) + env(safe-area-inset-top))
    auto
    1fr;

  min-height: 0;
}

/* =========================
   HEADER
========================= */
.mainheader{
  padding-top: env(safe-area-inset-top);
  height: calc(var(--header-h) + env(safe-area-inset-top));

  background: var(--headerbg);
  color: var(--headertxt);

  font-size: 20px;
  font-weight: 600;
  letter-spacing: 0.35px;

  display: flex;
  align-items: center;
  justify-content: center;
}

/* =========================
   SCROLLAREA (nur hier!)
========================= */
.scrollarea{
  min-height: 0;

  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;

  padding: 14px;
  text-align: center;

  /* ✅ Fix #1: Scroll bleibt im Element (kein chain) */
  overscroll-behavior: contain;
}

/* =========================
   FOOTER (immer unten)
========================= */
.mainfooter{
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;

  height: var(--footer-h);

  background: var(--footerbg);
  color: var(--footertxt);

  display:flex;
  align-items:center;
  justify-content:center;

  z-index: 999999;
  overflow: hidden;
  touch-action: manipulation;
}

/* =========================
   BUTTONS
========================= */
.mainbutton{
  width: 90%;
  height: 40px;
  border-radius: 9999px;
  border: 0;

  background: var(--mainbuttonbg);
  color: var(--mainbuttontxt);

  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.25px;

  margin: 12px auto;
  display: block;

  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.mainbutton:active{ transform: scale(0.98); }

/* Grid Scroll Fix */
.alarmbar, .alarmcard, .alarmcontent { min-height: 0; }

/* ✅ Fix #1: Scroll bleibt auch in Alarm-Scroller/Menu */
.alarmcontent,
.alarmmenu{
  overscroll-behavior: contain;
}

/* =========================================
   GLOBAL FOOTER LAYOUT (3 Bereiche)
========================================= */

.mainfooter {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 0 16px;
  font-size: 12px;
}

.mainfooter-left {
  text-align: left;
  opacity: .75;
}

.mainfooter-center {
  text-align: center;
  font-weight: 600;
}

.mainfooter-right {
  text-align: right;
  opacity: .75;
}

/* =========================================
   Versionsinfo Modal
========================================= */

.mainfooter-right button.footer-version-btn {
  all: unset;
  cursor: pointer;
  display: inline-block;
  text-align: right;
  opacity: .75;
  padding: 6px 0;
}
.mainfooter-right button.footer-version-btn:active {
  opacity: 1;
}

.fwModalBackdrop {
  position: fixed;
  inset: 0;
  z-index: 100000;
  background: rgba(0,0,0,.65);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  box-sizing: border-box;
}

.fwModalCard {
  width: min(520px, 100%);
  background: #05064f;                 
  color: #fff;                          
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 18px;
  padding: 18px;
  box-shadow: 0 20px 60px rgba(0,0,0,.35);
}

.fwModalTitle {
  font-weight: 900;
  font-size: 18px;
  margin: 0 0 12px 0;
}

.fwModalList {
  font-size: 14px;
  line-height: 1.5;
  background: rgb(255, 255, 255);
  border-radius: 14px;
  padding: 12px;

  color: #111;
  border: 1px solid rgba(243, 236, 236, 0.18);
}

.fwModalRow {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 0;
  border-bottom: 1px solid rgba(0,0,0,.3);
}
.fwModalRow:last-child {
  border-bottom: none;
}

.fwModalKey {
  font-weight: 800;
  opacity: .85;
  white-space: nowrap;
  color: #111;
}
.fwModalVal {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  text-align: right;
  word-break: break-word;
  opacity: .95;
  color: #111;
}

.fwModalActions {
  margin-top: 14px;
}
.fwModalOkBtn {
  width: 100%;
  padding: 12px 16px;
  border: none;
  border-radius: 999px;
  font-weight: 900;
  font-size: 15px;
  background: #d62828;
  color: #fff;
  cursor: pointer;
}

/* =========================================
   created by joe 
========================================= */
.footer-about-btn{
  all: unset;
  cursor: pointer;
  display: inline-block;
  opacity: .75;
  padding: 6px 0;
}
.footer-about-btn:active{
  opacity: 1;
}


