/* ===== Reset & Base ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    overflow: hidden;
}

/* ===== Toolbar ===== */
#toolbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    background: #2196F3;
    color: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

#title {
    font-size: 18px;
    font-weight: 600;
    white-space: nowrap;
}

#toolbar-buttons {
    display: flex;
    gap: 8px;
}

.toolbar-btn {
    padding: 6px 14px;
    border: none;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    font-size: 13px;
    cursor: pointer;
    transition: background 0.2s;
    white-space: nowrap;
}

.toolbar-btn:hover {
    background: rgba(255, 255, 255, 0.35);
}

.toolbar-btn.active {
    background: white;
    color: #2196F3;
    font-weight: 600;
}

/* ===== Map ===== */
#map {
    position: fixed;
    top: 50px;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1;
}

/* ===== Modal ===== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2000;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: white;
    border-radius: 12px;
    padding: 24px;
    width: 90%;
    max-width: 420px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
}

.modal-content h2 {
    margin-bottom: 16px;
    font-size: 18px;
    color: #333;
}

.form-group {
    margin-bottom: 14px;
}

.form-group label {
    display: block;
    margin-bottom: 4px;
    font-size: 13px;
    color: #555;
    font-weight: 500;
}

.form-group input[type="text"],
.form-group textarea {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.2s;
}

.form-group input[type="text"]:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #2196F3;
}

.form-group textarea {
    resize: vertical;
}

/* ===== Star Rating ===== */
.star-rating {
    display: flex;
    gap: 4px;
    cursor: pointer;
}

.star {
    font-size: 26px;
    color: #ddd;
    transition: color 0.15s;
    user-select: none;
}

.star:hover,
.star.active {
    color: #FFC107;
}

/* ===== Form Actions ===== */
.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 18px;
}

.btn-primary {
    padding: 8px 20px;
    border: none;
    border-radius: 6px;
    background: #2196F3;
    color: white;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-primary:hover {
    background: #1976D2;
}

.btn-secondary {
    padding: 8px 20px;
    border: 1px solid #ccc;
    border-radius: 6px;
    background: white;
    color: #555;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-secondary:hover {
    background: #f5f5f5;
}

/* ===== Custom Info Window (Leaflet Popup) ===== */
.leaflet-popup-content-wrapper {
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.18);
    padding: 0;
}

.leaflet-popup-content {
    margin: 0;
    padding: 14px 16px;
    min-width: 180px;
}

.popup-title {
    font-size: 15px;
    font-weight: 600;
    color: #333;
    margin-bottom: 4px;
}

.popup-desc {
    font-size: 12px;
    color: #666;
    margin-bottom: 6px;
    line-height: 1.4;
}

.popup-rating {
    font-size: 14px;
    color: #FFC107;
    margin-bottom: 6px;
}

.popup-coords {
    font-size: 11px;
    color: #999;
    margin-bottom: 8px;
}

.popup-delete-btn {
    display: inline-block;
    padding: 4px 12px;
    border: none;
    border-radius: 4px;
    background: #f44336;
    color: white;
    font-size: 12px;
    cursor: pointer;
    transition: background 0.2s;
}

.popup-delete-btn:hover {
    background: #d32f2f;
}

/* ===== Route Info Popup ===== */
.route-info {
    text-align: center;
    padding: 6px 0;
}

.route-info .route-distance {
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

.route-info .route-time {
    font-size: 13px;
    color: #666;
}

/* ===== Route Selected Marker Style ===== */
.marker-selected {
    filter: hue-rotate(120deg) brightness(1.2);
}

/* ===== Hide default Leaflet Routing Machine UI ===== */
.leaflet-routing-container {
    display: none;
}

/* ===== Mobile Responsive (<=600px) ===== */
@media (max-width: 600px) {
    #toolbar {
        padding: 8px 10px;
        flex-wrap: wrap;
        gap: 6px;
    }

    #title {
        font-size: 15px;
        width: 100%;
        text-align: center;
        margin-bottom: 2px;
    }

    #toolbar-buttons {
        width: 100%;
        justify-content: center;
    }

    .toolbar-btn {
        padding: 5px 10px;
        font-size: 12px;
    }

    .modal-content {
        padding: 16px;
        width: 95%;
    }

    .modal-content h2 {
        font-size: 16px;
    }

    #map {
        top: 90px;
    }
}
