/* ============================================================
   Astrozon – Responsive Foundation
   Nachrüstung: Mobile-first Grundlage für Jinja2/FastAPI-Stack
   ============================================================ */

/* --- Reset & Box Model --- */
*, *::before, *::after {
  box-sizing: border-box;
}

/* --- Body --- */
body {
  margin: 0;
  padding: 0;
  -webkit-text-size-adjust: 100%;
}

/* --- Bilder skalieren --- */
img, svg, video {
  max-width: 100%;
  height: auto;
  display: block;
}

/* --- Tabellen: horizontal scrollbar statt overflow --- */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

table {
  min-width: 100%;
}

/* Tabellen, die fixed-width haben: überschreiben */
table[style*="width"] {
  width: 100% !important;
  max-width: 100%;
}

/* --- Navigation --- */
nav, .nav, .navbar, .navigation {
  flex-wrap: wrap;
}

/* --- Container --- */
.container, .wrapper, .content, main {
  width: 100%;
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 16px;
  padding-right: 16px;
}

/* --- Karten / Panels --- */
.card, .panel, .box {
  width: 100%;
  max-width: 100%;
}

/* --- Formulare --- */
input, select, textarea, button {
  max-width: 100%;
}

/* ============================================================
   Breakpoints
   ============================================================ */

/* Mobile: bis 480px */
@media (max-width: 480px) {
  body {
    font-size: 15px;
  }

  /* Tabellen: Wrapper erzwingen */
  table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
  }

  /* Sidebar ausblenden oder stapeln */
  .sidebar, aside {
    width: 100%;
    float: none;
  }

  /* Flex-Layouts stapeln */
  .flex-row, .row, [class*="flex"] {
    flex-direction: column !important;
  }

  /* Fixed-width Elemente überschreiben */
  [style*="width: 8"], [style*="width: 9"], [style*="width: 10"],
  [style*="width: 11"], [style*="width: 12"] {
    width: 100% !important;
  }

  /* Horoskop-Chart-Container */
  .chart-container, .horoscope-chart, .jyotish-chart {
    width: 100% !important;
    overflow-x: auto;
  }

  /* Dashboard-Tabellen */
  #dashboard table,
  #research table,
  .research-results table {
    min-width: 600px;
  }
}

/* Tablet: 481px bis 768px */
@media (min-width: 481px) and (max-width: 768px) {
  .container, .wrapper {
    padding-left: 20px;
    padding-right: 20px;
  }

  .col-2, .col-3, .col-4 {
    width: 50%;
  }

  .sidebar {
    width: 100%;
    float: none;
    margin-bottom: 1rem;
  }
}

/* Desktop: ab 769px – keine Änderungen am bestehenden Layout */
@media (min-width: 769px) {
  .mobile-only {
    display: none;
  }
}

/* ============================================================
   Astrozon-spezifisch: Horoskop-Charts
   SVG-Wheel responsiv machen
   ============================================================ */
svg.natal-chart,
svg.transit-chart,
svg.rasi-chart,
.chart-svg-wrapper svg {
  width: 100%;
  height: auto;
  max-width: 560px;
  margin: 0 auto;
}

/* Share-Button (Mobile-Feature vorbereiten) */
.btn-share {
  display: none;
}

@media (max-width: 768px) {
  .btn-share {
    display: inline-flex;
    align-items: center;
    gap: 6px;
  }
}

/* --- Mobile Header (az-header) --- */
@media (max-width: 600px) {
  .az-header {
    padding: 0 16px;
    height: 52px;
  }
  .az-tagline {
    display: none;
  }
  .az-nav-links a:not([href*="logout"]):not([href*="abmeld"]) {
    display: none;
  }
}
