@font-face { font-family: "Sans 3"; src: url('SourceSans3-VariableFont_wght.ttf'); }

#legend {
    position: fixed;
    bottom: 20px;
    left: 20px;
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 12px;
    max-width: 240px;
    font-family: Inter, sans-serif;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

#legend .legend-title {
    font-weight: 700;
    margin-bottom: 10px;
    font-size: 14px;
    color: #333;
}

#legend .legend-items {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

#legend .legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #333;
}

#legend .legend-swatch {
    width: 16px;
    height: 16px;
    border-radius: 3px;
    border: 1px solid #ccc;
    flex-shrink: 0;
}

.switch-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 16px;
    padding: 8px 12px;
    background-color: #f8f8f8;
    border: 1px solid #ddd;
    border-radius: 8px;
    cursor: pointer;
    margin-top: 8px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.switch-label input {
    display: none;
}

.slider {
    position: relative;
    width: 50px;
    height: 24px;
    background-color: #ccc;
    border-radius: 24px;
    transition: background-color 0.3s;
}

.slider::before {
    content: "";
    position: absolute;
    width: 20px;
    height: 20px;
    left: 2px;
    top: 2px;
    background-color: white;
    border-radius: 50%;
    transition: transform 0.3s;
}

input:checked + .slider {
    background-color: #0078d4;
}

input:checked + .slider::before {
    transform: translateX(26px);
}

.toast-container {
    position: fixed;
    bottom: 20px;
    left: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 9999;
}

.toast {
    background: rgba(0, 0, 0, 0.85);
    color: #fff;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    opacity: 0;
    transform: translateY(-20px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

.top-bar {
    display: flex;
    align-items: center;
    justify-content: flex-start; /* puoi usare space-between se vuoi separare */
    padding: 10px 16px;
    background: #fff;
    border-bottom: 1px solid #eee;
    gap: 12px; /* spazio tra hamburger e ricerca */
}

#hamburger-btn {
    font-size: 24px;
    background: transparent;
    border: none;
    cursor: pointer;
}

.top-search {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1; /* occupa spazio disponibile */
}

.top-search input {
    flex: 1;
    padding: 8px 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 16px;
}

.top-search button {
    padding: 8px 10px;
    border-radius: 6px;
    border: 1px solid #ddd;
    background: #f8f8f8;
    cursor: pointer;
}

#side-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.18);
    opacity: 0;
    visibility: hidden;
    transition: opacity 200ms ease, visibility 200ms ease;
    z-index: 999; /* sotto al side-drawer ma sopra al resto */
}

#side-overlay.visible {
    opacity: 1;
    visibility: visible;
}

#side-drawer {
    position: fixed;
    top: 0;
    left: 0;
    width: 320px;
    max-width: 80vw;
    height: 100vh;
    background: #fff;
    box-shadow: 4px 0 16px rgba(0,0,0,.2);
    transform: translateX(-100%);
    transition: transform 280ms ease;
    z-index: 1000; /* sopra overlay */
    display: flex;
    flex-direction: column;
}

#side-drawer.open {
    transform: translateX(0);
}

.drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-bottom: 1px solid #eee;
}

#side-drawer .content {
    padding: 12px 10px;
    overflow-y: auto;
    flex: 1;
}

#side-drawer .actions {
    list-style: none;
    padding: 0;
    margin: 0;
}

#side-drawer .actions li {
    margin-bottom: 10px;
}

#side-drawer .actions button {
    width: 100%;
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid #ddd;
    background: #f8f8f8;
    cursor: pointer;
    text-align: left;
    transition: background-color .25s ease, color .25s ease;
}

#side-drawer .actions button:hover {
    background-color: #000;
    color: #fff;
}

.drawer-search {
    display: flex;
    gap: 8px;
    margin-top: 16px;
}

.drawer-search input {
    flex: 1;
    padding: 8px 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
}

.drawer-search button {
    padding: 8px 10px;
    border-radius: 6px;
    border: 1px solid #ddd;
    background: #f8f8f8;
    cursor: pointer;
}

.drawer-footer {
    border-top: 1px solid #eee;
    padding: 10px 12px;
    color: #666;
}

body.side-drawer-open {
    overflow: hidden;
}

@media (max-width: 768px) {
    #side-drawer {
        width: 100vw !important;
        max-width: none !important;
        height: 100vh !important;
        transform: translateX(-100%);
    }
    #side-drawer.open {
        transform: translateX(0);
    }
    #side-close {
        font-size: 28px;
        padding: 10px;
    }
}



#side-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.18);
    opacity: 0;
    visibility: hidden;
    transition: opacity 200ms ease, visibility 200ms ease;
    z-index: 999;
}

#side-overlay.visible {
    opacity: 1;
    visibility: visible;
}

#side-drawer {
    position: fixed;
    top: 0;
    left: 0;
    width: 320px;
    max-width: 80vw;
    height: 100vh;
    background: #fff;
    box-shadow: 4px 0 16px rgba(0,0,0,.2);
    transform: translateX(-100%);
    transition: transform 280ms ease;
    z-index: 1000;
    display: flex;
    flex-direction: column;
}

#side-drawer.open {
    transform: translateX(0);
}

.drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-bottom: 1px solid #eee;
}

#side-drawer .content {
    padding: 12px 10px;
    overflow-y: auto;
    flex: 1;
}

#side-drawer .actions {
    list-style: none;
    padding: 0;
    margin: 0;
}

#side-drawer .actions li {
    margin-bottom: 10px;
}

#side-drawer .actions button {
    width: 100%;
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid #ddd;
    background: #f8f8f8;
    cursor: pointer;
    text-align: left;
    transition: background-color .25s ease, color .25s ease;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

#side-drawer .actions button:hover {
    background-color: #000;
    color: #fff;
}

.drawer-search {
    display: flex;
    gap: 8px;
    margin-top: 16px;
}

.drawer-search input {
    flex: 1;
    padding: 8px 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
}

.drawer-search button {
    padding: 8px 10px;
    border-radius: 6px;
    border: 1px solid #ddd;
    background: #f8f8f8;
    cursor: pointer;
}

.drawer-footer {
    border-top: 1px solid #eee;
    padding: 10px 12px;
    color: #666;
}

body.side-drawer-open {
    overflow: hidden;
}

@media (max-width: 768px) {
    #side-drawer {
        width: 100vw !important;
        max-width: none !important;
        height: 100vh !important;
        transform: translateX(-100%);
    }
    #side-drawer.open {
        transform: translateX(0);
    }
    #side-close {
        font-size: 28px;
        padding: 10px;
    }
}

.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.4);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    z-index: 998;
}
.overlay.open {
    opacity: 1;
    pointer-events: auto;
}

.drawer {
    font-family:  "Montserrat", "Sans 3", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Inter", Arial, sans-serif;
    position: fixed;
    right: 0;
    top: 0;
    width: 30%;
    height: 100%;
    background: #fff;
    box-shadow: -2px 0 5px rgba(0,0,0,0.2);
    overflow-y: auto;
    transform: translateX(100%);
    transition: transform 0.4s ease-in-out; /* animazione fluida */
    z-index: 999;
}

@media (max-width: 768px) {
    .drawer {
        width: 100%;
    }
}

.drawer.open {
    transform: translateX(0);
}

.drawer-header {
    display: flex;
    justify-content: space-between;
    padding: 10px;
    border-bottom: 1px solid #ccc;
}

@media (max-width: 768px) {
    .drawer {
        width: 100%;
    }
}

.drawer-content table {
    table-layout: fixed;
    width: 100%;
}
.drawer-content td:last-child {
    width: 75%;
}


.drawer-content td {
    padding: 8px;
    border-bottom: 1px solid #eee;
    word-break: break-word;
    white-space: normal;
}

.drawer-content td:first-child {
    font-weight: bold;
    width: 40%;
}

button {
    transition: background-color 0.4s ease, color 0.4s ease;
    background-color: white;
    color: black;
    border: none;
    padding: 10px 20px;
    text-align: center;
    text-decoration: none;
    display: inline-block;
    font-size: 16px;
    margin: 4px 2px;
    cursor: pointer;
    border-radius: 4px;
}

.custom-file-upload {
    display: none;
}

  button:hover {
    background-color: black;
    color: white;
}

.fade-link {
    color: black;
    text-decoration: none;
    border-radius: 4px;
    background-color: white;
    transition: background-color 0.4s ease, color 0.4s ease;
}

.fade-link:hover {
    background-color: black;
    color: white;
}

input[type="file"] {
    display: none;
}

input[type="text"] {
    width: 100%;
    padding: 10px;
    margin: 8px 0;
    box-sizing: border-box;
    border: none;
    border-bottom: 2px solid black;
    font-size: 16px;
    font-family:  "Montserrat", "Sans 3", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Inter", Arial, sans-serif;
}

.hidden {
    display: none!important;
}

input[type="text"]::placeholder {
    color: #aaa;
    font-style: italic;
    display: none;
}

.container {
    display: flex;
    align-items: center;
    gap: 10px; /* Spazio tra gli elementi */
    margin-bottom: 10px;
}



#map {
    width: 100%;
    height: 700px;
    border: 1px solid #ccc;
}


.drawer-footer {
    font-size: 18px;
    text-align: center;
}

a {
    color: black;
}

h1, h3, text, #serviceInfo, label, button, a, footer, span {
    font-family:  "Montserrat", "Sans 3", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Inter", Arial, sans-serif;
}

footer {
    font-size: 8px;
    text-align: center;
}
text {
    font-size: 12px;
    pointer-events: none;
}
line {
    stroke: #999;
    stroke-width: 2px;
}
circle {
    stroke: #000;
    stroke-width: 1px;
    cursor: pointer;
}
.tooltip {
    position: absolute;
    text-align: center;
    width: auto;
    height: auto;
    padding: 5px;
    font: 12px sans-serif;
    background: lightsteelblue;
    border: 0px;
    border-radius: 8px;
    pointer-events: none;
    opacity: 0;
}

#serviceInfo {
    display: none;
    border: 1px solid #ccc;
    padding: 10px;
    margin-top: 20px;
}

.list-view {
    background: #fff;
    border-top: 1px solid #ddd;
    font-family:  "Montserrat", "Sans 3", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Inter", Arial, sans-serif;
    overflow-y: auto;
    padding: 0 1.2rem 1rem;
    position: relative;
    z-index: 1;
}

.result-table td,
.result-table th {
    padding: 12px 10px;
}

.result-table { width: 100%; border-collapse: collapse; font-size: 15px; color: #111; --cols: 6; }
.result-table thead th {
    position: sticky;
    top: 0;
    z-index: 50;

    background: #ffffff;

    border-bottom: 2px solid #ccc;

    font-weight: bold;
    font-size: 15px;
    letter-spacing: 0.4px;
    padding: 12px 10px;

    box-shadow: 0 3px 8px rgba(0,0,0,0.10);

    backdrop-filter: none !important;
}

.col-op {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 19px;
    height: 19px;

    border: none;
    background: white;
    color: black;

    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;

    transition: background-color 0.4s ease, color 0.4s ease;
    line-height: 18px;
    font-size: 13px;
    padding: 0;
    margin-left: 4px;
}

.col-op:hover {
    background-color: black;
    color: white;
}

.result-table tbody tr:hover,
.result-table tbody tr:hover * {
    background-color: #eaeaea !important;
    color: #111 !important;
}

.result-table tbody tr {
    transition: background-color 0.25s ease, color 0.25s ease;
}

.result-table tbody tr:hover {
    background-color: #eaeaea !important;
    color: #111 !important;
}

.result-table tbody tr:hover * {
    background-color: transparent !important;
    color: #111 !important;
    transition: color 0.25s ease;
}

.result-table thead th {
    position: sticky;
    top: 0;
    z-index: 10;

    background: linear-gradient(
            180deg,
            #fdfdfd 0%,
            #f8f8f8 60%,
            #f2f2f2 100%
    );

    backdrop-filter: blur(2px);

    color: #111;
    font-weight: bold;
    font-size: 15px;
    letter-spacing: 0.4px;

    padding: 12px 10px;
    border-bottom: 2px solid #ccc;

    box-shadow: 0 6px 10px rgba(0,0,0,0.06),
    0 1px 1px rgba(0,0,0,0.08);
}

.result-table thead th:hover {
    background: #eaeaea;
}

.result-table tbody tr {
    border-bottom: 1px solid rgba(0,0,0,0.07);
    background: linear-gradient(
            180deg,
            #ffffff 0%,
            #fcfcfc 100%
    );
}

.result-table tbody tr:hover {
    background: linear-gradient(
            180deg,
            #f5f5f5 0%,
            #eaeaea 100%
    ) !important;
    color: #111 !important;
}

.result-table thead th .th-cell {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.result-table thead th  {
    width: 20px;
    height: 20px;
    line-height: 18px;
    font-size: 13px;
    padding: 0;
    margin-left: 4px;
}

.result-table th:not(:last-child),
.result-table td:not(:last-child) {
    border-right: 1px solid rgba(0,0,0,0.04);
}

.search-toggle { margin-left: 6px; }