/**
 * Zwischenziele (Wegpunkte) – Styling
 * Pfad: pages/route-planner/assets/route-waypoints.css
 * Eingebunden von: pages/route-planner/route-planner.php
 * Logik: pages/route-planner/assets/route-waypoints.js
 *
 * Bewusst eigenes CSS statt Tailwind-Klassen: das lokal kompilierte
 * Tailwind enthält nur tatsächlich verwendete Utilities (violette
 * Farbklassen fehlen z.B. komplett).
 */

#waypoints-section {
    margin-top: -4px;
}

.waypoints-list {
    max-width: 620px;
}

/* ---------- Zeile ---------- */
.waypoint-row {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 5px 0;
}

/* Gestrichelte Verbindungslinie zwischen den Nummern-Badges (Routen-Optik) */
.waypoint-row + .waypoint-row::before {
    content: "";
    position: absolute;
    left: 12px;
    top: -9px;
    height: 14px;
    border-left: 2px dashed #c4b5fd;
}

/* ---------- Nummern-Badge ---------- */
.waypoint-badge {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: #8b5cf6;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    box-shadow: 0 1px 3px rgba(139, 92, 246, 0.4);
}

/* ---------- Eingabefeld ---------- */
.waypoint-input-wrap {
    position: relative;
    flex: 1;
}

.waypoint-input {
    width: 100%;
    padding: 8px 12px;
    font-size: 0.875rem;
    line-height: 1.25rem;
    color: #111827;
    background: #fff;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.waypoint-input::placeholder {
    color: #9ca3af;
}

.waypoint-input:focus {
    border-color: #8b5cf6;
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.15);
}

/* ---------- Autocomplete-Dropdown ---------- */
.waypoint-suggestions {
    position: absolute;
    z-index: 50;
    left: 0;
    right: 0;
    margin-top: 4px;
    max-height: 15rem;
    overflow-y: auto;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.waypoint-suggestion-item {
    padding: 8px 14px;
    font-size: 0.85rem;
    color: #374151;
    cursor: pointer;
}

.waypoint-suggestion-item:hover {
    background: #f5f3ff;
    color: #111827;
}

/* ---------- Aktions-Buttons (hoch/runter/entfernen) ---------- */
.waypoint-actions {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 2px;
    opacity: 0.45;
    transition: opacity 0.15s;
}

.waypoint-row:hover .waypoint-actions,
.waypoint-row:focus-within .waypoint-actions {
    opacity: 1;
}

.waypoint-action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: #6b7280;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

.waypoint-action-btn:hover {
    background: #f3f4f6;
    color: #111827;
}

.waypoint-action-btn:disabled {
    opacity: 0.3;
    cursor: default;
    background: transparent;
}

.waypoint-action-btn.waypoint-action-remove:hover {
    background: #fef2f2;
    color: #dc2626;
}

/* ---------- Hinzufügen-Button ---------- */
.waypoint-add-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 4px;
    padding: 6px 14px;
    font-size: 0.85rem;
    font-weight: 500;
    color: #7c3aed;
    background: #faf5ff;
    border: 1px dashed #c4b5fd;
    border-radius: 9999px;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}

.waypoint-add-btn:hover {
    background: #f3e8ff;
    border-color: #a78bfa;
}

.waypoint-add-btn svg {
    width: 14px;
    height: 14px;
}
