/* =========================================
   LAYOUT SYSTEM
   -----------------------------------------
   Basis-Layoutregelung für App + Navigation
   Enthält:
   - Topbar
   - Layout
   - Mobile Fixes
   ========================================= */

.topbar {
  height: calc(var(--topbar-height) + var(--safe-top));
  padding-top: var(--safe-top);
  padding-inline: var(--space-4);

  display: flex;
  align-items: center;
  justify-content: space-between;

  flex-shrink: 0;

  background: var(--color-glass);
  backdrop-filter: blur(8px);

  gap: var(--space-4);
}

.topbar__left {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-width: 0;
}

.topbar__title-wrap {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.topbar__title {
  font-size: var(--font-size-topbar-title);
  font-weight: 600;
}

.topbar__meta {
  font-size: var(--font-size-topbar-meta);
  opacity: 0.85;
}

.topbar__summary {
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  background: var(--color-summary);
  font-size: var(--font-size-summary);
  white-space: nowrap;
}

.topbar__actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-shrink: 0;
}

/* =========================
   APP LAYOUT
   ========================= */

.app-shell {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;

  /* Only safe-area padding (NO extra bottom space) */
  padding-bottom: var(--safe-bottom);
}

.viewport {
  flex: 1;
  width: 100vw;
  overflow: hidden;
  touch-action: pan-y;
}

.carousel {
  height: 100%;
  display: flex;
  transform: translateX(0);
  transition: transform var(--transition-carousel);
  will-change: transform;
}

.page {
  flex: 0 0 100vw;
  height: 100%;
}

/* =========================
   DASHBOARD
   ========================= */

.dashboard {
  height: 100%;
  display: grid;
  grid-template-rows: 65% 35%;
}

.dashboard__top {
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.dashboard__top-right {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
}

.dashboard__bottom {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
}

/* =========================
   GRID SECTIONS
   ========================= */

.sea-grid,
.upperair-grid {
  height: 100%;
  display: grid;
  grid-template-rows: repeat(3, 1fr);
}

.sea-row,
.upper-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
}

/* =========================
   THUMBBAR (DISABLED ON MOBILE)
   ========================= */

.thumbbar {
  position: fixed;
  left: 50%;
  bottom: calc(var(--safe-bottom) + var(--space-4));
  transform: translateX(-50%);

  display: none;

  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2);
  border-radius: var(--radius-pill);

  background: rgba(0, 0, 0, 0.62);
  backdrop-filter: blur(8px);

  z-index: var(--z-thumbbar);
}

/*
  CRITICAL FIX:
  Disable thumbbar completely on touch devices (iPhone / iPad)
*/
@media (hover: none) {
  .thumbbar {
    display: none !important;
  }
}

/* =========================
   MOBILE ADJUSTMENTS
   ========================= */

@media (max-width: 820px) {
  .topbar {
    padding-inline: var(--space-3);
  }

  .topbar__summary {
    max-width: 92px;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  /*
    IMPORTANT:
    No bottom toolbar anymore â†’ no extra padding required
  */
  .app-shell {
    padding-bottom: var(--safe-bottom);
  }
}
