/* Stili per il drag and drop dei waypoints */
/* Hint drag waypoints (ora visibile e stilato tramite .mobile-modal-hint aggiunta dinamicamente) */
.waypoints-drag-hint {
    display: block;
    margin: 12px 20px 10px 20px;
}

.waypoint-item {
    position: relative;
    cursor: grab;
    transition: all 0.2s ease;
    user-select: none;
}

.waypoint-item::before {
    content: "⋮⋮";
    position: absolute;
    left: 8px;
    top: 50%;
    transform: translateY(-50%);
    color: #999;
    font-size: 14px;
    line-height: 1;
    pointer-events: none;
}

.waypoint-info {
    margin-left: 28px;
}

.waypoint-item:active {
    cursor: grabbing;
}

.waypoint-item.dragging {
    opacity: 0.5;
    background: #f5f5f5;
    transform: scale(0.98);
}

.waypoint-item.drag-over {
    border-bottom: 2px solid #4CAF50;
    padding-bottom: 8px;
    margin-bottom: -2px;
}

@media (max-width: 768px) {
    .waypoint-item {
        touch-action: none; /* Migliora il drag&drop su mobile */
        padding: 16px 12px 16px 36px;
        border-bottom: 1px solid #eee;
        margin: 0;
    }
    
    .waypoint-item.dragging {
        background: rgba(76, 175, 80, 0.1);
        border: 2px solid #4CAF50;
    }

    .waypoint-item::before {
        left: 12px;
        font-size: 16px;
    }

    .waypoints-drag-hint {
        display: block;
        margin: 10px 16px 8px 16px;
    }
    
    #mobile-waypoints-list .waypoint-info {
        margin-left: 12px;
    }

    .mobile-waypoints-list .waypoint-item:last-child {
        border-bottom: none;
    }
}

/* Spaziatura migliorata per i waypoint nel modal mobile */
@media (max-width: 768px) {
    .mobile-waypoints-list {
        display: flex;
        flex-direction: column;
    padding: 16px 14px 56px 14px; /* meno padding generale */
        overflow-y: auto;
    }
    .mobile-waypoints-list .waypoint-item {
        border: 1px solid #e2e2e2;
        border-radius: 12px;
    background: #ffffff;
    margin: 4px 0; /* meno gap verticale */
    padding: 10px 10px 10px 40px; /* compatto */
    box-shadow: 0 1px 2px rgba(0,0,0,0.06);
        border-bottom: none; /* elimina linea inferiore precedente */
    }
    .mobile-waypoints-list .waypoint-item::before {
    left: 14px;
    font-size: 16px; /* ridotto */
    }
    .mobile-waypoints-list .waypoint-item.dragging {
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
    transform: scale(0.985);
    }
    .mobile-waypoints-list .waypoint-item.drag-over {
    border-color: #4CAF50;
    box-shadow: 0 0 0 2px rgba(76,175,80,0.2);
    }
    .mobile-waypoints-list .waypoint-item:last-child {
    margin-bottom: 20px; /* leggermente ridotto */
    }
}
