/* Mostra il pulsante di geolocalizzazione solo su smartphone e tablet (schermi <= 1024px) */
@media (min-width: 1025px) {
    .mobile-only-btn {
        display: none !important;
    }
}

/* Nascondi i pulsanti ad icona nativi di Leaflet sulla mappa */
.leaflet-control-measure-toggle {
    display: none !important;
}

#search .select2-container {
    width: 100% !important;
}

.select2-container--open {
    z-index: 11000;
}

#featureModalHeader {
    cursor: move;
    user-select: none;
}

#featureModalDialog.is-dragging {
    transition: none !important;
}

/* ===== POPUP MAPPA ===== */
.leaflet-popup-content-wrapper {
    background: #ffffff !important;
    color: #1e293b !important;
    border: 1px solid #cbd5e1 !important;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1) !important;
    padding: 0 !important;
    overflow: hidden !important;
    min-width: 320px;
    border-radius: 8px !important;
}
.leaflet-popup-content {
    margin: 0 !important;
    width: 100% !important;
}
.popup-feature {
    width: 100%;
}
.leaflet-popup-tip-container {
    display: none !important;
}
.leaflet-container a.leaflet-popup-close-button {
    color: #fbfbfc !important;
    padding: 8px 10px !important;
    font-size: 16px !important;
    top: -9px !important;
    right: 4px !important;
    z-index: 2;
}
.leaflet-container a.leaflet-popup-close-button:hover {
    color: #0f172a !important;
    background: rgba(0,0,0,0.05) !important;
    border-radius: 50% !important;
}

.popup-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 8px 36px 8px 12px;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
}
.popup-coords {
    font-size: 12px;
    color: #475569;
    font-family: 'Courier New', monospace;
    font-weight: 700;
    letter-spacing: 0.3px;
}
.popup-badge {
    font-size: 10px;
    font-weight: 700;
    padding: 2px 9px;
    border-radius: 20px;
    background: #3b82f6;
    color: #fff;
    white-space: nowrap;
    flex-shrink: 0;
}

.popup-feature {
    border-bottom: 1px solid #e2e8f0;
}
.popup-feature:last-child { border-bottom: none; }

.popup-feature-title {
    padding: 7px 12px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    background: rgba(59,130,246,0.06);
    color: #1e3a8a;
    border-left: 3px solid #3b82f6;
}

.popup-table {
    width: 100% !important;
    border-collapse: collapse;
    background: #ffffff !important;
}
.popup-table tr:nth-child(even) { background: #f8fafc !important; }
.popup-table tr:hover { background: #f1f5f9 !important; }
.popup-table th {
    text-align: left;
    padding: 6px 12px;
    font-size: 12px;
    color: #0f172a;
    font-weight: 600;
    width: 38%;
    white-space: nowrap;
    background: transparent !important;
    border-right: 1px solid #e2e8f0;
}
.popup-table td {
    padding: 6px 12px;
    font-size: 12px;
    color: #334155;
    background: transparent !important;
    word-break: break-word;
}

.popup-actions {
    padding: 8px 12px;
    text-align: center;
    background: rgba(59,130,246,0.1);
}
.popup-btn {
    display: inline-block;
    padding: 5px 16px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none !important;
    background: #3b82f6;
    color: #ffffff !important;
    border: 1px solid rgba(59,130,246,0.3);
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}
.popup-btn:hover {
    background: rgba(59,130,246,0.3) !important;
    color: #bfdbfe !important;
}

.popup-empty {
    padding: 14px 16px;
    font-size: 12px;
    color: #64748b;
    text-align: center;
}
/* ===== END POPUP MAPPA ===== */
