/* geomap-viewer.css */

.geomap-viewer-wrap {
    display: flex;
    border: 1px solid #ddd;
    border-radius: 10px;
    overflow: hidden;
    font-family: inherit;
    margin: 2rem 0;
    position: relative;
}

/* ── Sidebar ── */
.geomap-sidebar {
    width: 220px;
    min-width: 220px;
    background: #f8f8f6;
    border-right: 1px solid #e5e5e5;
    display: flex;
    flex-direction: column;
    padding: 14px 0;
}

.geomap-sidebar-title {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #888;
    padding: 0 16px 10px;
    border-bottom: 1px solid #e5e5e5;
    margin-bottom: 8px;
}

.geomap-layer-list {
    list-style: none;
    margin: 0;
    padding: 0 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.geomap-layer-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 7px;
    cursor: pointer;
    transition: background .15s;
}

.geomap-layer-item:hover {
    background: #efefed;
}

.geomap-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.geomap-layer-label {
    flex: 1;
    font-size: 13px;
    color: #333;
    line-height: 1.3;
}

.geomap-layer-label small {
    display: block;
    font-size: 11px;
    color: #888;
}

/* Toggle button */
.geomap-toggle {
    width: 32px;
    height: 18px;
    border-radius: 9px;
    border: none;
    background: #ccc;
    position: relative;
    cursor: pointer;
    flex-shrink: 0;
    padding: 0;
    transition: background .2s;
}

.geomap-toggle::after {
    content: '';
    position: absolute;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: white;
    top: 2px;
    left: 2px;
    transition: left .2s;
}

.geomap-toggle[aria-pressed="true"] {
    background: #1D9E75;
}

.geomap-toggle[aria-pressed="true"]::after {
    left: 16px;
}

.sr-only {
    position: absolute;
    width: 1px; height: 1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    white-space: nowrap;
}

/* ── Mappa ── */
#geomap-leaflet {
    flex: 1;
    min-height: 400px;
    z-index: 0;
}

/* ── Info panel ── */
.geomap-info-panel {
    position: absolute;
    bottom: 20px;
    right: 20px;
    width: 220px;
    background: white;
    border-radius: 8px;
    border: 1px solid #ddd;
    padding: 12px 14px;
    font-size: 13px;
    z-index: 999;
    box-shadow: 0 2px 8px rgba(0,0,0,.08);
}

.geomap-info-placeholder {
    color: #aaa;
    font-size: 12px;
    margin: 0;
}

.geomap-info-panel h4 {
    margin: 0 0 4px;
    font-size: 14px;
    color: #111;
}

.geomap-info-panel .geomap-info-type {
    font-size: 11px;
    color: #1D9E75;
    margin-bottom: 8px;
}

.geomap-info-panel table {
    width: 100%;
    font-size: 12px;
    border-collapse: collapse;
}

.geomap-info-panel td {
    padding: 3px 0;
    color: #666;
}

.geomap-info-panel td:last-child {
    text-align: right;
    color: #333;
}

.geomap-info-cta {
    display: block;
    margin-top: 10px;
    text-align: center;
    font-size: 12px;
    font-weight: 600;
    color: #0F6E56;
    background: #E1F5EE;
    border-radius: 6px;
    padding: 6px;
    text-decoration: none;
}

.geomap-info-cta:hover {
    background: #c8ece0;
    text-decoration: none;
    color: #0F6E56;
}

/* ── Loader ── */
.geomap-loader {
    position: absolute;
    inset: 0;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    transition: opacity .3s;
}

.geomap-loader.is-hidden {
    opacity: 0;
    pointer-events: none;
}

.geomap-spinner {
  width: 48px;
  height: 48px;
  border: 3px dotted #057784;
  border-style: solid solid dotted dotted;
  border-radius: 50%;
  display: inline-block;
  position: relative;
  box-sizing: border-box;
  animation: rotation 2s linear infinite;
}
.geomap-spinner::after {
  content: '';
  box-sizing: border-box;
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  bottom: 0;
  margin: auto;
  border: 3px dotted #468218;
  border-style: solid solid dotted;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  animation: rotationBack 1s linear infinite;
  transform-origin: center center;
}

@keyframes rotation {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

@keyframes rotationBack {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(-360deg);
    }
}
/* ── Responsive ── */
@media (max-width: 640px) {
    .geomap-viewer-wrap {
        flex-direction: column;
    }
    .geomap-sidebar {
        width: 100%;
        min-width: unset;
        border-right: none;
        border-bottom: 1px solid #e5e5e5;
    }
    .geomap-layer-list {
        flex-direction: row;
        flex-wrap: wrap;
    }
    .geomap-info-panel {
        position: relative;
        bottom: auto;
        right: auto;
        width: 100%;
        border-radius: 0;
        border: none;
        border-top: 1px solid #eee;
    }
}
