/* Page header */
.last-update-subtitle {
    color: var(--bs-primary);
    font-weight: 600;
    margin-bottom: unset;
}

.main-container {
    display: flex;
    flex-direction: column;
}

/* Panel */
.panels-container {
    display: flex;
}

    .panels-container .start-panel {
        flex: 0 0 55%;
        padding: 1em;
    }

    .panels-container .end-panel {
        height: 100%;
        position: relative;
    }

.end-panel-main-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 1em;
    visibility: hidden;
}

    .end-panel-main-section.is-visible {
        visibility: visible;
    }

.details-aside {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    padding: 1rem;
    z-index: 500;
    display: none;
}

    .details-aside.is-visible {
        display: block;
    }

    .details-aside .details-aside-title-container {
        color: var(--bs-light);
        font-weight: 700;
        text-align: center;
        padding: 0.5em;
        border-radius: 1em;
        margin-bottom: 1em;
    }

    .details-aside .previsional-end-date-time-container {
        border-radius: 1em;
        padding: 0.5em;
        font-weight: 600;
        text-align: center;
        width: 100%;
    }

        .details-aside .previsional-end-date-time-container .calendar-icon {
            width: min-content;
            padding: 0.25em;
            border-radius: 0.5em;
            text-align: center;
            margin: -2em auto auto auto;
        }

        .details-aside .previsional-end-date-time-container .calendar-icon img {
            width: 30px;
            filter: brightness(0) invert(100%); /* Turns every pixel into black and then white */
        }

    .details-aside.details-aside-warning .details-aside-title-container {
        background-color: var(--bs-warning);
    }
    .details-aside.details-aside-warning .previsional-end-date-time-container {
        border: 2px solid var(--bs-warning);
    }
    .details-aside.details-aside-warning .calendar-icon {
        background-color: var(--bs-warning);
    }
    .details-aside.details-aside-warning > p:last-of-type {
        margin-bottom: 2em;
    }

    .details-aside.details-aside-outage .details-aside-title-container {
        background-color: var(--bs-danger);
    }
    .details-aside.details-aside-outage .previsional-end-date-time-container {
        border: 2px solid var(--bs-danger);
    }
    .details-aside.details-aside-outage .calendar-icon {
        background-color: var(--bs-danger);
    }
    .details-aside.details-aside-outage > p:nth-of-type(4) {
        margin-bottom: 2em;
    }

    /* Map */
    #map {
        width: 100%;
        height: 100%;
        position: relative;
    }

        #map .map-legend {
            position: absolute;
            bottom: 10px;
            left: 10px;
            background-color: var(--bs-light);
            border-radius: 1rem;
            padding: 0.5rem 0.75rem;
            z-index: 401;
            cursor: initial;
            display: flex;
            gap: 1rem;
        }

        #map .map-legend span {
            display: inline-flex;
            align-items: center;
            gap: 0.5rem;
        }

.map-focus-tooltip {
    border-radius: 1rem;
    padding: 0.5rem 0.75rem;
}

    .map-focus-tooltip.map-focus-tooltip-outage {
        background: linear-gradient( rgba(255, 255, 255, 0.75), rgba(255, 255, 255, 0.75) ), var(--bs-danger);
        color: var(--bs-danger);
        border-color: var(--bs-danger);
    }

    .map-focus-tooltip.map-focus-tooltip-warning {
        background: linear-gradient( rgba(255, 255, 255, 0.75), rgba(255, 255, 255, 0.75) ), var(--bs-warning);
        color: var(--bs-warning);
        border-color: var(--bs-warning);
    }

.leaflet-tooltip {
    pointer-events: none;
    box-shadow: none;
}

.leaflet-tooltip-top:before,
.leaflet-tooltip-bottom:before,
.leaflet-tooltip-left:before,
.leaflet-tooltip-right:before {
    border: none !important;
}

.leaflet-control-zoom {
    border: none !important;
}

.leaflet-control-zoom-in, .leaflet-control-zoom-out {
    font-family: initial;
    border-radius: 50% !important;
    background-color: var(--bs-primary) !important;
    color: var(--bs-light) !important;
}

.leaflet-control-zoom-in {
    margin-bottom: 0.25em;
}

/* Map search input */
.search-container {
    position: absolute;
    top: 8px;
    left: 10px;
    z-index: 401;
    cursor: initial;
}

/* TABLE */
.table-container {
    width: 100%;
}

.site-table {
    width: 100%;
    height: 100%;
    border-collapse: collapse;
    display: grid;
    grid-template-rows: auto 1fr;
    grid-template-columns: 1fr;
    border-width: 2px 0px 2px 0px;
    border-color: var(--bs-primary);
    border-style: solid;
}

    .site-table thead {
        border-width: 0px 0px 4px 0px;
        border-color: var(--bs-primary);
        border-style: solid;
    }

    .site-table tbody {
        overflow: auto;
        height: 100%;
    }

    .site-table tr {
        display: grid;
        grid-template-columns: repeat(4, 1fr);
    }

    .site-table th {
        text-align: center;
        padding: 8px 4px;
        color: var(--bs-dark);
        text-transform: uppercase;
        font-size: 0.8em;
        letter-spacing: 0.04em;
    }

    .site-table tr, .site-table th {
        background: linear-gradient( rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0.95) ), var(--bs-primary);
    }

    .site-table td {
        text-align: center;
        white-space: nowrap; /* prevents wrapping */
        padding: 10px 4px;
    }

    .site-table td.lieu-dit {
        white-space: break-spaces;
    }


    .site-table thead .sticky-col {
        z-index: 3; /* header above body cells */
    }

    .site-table tbody tr:nth-child(odd) {
        background: linear-gradient( rgba(255, 255, 255, 0.75), rgba(255, 255, 255, 0.75) ), var(--bs-primary);
    }

    .site-table tr:nth-child(even) {
    }

    .site-table tbody tr {
        cursor: pointer;
    }

        .site-table tbody tr:hover {
            background: linear-gradient( rgba(255, 255, 255, 0.85), rgba(255, 255, 255, 0.85) ), var(--bs-primary);
        }
        .site-table tbody tr:nth-child(odd):hover {
            background: linear-gradient( rgba(255, 255, 255, 0.70), rgba(255, 255, 255, 0.70) ), var(--bs-primary);
        }

    .site-table tbody tr:nth-child(odd) .sticky-col {
    }

    .site-table .sticky-col {
        position: sticky;
        left: 0;
        z-index: 2; /* keeps it above other cells */
    }

    .site-table .table-empty {
        display: block;
    }
        .site-table .table-empty > td {
            display: block;
            text-align: center;
        }

/* ACTIONS */
.actions-container {
    display: flex;
    justify-content: space-between;
}

.filters-container {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

    .filters-container > .btn {
        width: 100%;
        white-space: nowrap;
    }

.btn.btn-outline-primary.btn-refresh {
    border-radius: 1rem;
}

.btn.btn-primary.btn-show-outage {
    --bs-btn-bg: #072c4e;
    --bs-btn-border-color: #072c4e;
    --bs-btn-hover-bg: #06223c;
    --bs-btn-hover-border-color: #06223c;
    --bs-btn-active-bg: #011f39;
    --bs-btn-active-border-color: #011f39;
    --bs-btn-disabled-bg: #072c4e;
    --bs-btn-disabled-border-color: #072c4e;
    --bs-btn-focus-shadow-rgb: 2 65 122;
    border-radius: 1rem;
}

.btn.btn-primary.btn-show-travaux {
    --bs-btn-bg: #f97e73;
    --bs-btn-border-color: #f97e73;
    --bs-btn-hover-bg: #e4746a;
    --bs-btn-hover-border-color: #e4746a;
    --bs-btn-active-bg: #cc6960;
    --bs-btn-active-border-color: #f97e73;
    --bs-btn-disabled-bg: #f97e73;
    --bs-btn-disabled-border-color: #f97e73;
    --bs-btn-focus-shadow-rgb: 194, 65, 12;
    border-radius: 1rem;
}

/*ICON*/
.outage-icon {
    display: inline-block;
    vertical-align: middle;
    width: 20px;
    height: 20px;
    background: red;
    border-radius: 50%;
    position: relative;
}

    /* the X lines */
    .outage-icon::before,
    .outage-icon::after {
        content: "";
        position: absolute;
        top: 50%;
        left: 50%;
        width: 12px;
        height: 2px;
        background: white;
        transform-origin: center;
    }

    /* first line */
    .outage-icon::before {
        transform: translate(-50%, -50%) rotate(45deg);
    }

    /* second line */
    .outage-icon::after {
        transform: translate(-50%, -50%) rotate(-45deg);
    }

.warning-icon {
    display: inline-block;
    vertical-align: middle;
    width: 20px;
    height: 20px;
    background: #f5a623; /* or #f5a623 */
    border-radius: 50%;
    position: relative;
}

    /* vertical line */
    .warning-icon::before {
        content: "";
        position: absolute;
        top: 4px;
        left: 50%;
        width: 2px;
        height: 8px;
        background: white;
        transform: translateX(-50%);
    }

    /* dot */
    .warning-icon::after {
        content: "";
        position: absolute;
        bottom: 4px;
        left: 50%;
        width: 2px;
        height: 2px;
        background: white;
        transform: translateX(-50%);
    }


/* Responsive behavior */

@media (min-width: 1024px) {
    .main-container {
        min-height: 0;
    }

    .end-panel-main-section {
        height: 100%;
    }

    .panels-container {
        min-height: 0;
    }

    .info-text-container {
        flex: 1 0 auto;
    }

    .table-container {
        width: 100%;
        overflow: auto;
    }
}

@media (max-width: 1024px) {
    .panels-container {
        flex-direction: column;
    }

        .panels-container .start-panel {
            flex: 1 0 45%;
        }
        .panels-container .end-panel {
            min-height: 0;
        }
            .panels-container .end-panel > section {
                height: 100%;
            }
            .panels-container .end-panel .table-container {
                min-height: 180px;
            }

        .panels-container .start-panel, .panels-container .end-panel {
            width: 100%;
            padding: 0;
        }

    .map-search-box .map-search-input {
        font-size: 14px;
    }

    /* Icon */
    .map-search-box .map-search-icon {
        width: 24px;
        height: 24px;
    }

        /* SVG centered and scaled */
        .map-search-box .map-search-icon .icon {
            width: 16px;
            height: 16px;
        }

    .filters-container {
        width: 100%;
        flex-direction: row;
        justify-content: space-around;
    }
    .refresh-container {
        display: none;
    }
}
