body {
    background-color: #f9f9f9;
    text-align: center;
    font-size: 1rem;
    font-family: Arial, sans-serif;
    line-height: 1.5;
}

table {
    margin: auto;
    width: 40%;
    border-collapse: collapse;
}

th, td {
    padding: 10px;
    text-align: right;
}

h2, h3 {
    text-align: center;
    font-size: 1.3rem;
}

input,
button,
select,
textarea {
    font-size: 1rem; /* gleiche Größe wie body */
    font-family: inherit;
}

.hinweis-box {
    margin-top: 1em;
    padding: 0.8em;
    background-color: #e8f4ea;
    border-left: 4px solid #4CAF50;
    font-weight: bold;
    border-radius: 4px;
}

.fehler-box {
    background-color: #ffe0e0;
    color: #a00;
    padding: 0.5rem;
    margin-bottom: 1rem;
    border: 1px solid #d00;
    border-radius: 4px;
}

/* Navigation */

.topnav {
    background-color: #007bff;
    color: white;
    width: 100%;
    padding: 0.5rem 1rem;
    box-sizing: border-box;
    position: relative;
}

.container-topnav {
    max-width: 960px;
    margin: 0 auto;
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.topnav .logo {
    padding: 0 5px;
    font-weight: bold;
    font-size: 1.2rem;
    /* background-color: #63afff; */
    padding: 0.3rem 0.3rem 0;
    border-radius: 0.9rem;
    /* box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3); */
    /* -webkit-filter: drop-shadow(1px 1px 1px #292929);
    filter: drop-shadow(1px 1px 1px #292929); */
}

.topnav .logo:hover {
    background-color: #a2cfff;
}

.topnav ul {
    list-style: none;
    display: flex;
    gap: 1rem;
    margin: 0;
    padding: 0;
}

.topnav ul li a {
    color: white;
    text-decoration: none;
    padding: 0.4rem 0.8rem;
    border-radius: 1.3rem;
    transition: background-color 0.3s ease;
}

.topnav ul li a:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.topnav ul li a.active {
    background-color: #e2f0ff;
    color: #007bff;
}

.nav-center-mobile {
    flex: 1;
    text-align: center;
    font-weight: bold;
    font-size: 1.5rem;
    color: white;
    display: none;
}

/* Burger-Button */
.burger {
    display: none;
    font-size: 1.5rem;
    background: none;
    color: white;
    border: none;
    cursor: pointer;
}

/* Mobile Layout */
@media (max-width: 768px) {
    .topnav {
        flex-direction: column;
        align-items: center;
        position: relative;
    }

    .topnav .logo {
        font-weight: bold;
        font-size: 1.2rem;
        line-height: 1.6;
        padding: 0.3rem 0.3rem 0;
    }

    .container-topnav {
        display: flex;
        align-items: center;
        justify-content: space-between;
        position: relative;
    }

    .nav-center-mobile {
        display: block;
        position: absolute;
        left: 58%;
        transform: translateX(-50%);
    }

    .burger {
        display: block;
        margin-left: auto;
    }

    #nav-links {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background-color: #007bff;
        display: none;
        flex-direction: column;
        width: 100%;
        z-index: 999;
        gap: 0;
    }

    #nav-links.show {
        display: flex;
    }

    #nav-links li {
        width: 100%;
    }

    #nav-links li a {
        padding: 1rem;
        display: block;
        text-align: center;
    }
}

/* Standard: normale Tabelle anzeigen */

/* Tabelle: Grundstil */
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
    font-family: sans-serif;
    font-size: 0.95rem;
}

/* Tabellenzellen: zentriert & Rahmen */
table th, table td {
    padding: 0.75rem;
    text-align: center;
    border: 1px solid #ddd;
}

/* Tabellenkopf: Blau mit weißem Text */
table thead th {
    background-color: #007bff;
    color: white;
    font-weight: bold;
}

/* ➕ Abgerundete Ecken für Kopf links und rechts */
table thead th:first-child {
    border-top-left-radius: 0.5rem;
}
table thead th:last-child {
    border-top-right-radius: 0.5rem;
}

/* ✨ Jede zweite ZEILE hellgrau */
table tbody tr:nth-child(even) {
    background-color: #d1d1d1;
}

/* Hover-Effekt */
table tbody tr:hover {
    background-color: #f1f1f1;
}

.table-desktop {
    display: table;
    width: 90%;
    max-width: 960px;
    margin: 1rem auto 2rem;
    border-collapse: collapse;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.table-mobile {
    display: none;
}

/* Mobile Darstellung */
@media (max-width: 768px) {
    .table-desktop {
        display: none;
    }

    .table-mobile {
        display: block;
        width: 90%;
        max-width: 500px;
        margin: 1rem auto;
        font-size: 0.95rem;
        line-height: 1.4;
    }

    .table-mobile .card {
        background: #fefefe; /* leichtes Off-White */
        margin-bottom: 1rem;
        padding: 1rem 1.2rem;
        border-radius: 8px;
        box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
        transition: box-shadow 0.2s ease-in-out;
        border: 1px solid #e0e0e0;
    }

    /* ✨ Hover: leichtes Anheben für mehr Dynamik */
    .table-mobile .card:hover {
        box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    }

    /* ♻️ Abwechselnde Hintergrundfarben für Karten */
    .table-mobile .card:nth-child(even) {
        background-color: #f8f9fa;
    }

    .table-mobile .card strong {
        display: block;
        margin-top: 0.75rem;
        margin-bottom: 0.25rem;
        color: #333;
        border-bottom: 1px solid #eee;
        padding-bottom: 0.2rem;
        font-weight: 600;
    }

    /* 💡 Zahlenwerte optisch hervorheben */
    .table-mobile .wert {
        font-weight: bold;
        color: #002fff;
    }

    .card-top-row {
        background-color: #c8e3ff;
        border-top-left-radius: 8px;
        border-top-right-radius: 8px;
        padding-left: 8px;
        display: flex;
        justify-content: space-between;
        gap: 1rem;
        margin-bottom: 0.5rem;
    }

    .card-top-row div {
        display: flex;
        gap: 0.25rem;
        align-items: baseline;
    }
    
    .card-top-row span {
        flex: 1;
        padding-right: 0.5rem;
    }

    .card-top-row strong {
        border-bottom: none !important;
        display: inline;
        border-bottom: none;
        margin: 0;
        padding: 0;
    }
}

canvas {
    display: block;
    margin: auto;
    width: 90%;
    max-width: 960px;
}

#ablaufmengeChart {
    margin: 0 auto 40px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    border-radius: 0.5rem;
}

.chart-modal {
    display: none; 
  }

/* Chart responsiv mit 4:3 Seitenverhältnis */
@media (max-width: 768px) {
    #ablaufmengeChart {
        width: 100%;
        max-width: 85vw;
        aspect-ratio: 4 / 3;
        margin: 0 auto 40px;
        display: block;
        box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    }

    .chart-modal {
    display: none; /* 🚫 Anfangszustand: verborgen */
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.6);
    z-index: 9999;
  }

  .chart-modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .chart-modal-content {
    background: white;
    border-radius: 10px;
    padding: 1rem;
    max-width: 100vw;
    max-height: 100vh;
    width: 95vw;
    height: 95vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.2);
  }

  .chart-modal-close {
    align-self: flex-end;
    font-size: 1.5rem;
    color: #333;
    cursor: pointer;
    margin-bottom: 0.5rem;
  }

  #chartModalCanvas {
    /* flex: 1; */
    width: 100% !important;
    height: auto !important;
  }

  @media (orientation: portrait) {
    #chartModalCanvas {
      height: 60vh !important; /* oder 65vh oder 70vh, wenn du mehr willst */
    }
  }

  body.modal-open {
    overflow: hidden; /* 🚫 Verhindert Scrollen im Hintergrund */
  }

  /* Inhalt im Modal rotieren */
    .chart-modal-content.rotate {
        transform-origin: center center;
        width: 100vh;
        height: 100vw;
        overflow: hidden;
    }

    /* Damit Inhalt nicht abgeschnitten wird */
    .chart-modal canvas {
        width: 100vw !important;
        height: auto !important;
    }

    @media (max-width: 768px) and (orientation: landscape) {
        .chart-modal {
          padding: 0;
        }
      
        .chart-modal-content {
          width: 100vw !important;
          height: 100vh !important;
          max-width: 100vw !important;
          max-height: 100vh !important;
          border-radius: 0;
          padding: 0;
          margin: 0;
          box-shadow: none;
        }
      
        #chartModalCanvas {
          width: 100vw !important;
          height: 100vh !important;
          display: block;
        }
      }
}

/* Formular index.php */

.form-wrapper {
    max-width: 400px;
    min-width: 250px;
    background-color: #ffffff;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    text-align: left;
}

    select[name="schieberForm"] {
        font-size: 1.1rem;
        padding: 0.5rem;
        width: 100%;
    }

@media (max-width: 768px) {

    .form-wrapper {
        margin: 0 auto;
    }

}

.form-wrapper label {
    display: block;
    margin-top: 1rem;
    font-weight: bold;
}

.form-wrapper input {
    width: 100%;
    padding: 0.5rem;
    margin-top: 0.2rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
    text-align: center;
}

.form-wrapper button {
    display: block;
    margin: auto 30px auto 0;
    padding: 0.6rem 1.2rem;
    background-color: #007bff;
    border: none;
    color: white;
    border-radius: 4px;
    cursor: pointer;
}

.form-wrapper button:hover {
    background-color: #0056b3;
}

#infoIcon {
    all: unset;
    cursor: pointer;
    font-size: 1.2em;
    color: #007bff;
}

#infoIconRechner {
    all: unset;
    cursor: pointer;
    font-size: 1.2em;
    color: #007bff;
}

.form-und-schieber-container {
    width: 90%;
    max-width: 960px;
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    justify-content: space-around;
    align-items: stretch;
}

.schieber-wrapper {
    display: flex;
    align-items: center;
    position: relative;
    background: white;
    padding: 1rem;
    margin: 0 auto;
    border-radius: 0.5rem;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.schieber-wrapper input{
    text-align: center;
    min-width: 80px;
}

/* Standardmäßig den Toggle-Button (Plus) verstecken */
.schieber-toggle {
    display: none;
}

.schieber-box {
    display: flex;
    justify-content: center;
    max-width: 500px;
    min-width: 250px;
}

/* Mobile: verstecke Visualisierung standardmäßig */
@media (max-width: 768px) {

    .form-und-schieber-container {
        flex-direction: column;
        align-items: center;
    }

    .schieber-box {
        margin: 1rem auto;
        background: white;
        padding: 1.5rem 0;
        border-radius: 0.5rem;
        box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
        width: 100%;
        text-align: center;
        flex-direction: column;
        align-items: center;
    }

    .schieber-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 1.2rem;
        border: none;
        background: #007bff;
        color: white;
        border-radius: 999px;
        height: 32px;
        cursor: pointer;
        padding: 0 10px;
    }

    .schieber-wrapper {
        display: none;
        box-shadow: none;
    }

    .schieber-wrapper.show {
        display: block;
    }
}

.info-box {
        background: white;
        padding: 1rem;
        width: 90%;
        max-width: 960px;
        margin: 1rem auto 2rem;
        border-collapse: collapse;
        border-radius: 0.5rem;
        box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
        text-align: left;
}

.info-box p {
    font-size: 14px;
    line-height: 1.6;
}

.info-box i {
    font-style: italic;
}

.info-box ul {
    margin-left: 20px;
}

.info-box ul li {
    font-size: 14px;
}

.info-box table {
    border-collapse: separate;
    border-spacing: 0;
    width: auto;
    font-size: 0.85em;
    margin-top: 0.5em;
    margin-bottom: 1em;

    border: 1px solid #ccc;
    border-radius: 8px;
    overflow: hidden;
}

.info-box th,
.info-box td {
    border: 1px solid #ccc;
    padding: 6px 10px;
    text-align: left;
}

.info-box thead th {
    background-color: #007bff;
    color: white;
}

.info-box tbody tr:nth-child(even) {
    background-color: #f2f2f2;
}

.info-box hr {
    margin-top: 20px;
}

.berechnen-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px; /* Abstand zwischen Button und Info */
    margin-top: 10px;
}

.berechnen-wrapper button {
    display: inline-flex;
    justify-content: center;
    align-items: center;
}

.berechnen-wrapper button[type="submit"] {
    padding: 8px 16px;
    font-weight: bold;
}

#infoIcon {
    color: white;
    font-weight: bold;
    padding: 8px 12px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

/* ################################# */

#schieber-visualisierung {
    min-width: 300px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

#schieber-svg {
    margin-top: 1rem;
}

@media (max-width: 768px) {
    #schieber-visualisierung {
        min-width: 100%;
        margin: 0 auto;
    }
}

/* 🎯 Mobile Slider-Styling */
@media (max-width: 768px) {
    #schieberSlider {
        appearance: none;
        width: 100%;
        height: 8px;
        border-radius: 4px;
        background: #ddd;
        outline: none;
        margin-top: 0.5rem;
        transition: background 0.2s;
    }

    #schieberSlider::-webkit-slider-thumb {
        appearance: none;
        width: 20px;
        height: 20px;
        border-radius: 50%;
        background: #007bff;
        cursor: pointer;
        border: none;
        box-shadow: 0 0 2px rgba(0, 0, 0, 0.2);
        transition: background 0.2s;
    }

    #schieberSlider::-moz-range-thumb {
        width: 20px;
        height: 20px;
        border-radius: 50%;
        background: #007bff;
        cursor: pointer;
        border: none;
    }
}

/* Footer-Stil */
footer {
    background: linear-gradient(135deg, #0056b3, #003f80);
    color: white;
    text-align: center;
    padding: 15px 0;
    font-size: 16px;
    font-weight: bold;
    bottom: 0;
    width: 100%;
    box-shadow: 0 -4px 8px rgba(0, 0, 0, 0.2);
    height: 60px; /* Höhe des Footers */
}