/* ═══════════════════════════════════════════════════════════════
   1. BASE
═══════════════════════════════════════════════════════════════ */

html {
    position: relative;
    min-height: 100%;
    overflow-x: hidden;
    scrollbar-color: lightgrey rgba(254, 254, 248, 1);
}

@media (min-width: 768px) {
    html {
        font-size: 16px;
    }
}

body {
    height: 100%;
    background-color: #f9f9f6;
}

h1, h2, h3, h4, h5, h6 {
    font-family: "DM Sans", sans-serif;
    font-weight: 200;
    letter-spacing: 1px;
}

.bg-monitor {
    background-color: #E98074;
}


/* ═══════════════════════════════════════════════════════════════
   2. FORM CONTROLS
═══════════════════════════════════════════════════════════════ */

input[type="datetime-local"] {
    width: 10.5rem;
    min-width: 10.5rem;
    box-sizing: border-box;
    border-radius: 30px;
}

@supports (-moz-appearance: none) {
    input[type="datetime-local"] {
        width: 13rem;
    }
}

.form-control:focus {
    color: var(--bs-body-color);
    background-color: var(--bs-body-bg);
    border-color: #86b7fe;
    outline: 0;
    box-shadow: none;
}

.form-select:focus {
    color: var(--bs-body-color);
    background-color: var(--bs-body-bg);
    border-color: #86b7fe;
    outline: 0;
    box-shadow: none;
}

.form-select {
    border-radius: 15px;
}

.form-check.form-switch {
    display: flex;
    align-items: center;
    padding-left: 0;
}

    .form-check.form-switch .form-check-input {
        margin-left: auto;
        flex-shrink: 0;
    }

.form-check-input.q:checked {
    background-color: rgb(41, 121, 255);
    border-color: rgb(41, 121, 255);
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='%23fff'/%3e%3c/svg%3e");
}

.form-check-input.v:checked {
    background-color: rgb(245, 173, 39);
    border-color: rgb(245, 173, 39);
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='%23fff'/%3e%3c/svg%3e");
}


.form-switch .form-check-input:focus {
    box-shadow: none;
    border-color: rgba(0, 0, 0, .25);
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='rgba(0,0,0,0.25)'/%3e%3c/svg%3e");
}

.form-label {
    font-weight: bold;
}


/* ═══════════════════════════════════════════════════════════════
   3. LOADING
═══════════════════════════════════════════════════════════════ */

.loading {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1100;
    text-align: center;
    opacity: 0;
    transition: opacity 1s;
    background-color: rgb(250,250,250);
}

.loadingWidget {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(254,254,248,1);
    z-index: 20;
    display: none;
}

.center {
    margin: 0;
    position: absolute;
    top: 50%;
    left: 50%;
    -ms-transform: translate(-50%, -50%);
    transform: translate(-50%, -50%);
}

.loading-text {
    padding: 10px;
    font-size: 30px;
}

.spinner {
    width: 20%;
    height: auto;
    margin: auto;
    overflow: hidden;
    -webkit-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-animation: rotate 2s linear infinite;
    animation: rotate 2s linear infinite;
}

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


/* ═══════════════════════════════════════════════════════════════
   4. GRID STACK
═══════════════════════════════════════════════════════════════ */

.grid-stack-item-content {
    overflow: hidden;
    background-color: rgba(254,254,248,1);
    border-radius: 15px;
    box-shadow: 0px 0px 5px 3px rgba(230,230,230,.8);
    animation: fadeInAnimation ease .7s;
    animation-iteration-count: 1;
    animation-fill-mode: forwards;
    container-type: inline-size;
}

@keyframes fadeInAnimation {
    0%   { transform: translateY(-100%); }
    40%  { transform: translateY(1%); }
    55%  { transform: translateY(-0.5%); }
    70%  { transform: translateY(0.2%); }
    85%  { transform: translateY(-0.1%); }
    100% { transform: translateY(0%); }
}

.grid-stack > .grid-stack-item > .ui-resizable-se {
    width: 32px;
    height: 32px;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" fill="rgb(142, 141, 138)" stroke="rgb(142, 141, 138)" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" viewBox="0 0 20 20"><path d="m10 3 2 2H8l2-2v14l-2-2h4l-2 2"/></svg>');
    opacity: .2;
}

    .grid-stack > .grid-stack-item > .ui-resizable-se:hover {
        text-decoration: none;
        opacity: 1;
    }


/* ═══════════════════════════════════════════════════════════════
   5. WIDGET LAYOUT
═══════════════════════════════════════════════════════════════ */

.widget {
    overflow: hidden;
    width: 100%;
    height: 100%;
}

.widget-outer-container {
    position: relative;
}

.widget-header-row {
    position: relative;
    z-index: 25;
}

.widget-details-panel {
    margin-right: 20%;
    height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
}

.widget-svg-panel {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 20%;
    z-index: 0;
    overflow: hidden;
    box-shadow: inset 8px 0px 16px rgba(0,0,0,.08);
}

.widget-svg-fill {
    position: absolute;
    inset: 0;
    width: 100% !important;
    height: 100% !important;
    margin: 0 !important;
}

.widget-badge-overlay {
    position: absolute;
    bottom: 8px;
    right: 35px;
    z-index: 2;
    display: flex;
    flex-direction: row;
    gap: 4px;
    font-size: small;
    align-items: flex-end;
}

/* ═══════════════════════════════════════════════════════════════
   6. UI CONTROLS
═══════════════════════════════════════════════════════════════ */
.ui-btn {
    position: absolute;
    z-index: 26;
    opacity: .4;
}

    .ui-btn:hover {
        text-decoration: none;
        opacity: 1;
    }

.move {
    top: 9px;
    left: 9px;
    height: 26px;
    width: 26px;
    cursor: move;
    background: transparent url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' class='bi bi-arrows-move' viewBox='0 0 16 16' fill='rgb(142, 141, 138)'><path fill-rule='evenodd' d='M7.646.146a.5.5 0 0 1 .708 0l2 2a.5.5 0 0 1-.708.708L8.5 1.707V5.5a.5.5 0 0 1-1 0V1.707L6.354 2.854a.5.5 0 1 1-.708-.708zM8 10a.5.5 0 0 1 .5.5v3.793l1.146-1.147a.5.5 0 0 1 .708.708l-2 2a.5.5 0 0 1-.708 0l-2-2a.5.5 0 0 1 .708-.708L7.5 14.293V10.5A.5.5 0 0 1 8 10M.146 8.354a.5.5 0 0 1 0-.708l2-2a.5.5 0 1 1 .708.708L1.707 7.5H5.5a.5.5 0 0 1 0 1H1.707l1.147 1.146a.5.5 0 0 1-.708.708zM10 8a.5.5 0 0 1 .5-.5h3.793l-1.147-1.146a.5.5 0 0 1 .708-.708l2 2a.5.5 0 0 1 0 .708l-2 2a.5.5 0 0 1-.708-.708L14.293 8.5H10.5A.5.5 0 0 1 10 8'/> </svg>") center/1em auto no-repeat;
    background-size: auto;
}

.close {
    top: 12px;
    right: 12px;
    height: 21px;
    width: 21px;
    cursor: pointer;
    background: transparent url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='rgb(142, 141, 138)'%3e%3cpath d='M.293.293a1 1 0 011.414 0L8 6.586 14.293.293a1 1 0 111.414 1.414L9.414 8l6.293 6.293a1 1 0 01-1.414 1.414L8 9.414l-6.293 6.293a1 1 0 01-1.414-1.414L6.586 8 .293 1.707a1 1 0 010-1.414z'/%3e%3c/svg%3e") center/1em auto no-repeat;
    background-size: auto;
}

.ui-resizable-handle {
    width: 20px;
}

.settingBtn {
    border: 1px solid #eee;
    border-radius: 47px;
    margin: 3px;
    z-index: 1;
    padding: 4px 8px 4px 8px;
    font-size: smaller;
    background-color: rgba(234, 231, 220, .4);
    -webkit-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

.settingBtn:hover {
    background-color: #EAE7DC;
}

.toggleBtn {
    border: solid 1px #eee;
    color: rgb(0, 0, 0);
    background-color: #f8f6f0;
    padding: 0;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    overflow: hidden;
    transition: transform .2s;
}

    .toggleBtn.active {
        border: solid 2px red;
    }

    .toggleBtn:hover {
        transform: scale(1.2);
    }

    .toggleBtn.edit {
        position: absolute;
        top: 10px;
        left: 10px;
    }

        .toggleBtn.edit:hover {
            background-color: #D8C3A5;
            color: #EAE7DC;
        }

    .toggleBtn img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

.graphButton {
    z-index: 10;
    padding: 4px;
}

    .graphButton:hover {
        color: #E98074;
    }


/* ═══════════════════════════════════════════════════════════════
   7. NAVIGATION / TABS
═══════════════════════════════════════════════════════════════ */

.pill-holder {
    background-color: rgba(234,231,220, .9);
    border-radius: 20px;
    margin: 4px;
    backdrop-filter: blur(16px);
    -webkit-user-select: none;
    -ms-user-select: none;
    user-select: none;
    box-shadow: 0px 8px 16px rgba(0, 0, 0, .06);
}

.nav-link-details {
    margin: 5px;
    background-color: unset;
    border: 1px solid #eee;
    border-radius: 48px;
    padding: 4px 12px 4px 12px;
    white-space: nowrap;
}

    .nav-link-details:hover {
        background-color: #F5F4EF;
    }

    .nav-link-details.active {
        margin: 5px;
        background: #E98074;
        border: 1px solid #eee;
        border-radius: 48px;
        color: white;
    }

.detailtitle {
    z-index: 1;
    margin: 4px;
    background-color: rgba(234, 231, 220, .4);
    backdrop-filter: blur(16px);
    border-radius: 48px;
    padding: 6px 12px 6px 12px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 4px;
    -webkit-user-select: none;
    -ms-user-select: none;
    user-select: none;
    box-shadow: 0px 8px 16px rgba(0, 0, 0, .06);
}

.tab-content {
    height: 100%;
    padding: 3px;
}

.tab-pane {
    height: 100%;
    width: 100%;
}

@media (max-width: 1220px) {
    .shortpick {
        display: none;
    }
}


/* ═══════════════════════════════════════════════════════════════
   8. TABLE / STATUS LIST
═══════════════════════════════════════════════════════════════ */

.table-container {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.first-div {
    display: flex;
    flex-direction: row;
    margin-left: 40px;
    margin-top: 0px;
    margin-right: 5px;
    margin-bottom: 3px;
    align-items: center;
    z-index: 25;
}

.second-div {
    flex-grow: 1;
    overflow: auto;
}

.search-wrapper {
    position: relative;
    display: inline-block;
    width: 50%;
    margin-top: 4px;
    margin-left: auto;
}

    .search-wrapper input {
        z-index: 1;
        border-radius: 47px;
    }

.clear-icon {
    position: absolute;
    top: 50%;
    right: 10px;
    transform: translateY(-50%);
    cursor: pointer;
    color: #888;
}

    .clear-icon:hover {
        color: #000;
    }

table {
    width: 100%;
}

thead {
    position: sticky;
    top: 0px;
    background-color: rgba(254, 254, 248, 1);
    z-index: 20;
}

tr td {
    border: .1px solid #eee;
    padding: 5px;
    cursor: pointer;
    -webkit-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

th {
    padding: 3px;
    cursor: pointer;
    -webkit-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

tbody tr:hover {
    background-color: rgba(0,0,0,.03);
}

.status {
    display: block;
    margin: auto;
    width: 10px;
    height: 10px;
}

    .status.alive {
        animation: blinker 2s cubic-bezier(0.35, 0.47, 0.7, 1.57) infinite;
    }

    .status.struggle {
        animation: blinker 1s cubic-bezier(0.35, 0.47, 0.7, 1.57) infinite;
    }

@keyframes blinker {
    50% { opacity: 0; }
}

.status-element {
    margin: 2px 10px 2px 5px;
    -webkit-user-select: none;
    -ms-user-select: none;
    user-select: none;
}


/* ═══════════════════════════════════════════════════════════════
   9. GRAPHS / CHARTS
═══════════════════════════════════════════════════════════════ */

.graphcontainer {
    position: relative;
    width: 100%;
    height: 100%;
}

.graph {
    position: absolute;
    left: 0;
    top: 0;
    width: 100% !important;
    height: 100% !important;
    resize: none !important;
    z-index: 1;
    display: flex;
    justify-content: center;
    align-items: center;
}

.graph:hover + div {
    opacity: 0.4;
    background-color: #eee;
    transition-duration: 500ms;
    z-index: 0;
}

.graphlayercontrol {
    position: absolute;
    background-color: rgba(255,255,255,.8);
    box-shadow: 0px 8px 16px rgba(0, 0, 0, .03);
    border: 1px solid #eee;
    padding: 4px;
    border-radius: 19px;
    top: 4px;
    left: 60px;
    margin: 0;
    z-index: 2;
}

.dygraph-axis-label {
    font-size: 11px;
}

.dygraph-roller {
    border: 1px solid #eee;
    border-radius: 3px;
    bottom: 0 !important;
    left: unset !important;
    right: 0px;
    width: 40px;
}

.dygraph-label {
    font-size: 15px;
    font-family: "DM Sans", sans-serif;
}

.dygraph-y2label {
    transform: rotate(-180deg);
}

.dygraph-legend {
    position: absolute;
    background-color: white !important;
    border-radius: 3px;
    pointer-events: none;
    transition-duration: 100ms;
    z-index: 400;
    padding: 8px;
    text-align: center;
    width: fit-content;
    top: 20% !important;
}

.reportField {
    background-color: white;
    position: absolute;
    width: 1450px;
    height: 400px;
    z-index: 10;
    left: -9999px;
    top: 0;
    resize: none !important;
}


/* ═══════════════════════════════════════════════════════════════
   10. MAP
═══════════════════════════════════════════════════════════════ */

.map {
    width: 100%;
    height: 100%;
}

gmp-map-3d {
    width: 100%;
    height: 100%;
    border-radius: 15px;
}

.vAygCK-api-load-alpha-banner {
    display: none;
}

.maplibregl-popup-content {
    pointer-events: none;
    max-width: 400px;
    font: 12px/20px 'Helvetica Neue', Arial, Helvetica, sans-serif;
    background-color: rgba(255,255,255,0.8);
    backdrop-filter: blur(2px);
    border: 1px solid #fff;
    border-radius: 10px;
    padding: 4px;
}

.maplibregl-ctrl-bottom-right {
    right: 30px;
}

.maplibregl-canvas {
    border-radius: 15px;
}

.maplibregl-ctrl-group:not(:empty) {
    border-radius: 47px;
    border: .2px solid #eee;
    box-shadow: 0 0 0 0px rgba(0, 0, 0, .1);
}

.maplibregl-ctrl-group.layers-control {
    border-radius: 3px;
    background-color: white;
}

.streetviewContainer {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 2;
}


/* ═══════════════════════════════════════════════════════════════
   11. CHECKBOXES
═══════════════════════════════════════════════════════════════ */

.typeBadge {
    margin: 1px;
    border-radius: 10px;
    padding: 1px 6px;
    -webkit-user-select: none;
    -ms-user-select: none;
    user-select: none;
    box-shadow: 0px 8px 16px rgba(0, 0, 0, .14);
}

.checkcontainer {
    display: block;
    position: relative;
    padding-left: 25px;
    margin: 5px;
    cursor: pointer;
    font-size: 13px;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

    .checkcontainer input {
        position: absolute;
        opacity: 0;
        cursor: pointer;
        height: 0;
        width: 0;
    }

.checkmark {
    position: absolute;
    top: 0;
    left: 0;
    height: 18px;
    width: 18px;
    background-color: #eee;
    border-radius: 4px;
}

.checkcontainer:hover input ~ .checkmark {
    background-color: #ccc;
}

.checkcontainer input:checked ~ .checkmark {
    background-color: #E98074;
}

.checkmark:after {
    content: "";
    position: absolute;
    display: none;
}

.checkcontainer input:checked ~ .checkmark:after {
    display: block;
}

.checkcontainer .checkmark:after {
    left: 7px;
    top: 3px;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    -webkit-transform: rotate(45deg);
    -ms-transform: rotate(45deg);
    transform: rotate(45deg);
}


/* ═══════════════════════════════════════════════════════════════
   12. SLIDERS (noUiSlider)
═══════════════════════════════════════════════════════════════ */

.slider-round {
    height: 25px;
    border-radius: 5px;
}

.slider-round.ref {
    height: 8px;
}

    .slider-round .noUi-connect {
        background: #E98074;
        cursor: pointer;
    }

        .slider-round .noUi-connect:hover {
            background: #E85A4F;
        }

    .slider-round.ref .noUi-connect {
        background: #5A6E7F;
    }

    .slider-round .noUi-handle {
        height: 30px;
        width: 10px;
        top: -3.5px;
        border-radius: 20px;
        cursor: pointer;
    }

    .noUi-handle.noUi-handle-lower {
        right: 0px;
    }

    .noUi-handle.noUi-handle-upper {
        right: -10px;
    }

        .slider-round .noUi-handle:hover {
            transform: scale(1.1);
        }

    .slider-round.ref .noUi-handle {
        height: 15px;
        width: 15px;
        top: -4px;
        right: -7.5px;
    }

    .slider-round .noUi-handle:before,
    .slider-round .noUi-handle:after {
        display: none;
    }

.noUi-pips-horizontal {
    height: 10px;
}


/* ═══════════════════════════════════════════════════════════════
   13. EDIT / DETAIL PANEL
═══════════════════════════════════════════════════════════════ */

.editDetails {
    width: 100%;
    height: 100%;
    overflow-x: hidden;
    overflow-y: auto;
}

.editPartial {
    display: none;
}

    .editPartial.show {
        display: block;
    }

.lane-rect {
    cursor: pointer;
    transition-duration: 100ms;
}

    .lane-rect.hover {
        stroke-width: 3;
        fill-opacity: .2;
    }

    .lane-rect.active {
        stroke: red;
        stroke-width: 4;
        fill-opacity: .2;
    }

    .backup-rect.hover {
        border: 2px solid red !important;
    }
    .backup-rect.active {
        border: 2px solid red !important;
    }

#tooltip {
    background: white;
    padding: 4px;
    border-radius: 5px;
    pointer-events: none; /* verhindert Flackern beim Hover */
    position: absolute;
    z-index: 9999;
}


/* ═══════════════════════════════════════════════════════════════
   14. CONTEXT MENU
═══════════════════════════════════════════════════════════════ */

#contextMenu {
    display: none;
    position: absolute;
    background: white;
    z-index: 1000;
    border-radius: 5px;
}

    #contextMenu ul {
        list-style: none;
        margin: 0;
        padding: 0;
    }

    #contextMenu li {
        padding: 8px 12px;
        cursor: pointer;
    }

        #contextMenu li:hover {
            background-color: #eee;
            border-radius: 5px;
        }


/* ═══════════════════════════════════════════════════════════════
   15. IMPRINT / LOGO
═══════════════════════════════════════════════════════════════ */

.imprint-container {
    position: relative;
    height: calc(100vh - 20px);
    border-radius: 15px;
    box-shadow: 0px 0px 5px 3px rgba(230,230,230,.8);
    animation: fadeInAnimation ease .7s;
    animation-iteration-count: 1;
    animation-fill-mode: forwards;
    background-image: url('/png/background.jpg');
    background-size: cover;
    background-repeat: no-repeat;
    background-position: right top;
    background-color: rgba(254,254,248,1);
    margin: 5px;
    padding: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.menu-card {
    z-index: 1;
    background: rgba(254, 254, 248, 0.97);
    border: 0.5px solid rgba(0, 0, 0, 0.1);
    border-radius: 15px;
    padding: 2.25rem 2rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.07), 0 6px 20px rgba(0,0,0,0.06);
}

.custom-logo {
    padding: 10px;
    position: fixed;
    bottom: 25px;
    display: inline-block;
    border-radius: 15px;
    background: rgba(254, 254, 248, 0.97);
    border: 0.5px solid rgba(0, 0, 0, 0.1);
    box-shadow: 0 1px 3px rgba(0,0,0,0.07), 0 6px 20px rgba(0,0,0,0.06);
}

    .custom-logo.left {
        left: 20px;
        width: 18vw;
    }

    .custom-logo.central {
        width: 20vw;
    }

    .custom-logo.right {
        right: 20px;
        width: 12vw;
    }

.copyright {
    position: absolute;
    left: 6px;
    bottom: 3px;
    color: white;
}
