/* === General Body & Font Styles === */
body {
    font-family: 'Inter', sans-serif;
    margin: 0; /* Reset default margin */
}

/* === Leaflet Map & Control Styles === */
#map {
    width: 100%;
    height: 100%;
    border-radius: 0;
}

/* Ensure Leaflet controls appear above other UI elements */
.leaflet-control-container {
    z-index: 10;
}

/* Custom tooltip style for map popups */
.custom-leaflet-tooltip {
    background-color: rgba(255, 255, 255, 0.95);
    border-radius: 6px;
    padding: 8px 12px;
    font-size: 12px;
    color: #2d3748; /* Tailwind gray-800 */
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.15);
    border: 1px solid #e2e8f0; /* Tailwind gray-300 */
}

/* === Collapsible Panel Animation === */
.collapsible {
    transition: max-height 0.35s ease-in-out, opacity 0.3s ease-in-out, padding 0.35s ease-in-out, margin 0.35s ease-in-out;
    opacity: 1;
    overflow: hidden;
}

.collapsed {
    max-height: 0 !important; /* !important is used to override inline styles during animation */
    opacity: 0;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    margin-top: 0 !important;
    border-width: 0 !important;
}

/* === Loading Indicators & Progress Bars === */

/* Keyframe animation for spinners */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Large loader for the initial data loading modal */
.loader {
    border: 5px solid #e5e7eb; /* Tailwind gray-200 */
    border-top: 5px solid #4f46e5; /* Tailwind indigo-600 */
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
}

/* Smaller loader for the search status indicator */
.loader-small {
    border: 4px solid #e5e7eb;
    border-top: 4px solid #4f46e5;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    animation: spin 0.8s linear infinite;
}

/* Progress bar styles */
.progress-bar-container {
    width: 100%;
    background-color: #e5e7eb; /* Tailwind gray-200 */
    border-radius: 0.375rem; /* rounded-md */
    overflow: hidden;
    height: 1rem; /* h-4 */
}

.progress-bar {
    height: 100%;
    background-color: #4f46e5; /* Tailwind indigo-600 */
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem; /* text-xs */
    line-height: 1rem;
    transition: width 0.3s ease-in-out;
    border-radius: 0.375rem;
}

/* === Custom Scrollbar === */
.custom-scrollbar::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

.custom-scrollbar::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
    background: #a0aec0; /* Tailwind gray-500 */
    border-radius: 10px;
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background: #718096; /* Tailwind gray-600 */
}

/* === UI Interaction Styles === */

/* Style for a path instruction when its map segment is clicked */
.highlighted-instruction {
    background-color: #ebf4ff; /* Tailwind blue-100 */
    box-shadow: 0 0 0 2px #6366f1; /* Tailwind indigo-500 ring */
    transition: background-color 0.3s, box-shadow 0.3s;
}