/* =========================================
   VVG City Map — Frontend CSS
   vivigreen.art
   ========================================= */

/* Wrapper principale */
.vvg-city-map-wrapper {
    margin: 2em 0;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, .12);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* Header */
.vvg-map-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    background: #1b4332;
    color: #fff;
    padding: 10px 16px;
}

.vvg-map-label {
    font-size: 13px;
    letter-spacing: .3px;
}

.vvg-map-label strong {
    color: #95d5b2;
}

/* Toggle pedonale/ciclabile */
.vvg-toggle-wrapper {
    display: flex;
    gap: 6px;
}

.vvg-toggle {
    background: rgba(255,255,255,.12);
    border: 1px solid rgba(255,255,255,.25);
    color: #ccc;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    cursor: pointer;
    transition: background .2s, color .2s;
}

.vvg-toggle.active,
.vvg-toggle:hover {
    background: #52b788;
    border-color: #52b788;
    color: #fff;
}

/* Leaflet map */
.vvg-leaflet-map {
    width: 100%;
    display: block;
    background: #e8f4f0;
    z-index: 1;
}

/* Footer */
.vvg-map-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
    background: #f0f7f4;
    border-top: 1px solid #d8eddf;
    padding: 8px 16px;
    font-size: 12px;
    color: #666;
}

.vvg-map-credits a {
    color: #2d6a4f;
    text-decoration: none;
}
.vvg-map-credits a:hover { text-decoration: underline; }

.vvg-map-stats {
    color: #1b4332;
    font-weight: 500;
}

/* Marker personalizzato */
.vvg-custom-marker {
    background: none !important;
    border: none !important;
    cursor: pointer;
}

/* Popup */
.vvg-leaflet-popup .leaflet-popup-content-wrapper {
    border-radius: 10px;
    padding: 0;
    overflow: hidden;
    box-shadow: 0 6px 24px rgba(0,0,0,.18);
}

.vvg-leaflet-popup .leaflet-popup-content {
    margin: 0;
    width: 240px !important;
}

.vvg-popup {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.vvg-popup-img {
    width: 100%;
    height: 130px;
    object-fit: cover;
    display: block;
}

.vvg-popup-body {
    padding: 12px 14px;
}

.vvg-popup-title {
    display: block;
    font-size: 14px;
    font-weight: 700;
    color: #1b4332;
    margin-bottom: 5px;
    line-height: 1.3;
}

.vvg-popup-excerpt {
    font-size: 12px;
    color: #555;
    line-height: 1.5;
    margin: 0 0 8px;
}

.vvg-popup-link {
    display: inline-block;
    background: #2d6a4f;
    color: #ffffff !important;
    text-decoration: none !important;
    font-size: 12px;
    font-weight: 600;
    padding: 5px 12px;
    border-radius: 20px;
    transition: background .2s;
}
.vvg-popup-link:hover {
    background: #1b4332;
    color: #ffffff !important;
}

.vvg-leaflet-popup .leaflet-popup-tip {
    background: #fff;
}
.vvg-leaflet-popup .leaflet-popup-close-button {
    color: #fff;
    background: #2d6a4f;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    top: 6px;
    right: 6px;
    line-height: 22px;
    text-align: center;
}

/* Stato vuoto */
.vvg-map-empty {
    padding: 40px;
    text-align: center;
    color: #888;
    font-size: 14px;
}

/* Mobile */
@media (max-width: 600px) {
    .vvg-map-header {
        flex-direction: column;
        align-items: flex-start;
    }
    .vvg-leaflet-popup .leaflet-popup-content {
        width: 200px !important;
    }
    .vvg-popup-img { height: 100px; }
    .vvg-map-footer {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* =========================================
   Geocoder nella sidebar admin — fix posizione
   ========================================= */
.leaflet-control-geocoder {
    left: auto !important;
    right: 0 !important;
}

.leaflet-control-geocoder-form {
    display: flex !important;
}

.leaflet-control-geocoder-form input {
    width: 220px !important;
    min-width: 0 !important;
    font-size: 12px !important;
}

.leaflet-control-geocoder-expanded {
    direction: ltr;
}

.leaflet-control-geocoder-alternatives {
    width: 220px !important;
    right: 0 !important;
    left: auto !important;
    font-size: 12px !important;
}

/* =========================================
   "Come arrivare" — pulsanti nel popup
   ========================================= */
.vvg-directions-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 10px;
    padding-top: 8px;
    border-top: 1px solid #eee;
    gap: 8px;
}

.vvg-directions-label {
    font-size: 11px;
    color: #888;
    font-weight: 600;
    white-space: nowrap;
}

.vvg-directions-btns {
    display: flex;
    gap: 4px;
}

.vvg-dir-btn {
    background: #f0f7f4;
    border: 1px solid #d8eddf;
    border-radius: 6px;
    width: 30px;
    height: 30px;
    font-size: 15px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .15s, transform .1s;
    padding: 0;
}

.vvg-dir-btn:hover {
    background: #2d6a4f;
    transform: scale(1.08);
}

.vvg-dir-status {
    font-size: 11px;
    color: #1b4332;
    margin-top: 6px;
    min-height: 14px;
    line-height: 1.4;
}

/* Marker posizione utente */
.vvg-user-marker {
    background: none !important;
    border: none !important;
}
