/* HTMX Loading Indicator */
.htmx-indicator {
    display: none;
}
.htmx-request .htmx-indicator,
.htmx-request.htmx-indicator {
    display: inline-flex;
}

/* Tabellenzahlen mit fester Breite */
.tabular-nums {
    font-variant-numeric: tabular-nums;
}

/* Leaflet-Karte: z-index nicht über Navigation */
#leaflet-map,
#proj-leaflet-map {
    z-index: 1;
}
.leaflet-pane,
.leaflet-control {
    z-index: 1 !important;
}
.leaflet-top,
.leaflet-bottom {
    z-index: 5 !important;
}

/* Leaflet-Tooltip-Styling */
.leaflet-tooltip-custom {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: 6px 10px;
    font-size: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.12);
}

/* Scrollbare Tabellen */
.table-scroll {
    overflow-y: auto;
    max-height: 80vh;
}
.table-scroll thead th {
    position: sticky;
    top: 0;
    z-index: 10;
    background: #f9fafb;
}

/* Smooth transitions für Tabellen-Hover */
tbody tr {
    transition: background-color 0.1s ease;
}

/* Chart.js Canvas: Responsive */
canvas {
    display: block;
    width: 100% !important;
}

/* Alpine.js: Elemente die x-show nutzen, nicht flackern */
[x-cloak] { display: none !important; }

/* Skeleton-Loader Pulse */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-pulse 1.5s infinite;
}
@keyframes skeleton-pulse {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Details/Summary Styling */
details > summary {
    list-style: none;
    cursor: pointer;
}
details > summary::-webkit-details-marker {
    display: none;
}

/* ── Responsive: Pyramiden-Canvas ────────────────────────────────────── */
.pyramid-canvas-wrap {
    height: 320px;
}
@media (min-width: 640px) {
    .pyramid-canvas-wrap { height: 400px; }
}
@media (min-width: 1024px) {
    .pyramid-canvas-wrap { height: 460px; }
}

/* ── Responsive: Metric-Kacheln – Zahl auf kleinen Screens verkleinern ─ */
@media (max-width: 639px) {
    .metric-value { font-size: 1.5rem; }
}

/* ── Responsive: Tabellen horizontal scrollbar auf Mobile ────────────── */
@media (max-width: 767px) {
    .table-scroll {
        max-height: 60vh;
    }
    /* Daten-Tabellen: immer horizontal scrollbar */
    #data-table table,
    .data-table-wrap table {
        min-width: 540px;
    }
}

/* ── Responsive: Toast auf Mobile volle Breite ───────────────────────── */
@media (max-width: 639px) {
    #toast-container {
        left: 1rem;
        right: 1rem;
        max-width: none !important;
    }
}

/* ── Responsive: Mini-Karte auf Mobile flacher ───────────────────────── */
@media (max-width: 767px) {
    #pyramid-minimap {
        height: 220px !important;
    }
}

/* ── Print-Optimierung ──────────────────────────────────────────────── */
@media print {
    header, nav, .htmx-indicator, #toast-container { display: none !important; }
    main { padding: 0 !important; }
}
