/* Sidebar section fade transitions */
.sidebar-section {
    animation: fadeIn 0.25s ease-in-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}



/* Ensure map takes full height */
#map {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 100%;
    background: #1a1a2e;
}

body {
    background: #1a1a2e;
    overflow: hidden;
}

/* Smooth transitions - scoped to UI elements only, not map internals */
button, a, input, .sidebar, #sidebar {
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

/* Custom scrollbar for sidebar */
#sidebar::-webkit-scrollbar {
    width: 6px;
}

#sidebar::-webkit-scrollbar-track {
    background: #f1f1f1;
}

#sidebar::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 3px;
}

#sidebar::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Ensure inputs don't have spinner arrows */
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

input[type="number"] {
    -moz-appearance: textfield;
}

/* Map marker pulse animation */
@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(59, 130, 246, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(59, 130, 246, 0);
    }
}

.pulse {
    animation: pulse 2s infinite;
}

/* Flexbox utilities for map controls */
.flex {
    display: flex;
}

.items-center {
    align-items: center;
}

.gap-2 {
    gap: 0.5rem;
}

.mb-2 {
    margin-bottom: 0.5rem;
}

.pb-2 {
    padding-bottom: 0.5rem;
}

.border-b {
    border-bottom-width: 1px;
}

.border-gray-200 {
    border-color: #e5e7eb;
}

/* Custom map controls */
.maplibregl-ctrl select,
.maplibregl-ctrl button {
    background: white;
    border: none;
    box-shadow: 0 0 0 2px rgba(0,0,0,.1);
    border-radius: 4px;
    cursor: pointer;
}

.maplibregl-ctrl select:hover,
.maplibregl-ctrl button:hover {
    background: #f8f9fa;
}

.maplibregl-ctrl select:focus,
.maplibregl-ctrl button:focus {
    outline: 2px solid #3B82F6;
    outline-offset: 2px;
}

/* Popup styling */
.maplibregl-popup-content {
    padding: 8px 12px;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.maplibregl-popup-close-button {
    font-size: 18px;
    padding: 0 6px;
}

/* Make controls more visible */
.maplibregl-ctrl-group button {
    width: 30px;
    height: 30px;
}

/* Button hover effects */
button {
    cursor: pointer;
    transition: all 0.2s ease;
}

button:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

button:active {
    transform: translateY(0);
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    #sidebar {
        position: absolute;
        z-index: 1000;
        width: 100%;
        max-height: 50vh;
        bottom: 0;
        right: 0;
        border-left: none;
        border-top: 1px solid #e5e7eb;
    }
    
    .flex {
        flex-direction: column;
    }
    
    /* Move map hint on mobile */
    .absolute.top-4.left-4 {
        top: 60px;
        left: 10px;
        font-size: 0.75rem;
        padding: 0.5rem;
    }
}

/* Ensure sidebar is on the right on desktop */
@media (min-width: 769px) {
    #sidebar {
        order: 2;
    }
}