/* ==========================================
 * KGVPro - Responsive / Mobile Styles
 * ========================================== */


/* ==================== Hamburger Button ==================== */

.hamburger-btn {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  width: 28px;
  height: 20px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  margin-right: 12px;
  flex-shrink: 0;
}

.hamburger-btn span {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--color-4);
  border-radius: 2px;
  transition: transform 0.25s ease, opacity 0.25s ease;
}

.hamburger-btn.active span:nth-child(1) { transform: translateY(9px) rotate(45deg); }
.hamburger-btn.active span:nth-child(2) { opacity: 0; }
.hamburger-btn.active span:nth-child(3) { transform: translateY(-9px) rotate(-45deg); }


/* ==================== Mobile Overlay ==================== */

.mobile-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 150;
}

.mobile-overlay.active {
  display: block;
}


/* ==================== Tablet (≤ 900px) ==================== */

@media (max-width: 900px) {
  .verein-selector { width: 180px; }

  .card-feature-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}


/* ==================== Mobile (≤ 767px) ==================== */

@media (max-width: 767px) {

  /* --- Hamburger sichtbar --- */
  .hamburger-btn {
    display: flex;
  }

  /* --- Sidebar: fixed, von links einfahren --- */
  .sidebar {
    position: fixed;
    top: 0;
    left: -265px;
    height: 100vh;
    width: 250px;
    z-index: 200;
    overflow-y: auto;
    transition: left 0.3s ease;
    padding-top: 80px;
  }

  .sidebar.mobile-open {
    left: 0;
  }

  body.mobile-menu-open {
    overflow: hidden;
  }

  /* --- Main-Layout: Sidebar raus, Content full width --- */
  .main-member {
    flex-direction: column;
  }

  .content,
  .content-verein,
  .content-parzellen,
  .content-personen,
  .content-finanzen,
  .content-einstellungen,
  .content-admin {
    min-width: 0;
    width: 100%;
    padding: 12px;
    box-sizing: border-box;
  }

  /* --- Header --- */
  .header-logo img    { height: 38px; }
  .verein-selector    { width: 150px; }
  .header-user .user-role { display: none; }

  /* --- Page Header: 2-spaltig --- */
  .page-header {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    padding: 10px;
  }
  .page-header-col1-2 { grid-column: 1 / -1; }
  .page-header-col4   { grid-column: 1 / -1; order: -1; }

  /* --- Form Rows: stapeln --- */
  .form-row {
    flex-direction: column;
  }

  /* --- Tabellen: Rand entfernen für edge-to-edge Scroll --- */
  .table-container {
    margin: 0 -12px;
    border-radius: 0;
    width: calc(100% + 24px);
  }

  /* --- Modal: fast full-screen --- */
  .modal-box,
  .modal-l,
  .modal-xl {
    width: 96vw !important;
    max-height: 90vh;
    overflow-y: auto;
  }

  /* --- Öffentliche News-Seite --- */
  .news-page   { padding: 0 5px; }
  .news-item   { padding: 20px 15px; }

  /* --- Subheader: horizontal scrollbar --- */
  .subheader-container {
    justify-content: flex-start;
    overflow-x: auto;
    gap: 0;
    padding: 0;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .subheader-container::-webkit-scrollbar { display: none; }

  .subheader-link {
    padding: 12px 14px;
    font-size: 0.85rem;
    white-space: nowrap;
  }
}


/* ==================== Smartphone (≤ 480px) ==================== */

@media (max-width: 480px) {

  /* Header: User-Bereich ausblenden */
  .header-user { display: none; }

  /* Page Header: 1-spaltig */
  .page-header {
    grid-template-columns: 1fr;
  }

  .page-header [class*="page-header-col"] {
    grid-column: 1 / -1;
  }

  /* Tabellen: kompakter */
  .data-table thead th {
    font-size: 0.65rem;
    padding: 8px 10px;
  }

  .data-table td {
    padding: 10px;
    font-size: 0.85rem;
  }

  /* Landing: feature grid 1-spaltig */
  .card-feature-grid,
  .card-news-grid {
    grid-template-columns: 1fr;
  }
}
