/* ============================================================
   1) Select Dropdown + Pfeil
   ============================================================ */
.select-wrapper {
    position: relative;
    width: 100%;
    max-width: 420px;
}

.modern-select {
    width: 100%;
    padding: 14px 18px;
    font-size: 1.1rem;
    border: 2px solid #dce3eb;
    border-radius: 12px;
    background: #fff;
    appearance: none;
    transition: 0.2s ease;
    cursor: pointer;
    font-weight: 500;
}

.modern-select:hover {
    border-color: #b7c2d0;
    background: #fafbfc;
}

.modern-select:focus {
    border-color: #1a6ac9;
    box-shadow: 0 0 0 3px rgba(38,121,207,0.25);
    outline: none;
}

.select-arrow {
    position: absolute;
    right: 16px;
    top: 50%;
    width: 16px;
    height: 16px;
    transform: translateY(-50%);
    pointer-events: none;
    opacity: 0.6;
}


/* ============================================================
   2) Sticky Filterbereich
   ============================================================ */
.sticky-filter {
    position: sticky;
    top: 120px; /* mehr Abstand, exakt passend zu deinem Header */
    z-index: 5; /* weniger Dominanz */
    background: rgba(255,255,255,0.8); /* leicht transparent */
    backdrop-filter: blur(4px); /* optional: eleganter Glass-Effekt */
}



/* ============================================================
   3) Loading Spinner
   ============================================================ */
#loadingIndicator {
    display: none;
    margin: 20px 0;
    text-align: center;
    font-size: 1.1rem;
    color: #1e78b4;
    font-weight: 600;
}

.spinner {
    border: 4px solid #ddd;
    border-top: 4px solid #1e78b4;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    animation: spin 0.9s linear infinite;
    margin: 0 auto 10px auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}


/* ============================================================
   4) Tabellen + Charts Layout
   ============================================================ */
.statistik-pair {
    display: flex;
    justify-content: space-between;
    gap: 30px;
    margin-bottom: 50px;
    align-items: flex-start;
    flex-wrap: wrap;
    padding-top: 50px;
}

/* Tabelle links */
.statistik-table {
    flex: 0 0 40%;
    max-width: 470px;
}

/* Chart rechts */
.statistik-chart {
    flex: 1 1 0;
    min-width: 300px;
}

/* Canvas skalierbar */
.statistik-chart canvas {
    width: 100% !important;
    height: auto !important;
}

/* Mobile Ansicht */
@media (max-width: 768px) {
    .statistik-pair {
        flex-direction: column;
        gap: 20px;
    }
}

/* ============================================================
   5) Tabellen Gestaltung
   ============================================================ */
.statistik-table table {
    width: 100%;
    max-width: 450px;
    border-collapse: collapse;
    margin-top: 5px;
}

.statistik-table table td {
    padding: 4px 10px;
    vertical-align: top;
}

.statistik-table table td:first-child {
    padding-right: 20px;
}

/* ============================================================
   6) Chart-Umschalt-Buttons
   ============================================================ */
.chart-btn {
    padding: 6px 12px;
    margin-right: 8px;
    border: 1px solid #1e78b4;
    border-radius: 6px;
    background: white;
    cursor: pointer;
}

.chart-btn:hover {
    background: #1e78b4;
    color: white;
}


/* ============================================================
   7) Canvas global (falls nötig)
   ============================================================ */
canvas {
    margin: 40px 0;
    max-height: 420px;
}

/* Schicker PDF-Download-Button */
.download-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 24px;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 12px;
    border: none;
    cursor: pointer;
    background: linear-gradient(135deg, #1e78b4, #155a87);
    color: #fff;
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
    transition: all 0.25s ease;
}

.download-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 18px rgba(0,0,0,0.22);
    background: linear-gradient(135deg, #237fbd, #166394);
}

.download-btn:active {
    transform: translateY(0px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
}

.download-btn::before {
    content: "⬇️";
    font-size: 1.2rem;
}

/* ============================================================
   8) Abstand unter dem PDF-Download-Bereich
   ============================================================ */
.cta-final {
    margin-top: 40px;     /* etwas Luft nach oben */
    margin-bottom: 100px; /* Abstand zum Footer */
    text-align: left;   /* optional, falls du Button zentrieren willst */
}


/* ============================================================
   0) Gliederung
   ============================================================ */
.statistik-toc {
    background-color: #f7f7fb;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.statistik-toc ol {
    margin: 0;
    padding-left: 1.2rem;
}

.statistik-toc li {
    margin-bottom: 0.3rem;
}

.statistik-toc a {
    text-decoration: none;
}

.statistik-toc a:hover,
.statistik-toc a:focus {
    text-decoration: underline;
}