/*
 * TeamFilz — Mobile & PWA CSS-Patch
 */

/* ── 1 + 2: Tap-Optimierungen ────────────────────────────────────────────── */
button,
a,
[role="button"],
.btn,
.bnav-btn,
.menu-btn,
.mini-btn,
.events-add-btn,
.events-filter-btn,
.icon-action-btn,
.cal-nav,
.cal-chip,
.cal-day,
.self-tab,
.events-tab,
.team-switcher-btn,
.team-switcher-item,
.app-header-icon-btn,
.icon-row-btn,
.lp-cta,
.legal-close,
.roster-rsvp-btns button {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

/* ── 3: Kein Rubber-Band-Scroll im PWA-Standalone-Modus ─────────────────── */
html,
body {
  overscroll-behavior: none;
}

.roster-modal-body,
.table-wrap,
.output,
.member-import-preview,
.app-sidebar.is-open {
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

/* ── 4: backdrop-filter entfernt (Design-System: kein blur) ─────────────── */
#confirmModal {
  background: rgba(14, 28, 54, 0.55);
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}

/* ── 5: Momentum-Scroll für Modal-Bodies ─────────────────────────────────── */
.roster-modal-body,
.legal-modal,
.legal-backdrop {
  -webkit-overflow-scrolling: touch;
}

/* ── 6: PWA Standalone — Statusbar-Padding & Input-Zoom-Fix ─────────────── */
@media (display-mode: standalone) {
  .app-header {
    padding-top: max(8px, env(safe-area-inset-top, 8px));
  }
  .lp-nav {
    padding-top: max(0px, env(safe-area-inset-top, 0px));
    height: calc(72px + env(safe-area-inset-top, 0px));
  }
}

input:not([type="range"]),
select,
textarea {
  font-size: max(16px, 1em);
}

/* ── 7: Offline-Indikator ─────────────────────────────────────────────────── */
.offline-banner {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 2000;
  background: #c8232c;
  color: #fff;
  font-size: 0.82rem;
  font-weight: 600;
  text-align: center;
  padding: 6px 14px;
  letter-spacing: 0.01em;
}
body.is-offline .offline-banner {
  display: block;
}
body.is-offline .app-header {
  top: 29px;
}

/* ── 8: PWA-Install-Banner ────────────────────────────────────────────────── */
.pwa-install-banner {
  display: flex;
  position: fixed;
  bottom: max(72px, calc(56px + env(safe-area-inset-bottom, 16px)));
  left: 14px;
  right: 14px;
  z-index: 800;
  background: #0d1b2a;
  color: #fff;
  border-radius: 14px;
  padding: 14px 16px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
  align-items: center;
  gap: 12px;
  animation: _bannerIn 0.25s ease;
}
.pwa-install-banner.is-hidden {
  display: none;
}
@keyframes _bannerIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
.pwa-install-banner-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  flex-shrink: 0;
  object-fit: cover;
}
.pwa-install-banner-text {
  flex: 1;
  min-width: 0;
}
.pwa-install-banner-title {
  font-weight: 700;
  font-size: 0.9rem;
  line-height: 1.3;
}
.pwa-install-banner-sub {
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.6);
  margin-top: 2px;
}
.pwa-install-banner-btn {
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #fff;
  font-weight: 700;
  font-size: 0.82rem;
  border-radius: 8px;
  padding: 7px 14px;
  cursor: pointer;
  white-space: nowrap;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.15s;
}
.pwa-install-banner-btn:hover {
  background: rgba(255, 255, 255, 0.25);
}
.pwa-install-banner-close {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.5);
  font-size: 1.2rem;
  cursor: pointer;
  padding: 4px;
  line-height: 1;
  flex-shrink: 0;
  touch-action: manipulation;
}

/* ── Sonstige mobile Verbesserungen ──────────────────────────────────────── */
.bnav-btn,
.mini-btn,
.menu-btn,
.event-card-head,
.event-weekday {
  user-select: none;
  -webkit-user-select: none;
}

@media (max-height: 500px) and (max-width: 860px) {
  .roster-modal,
  #confirmBox,
  #cropBox {
    max-height: 95vh;
    overflow-y: auto;
  }
}

@media (max-width: 380px) {
  .cal-chip {
    font-size: 0;
    padding: 4px;
    border-radius: 50%;
    width: 8px;
    height: 8px;
    min-width: 0;
  }
}
