﻿.classPopup {
    font-size: 12px;
    max-width: 300px;
    word-wrap: break-word;
    overflow-wrap: break-word;
    line-height: 1.5;
}

.classPopupHeader {
    color: #444;
    font-weight: 600;
    margin-bottom: 4px;
    display: block;
    font-size: 12px;
}

.classPopupSubheader {
    color: #888;
    font-size: 11px;
    margin-bottom: 4px;
    display: block;
}

.classPopupText {
    color: #222;
    font-size: 12px;
}

.point-search-container {
    position: relative;
}

.point-search-results {
    position: absolute;
    top: calc(100% + 0.25rem);
    left: 0;
    right: 0;
    z-index: 1050;
    background: white;
    border: 1px solid rgba(0, 0, 0, 0.12);
    border-radius: 0.25rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    max-height: 240px;
    overflow: auto;
}

.point-search-item {
    padding: 0.35rem 0.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

    .point-search-item:hover {
        background: rgba(0, 0, 0, 0.04);
    }

    /* Visible active state when navigating via keyboard */
    .point-search-item.active,
    .point-search-item[aria-selected="true"] {
        background-color: #0d6efd;
        /* bootstrap primary */
        color: white;
    }

        /* Keep active styling even when hovered */
        .point-search-item.active:hover {
            background-color: #0b5ed7;
            color: white;
        }

    .point-search-item small {
        opacity: 0.8;
    }

    /* Ensure the active item is scrolled into view when highlighted */
    .point-search-item.active {
        scroll-margin: 8px;
    }

/* Toolbar layout and responsive tweaks for MapToolbarWithPointSearch */
.map-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0.5rem;
    justify-content: flex-end;
}

.map-toolbar-left,
.map-toolbar-mid,
.map-toolbar-right {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Push the right group to the far right on wide screens */
.map-toolbar-right {
    margin-left: 0;
}

.map-toolbar-search {
    min-width: 140px;
    max-width: 360px;
    width: 220px;
}

@media (max-width: 576px) {

    /* On narrow screens make the search expand and stack */
    .map-toolbar-search {
        width: 100%;
        min-width: 0;
    }

    .map-toolbar-right {
        margin-left: 0;
        width: 100%;
        justify-content: flex-end;
    }
}

/* Scoped styles for MapContainer */
.map-loading-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.85);
    z-index: 1000;
}

.map-error-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.85);
    z-index: 1101;
}

.map-spinner {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 4px solid #ccc;
    border-top-color: #0d6efd;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.map-error-box {
    background: white;
    border: 1px solid #dc3545;
    padding: 16px;
    border-radius: 6px;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.08);
    max-width: 320px;
    text-align: center;
}

.tooltip-toggle {
    position: left;
    z-index: 900;
    left: 12px;
    top: 12px;
    padding: 6px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 6px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.06);
}

.map-toolbar .form-check {
    margin-right: 6px;
}

.classPopupDelimiter {
    height: 1px;
    background: #e5e5e5;
    margin: 8px 0;
    width: 100%;
}

/* Ellipsis for long pill tab names — width adapts to sidebar container */
.nav-pills .nav-link {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Sidebar with sticky tab headers: the sidebar itself does NOT scroll.
   Instead, it is a flex column whose children are the nav pills (fixed at
   the top) and the tab-content (which takes remaining space and scrolls).
   BlazorBootstrap <Tabs> renders:  <div> <ul class="nav"> … </ul>
                                           <div class="tab-content"> … </div> </div>
   We need the wrapper div to also be a flex column filling the sidebar. */
.sidebar-sticky-tabs {
    overflow: hidden;
    /* sidebar itself does not scroll */
}

    /* The BlazorBootstrap Tabs wrapper must fill the sidebar and use flex column */
    .sidebar-sticky-tabs > div {
        display: flex;
        flex-direction: column;
        flex: 1;
        min-height: 0;
        /* allow flex child to shrink below content size */
    }

    /* Nav pills: flex-shrink:0 keeps them visible at the top */
    .sidebar-sticky-tabs .nav.nav-pills {
        flex-shrink: 0;
        background: inherit;
        padding: 4px 8px;
        z-index: 1;
    }

    /* Tab content area: takes remaining space and scrolls */
    .sidebar-sticky-tabs .tab-content {
        flex: 1;
        overflow-y: auto;
        min-height: 0;
    }

/*
 * Treeview item layout
 * Actual DOM per item:
 *   <li>
 *     <div class="d-flex align-items-center gap-1">
 *       <button> chevron </button>
 *       <input type="checkbox" class="form-check-input">
 *       <small> label text </small>
 *       <button> <i class="bi bi-info-circle"> </button>   ← action icon
 *     </div>
 *   </li>
 */

/* Label text (<small>): fill remaining space, truncate with ellipsis */
.treeview-ellipsis li > div > small {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

    /* Action icon button: push to the right edge, never shrink */
    .treeview-ellipsis li > div > small ~ button {
        margin-left: auto;
        flex-shrink: 0;
    }

/* ── Tooltip info-icon popup ──────────────────────────────────── */
/* Override Leaflet popup chrome to look like a small tooltip */
.tooltip-info-popup-container .leaflet-popup-content-wrapper {
    padding: 0;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.tooltip-info-popup-container .leaflet-popup-content {
    margin: 0;
}

.tooltip-info-popup-container .leaflet-popup-tip-container {
    /* keep the small arrow tip */
}

.tooltip-info-popup {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px;
    font-size: 0.8rem;
    white-space: nowrap;
}

.tooltip-info-text {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tooltip-info-icon-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 2px 4px;
    color: #0d6efd;
    font-size: 1rem;
    line-height: 1;
    border-radius: 3px;
    transition: background 0.15s;
}

    .tooltip-info-icon-btn:hover {
        background: rgba(13, 110, 253, 0.1);
    }

/* Shape info-icon popup: tip points down into the shape at the anchor point */
.tooltip-info-popup-shape .leaflet-popup-content-wrapper {
    margin-bottom: 0;
}

.vertical-tabs > .nav-link.active {
    background-color: #3C424F;
    color: #FFFFFF;
}

.vertical-tabs > .nav-link {
    text-align:start;
}

/* ── Kartenseiten-Layout ──────────────────────────────────────────────────
   Strategie: Kein hartcodierter calc()-Wert.
   .zone-map-page füllt den gesamten von .content-main bereitgestellten Raum
   per Flexbox aus. Die Titelzeile (.zone-map-header-row) nimmt nur ihre
   natürliche Höhe ein; .zone-map-row füllt den Rest (flex:1).
   Der Bootstrap-Abstand (mb-2, mb-3, …) kann direkt an .zone-map-row
   gesetzt werden. */

.zone-map-page {
    display: flex;
    flex-direction: column;
    /* Höhe = sichtbarer Viewport minus sticky Header+Nav minus sticky Footer
       minus content-main Padding (6px + 5px = 11px).
       Werte aus app.css / theme.css:
         Header-Bar:  ~32 px  (.header, enthält nur &nbsp;)
         TopNavMenu:  ~58 px  (navbar mit lineris-logo height:40px + padding)
         StickyFooter:~48 px  (navbar sticky-bottom)
         content-main padding: 11 px
       Summe: 149 px  → großzügig auf 152 px gesetzt, damit ein kleiner
       Puffer verhindert, dass der Footer gerade so verdeckt wird. */
    height: calc(100vh - 162px);
    overflow: hidden;
}

.zone-map-header-row {
    flex-shrink: 0;
}

/* Karten-Zeile füllt den verbleibenden Platz unterhalb der Titelzeile */
.zone-map-row {
    flex: 1;
    min-height: 0;
}

.zone-map-canvas {
    display: flex;
    gap: 8px;
    width: 100%;
    height: 100%;
    min-height:500px;
}

/* Auf sehr kleinen Bildschirmen kein festes Höhenlayout */
@media (max-width: 575.98px) {
    .zone-map-page {
        height: auto;
        overflow: visible;
    }

    .zone-map-row {
        flex: none;
    }
}