#map {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    bottom: 0;
    z-index: 1;
}

/* Atlas badge styling */
.atlas-badge {
    font-size: 11px;
    font-weight: 600;
    background: linear-gradient(45deg, #3b82f6, #1d4ed8);
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    margin-left: 8px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    opacity: 0.9;
}

.cross-atlas-layer {
    opacity: 0.85;
    border-left: 3px solid #3b82f6;
}

.cross-atlas-layer .control-title {
    opacity: 0.9;
}

/* General button styling */
button {
    background: #ffffff;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 500;
    color: #374151;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    outline: none;
}

button:hover {
    background: #f9fafb;
    border-color: #9ca3af;
    color: #111827;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

button:active {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

button:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

button:disabled:hover {
    background: #ffffff;
    border-color: #d1d5db;
    color: #374151;
    transform: none;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

/* Primary button variant */
button.primary {
    background: #3b82f6;
    border-color: #3b82f6;
    color: white;
}

button.primary:hover {
    background: #2563eb;
    border-color: #2563eb;
    color: white;
}

/* Secondary button variant */
button.secondary {
    background: #6b7280;
    border-color: #6b7280;
    color: white;
}

button.secondary:hover {
    background: #4b5563;
    border-color: #4b5563;
    color: white;
}

/* Danger button variant */
button.danger {
    background: #ef4444;
    border-color: #ef4444;
    color: white;
}

button.danger:hover {
    background: #dc2626;
    border-color: #dc2626;
    color: white;
}

/* Success button variant */
button.success {
    background: #10b981;
    border-color: #10b981;
    color: white;
}

button.success:hover {
    background: #059669;
    border-color: #059669;
    color: white;
}

/* Small button variant */
button.small {
    padding: 4px 8px;
    font-size: 12px;
}

/* Large button variant */
button.large {
    padding: 12px 24px;
    font-size: 16px;
}

/* Add new styles for the opacity control */
.opacity-control {
    background: white;
    border-radius: 4px;
    box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.1);
    margin-bottom: 1px !important;
    padding: 8px;
}

.opacity-control button {
    background: white;
    border: none;
    cursor: pointer;
    font-weight: 500;
    padding: 6px 12px;
    border-radius: 4px;
    transition: all 0.2s ease;
    width: 100%;
    text-align: left;
}

.opacity-control button:hover {
    background: #f0f0f0;
}

.source-control {
    border-top: 1px solid #e5e5e5;
    padding: 8px 12px;
    max-height: 500px;
    overflow: hidden;
    transition: all .2s ease-in-out;
    opacity: 1;
    margin-top: 0;
    padding: 12px;
    border-top: none;
}

.source-control.collapsed {
    max-height: 0;
    opacity: 0;
    padding: 0;
    border-top: none;
}

.source-control .title {
    font-size: 12px;
    color: #666;
    margin-bottom: 4px;
}

.radio-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.radio-label {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: #333;
    cursor: pointer;
}

.radio-label input[type="radio"] {
    margin: 0;
    cursor: pointer;
}

/* Add padding to prevent controls from sticking to the edge */
.mapboxgl-ctrl.opacity-control {
    margin: 0 0 0 10px;
    /* Remove bottom margin */
    width: 200px;
    /* Set fixed width for consistency */
}

/* Update the margin between controls */
.mapboxgl-ctrl.opacity-control+.mapboxgl-ctrl.opacity-control {
    margin-top: 1px;
    /* Reduce gap between controls */
    border-top: 1px solid #e5e5e5;
    /* Add separator */
    border-radius: 0 0 4px 4px;
    /* Round only bottom corners */
}

/* Style first control's bottom corners when second control is present */
.mapboxgl-ctrl.opacity-control:has(+ .mapboxgl-ctrl.opacity-control) {
    border-radius: 4px 4px 0 0;
    /* Round only top corners */
    margin-bottom: 0;
}

/* Add these styles to fix mobile viewport height including iOS Safari */
html,
body {
    height: 100vh; /* Fallback for older browsers */
    height: 100dvh; /* Dynamic viewport height for iOS Safari */
    margin: 0;
    padding: 0;
    overflow: hidden;
    position: relative;
    width: 100%;
}

/* Full viewport height class for iOS Safari compatibility */
.full-viewport-height {
    height: 100vh; /* Fallback for older browsers */
}

@supports (height: 100dvh) {
    .full-viewport-height {
        height: 100dvh; /* Dynamic viewport height for iOS Safari */
    }
}

/* Update the map container positioning */
#map {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
}


/* Ensure attribution is visible */
.mapboxgl-ctrl-bottom-right {
    bottom: 0 !important;
    z-index: 2;
}

.mapboxgl-ctrl.mapboxgl-ctrl-attrib {
    background-color: #ffffffb5;
    margin: 0 0 0 120px;
    font-size: 12px;
    padding: 6px;
    line-height: 1.2;
}
/* Update these styles */
html,
body {
    height: 100%;
    margin: 0;
    padding: 0;
    overflow: hidden;
    position: relative;
    width: 100%;
}

/* Update main container */
main {
    height: calc(100% - 56px);
    width: 100%;
    position: relative;
    overflow: hidden;
}

/* Update map container */
#map {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
}


/* Add these styles in your existing style section */
.mapboxgl-ctrl-icon svg {
    display: block;
    margin: 2px;
}

.mapboxgl-ctrl-icon {
    padding: 5px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.mapboxgl-ctrl-location {
    background: white;
    border: none;
    cursor: pointer;
    padding: 6px 10px;
    border-radius: 4px;
    font-size: 12px;
    color: #333;
    transition: background-color 0.2s;
}

.mapboxgl-ctrl-location:hover {
    background-color: #f0f0f0;
}

/* Add these to your existing styles */
.mapboxgl-ctrl-geolocate {
    display: flex !important;
    align-items: center;
    width: auto !important;
    min-width: 30px;
    white-space: nowrap;
}

.mapboxgl-ctrl-geolocate .mapboxgl-ctrl-icon {
    margin-right: 0;
    width: 30px!important;
    height: 30px!important;
}

.mapboxgl-ctrl-group {
    width: auto !important;
}

.mapboxgl-ctrl-group button {
    background-color: white;
}
.mapboxgl-ctrl button:not(:disabled):hover {
    background-color: white;
}

/* Add new styles for layer group cards */
.layer-group {
    background: #d6d6d6;
    overflow: hidden;
    opacity: 0.8;
    transition: all 0.3s ease;
    position: relative;
    border-left: 3px solid transparent;
    border-radius: 4px;
    margin-bottom: 8px;
}

.layer-group:hover {
    background: #e8e8e8;
    opacity: 1;
}

.layer-group:last-child {
    margin-bottom: 0;
}

/* Update group header styles */
.group-header {
    display: flex;
    align-items: center;
    position: relative;
    min-height: 48px;
    border-radius: 15px;
    overflow: hidden;
    margin-bottom: 8px;
}

/* Style the checkbox for consistent appearance across systems - to be replaced by toggle switches */
.group-header input[type="checkbox"] {
    margin: 0;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border: 1px solid #ffffff;
    border-radius: 3px;
    position: relative;
    cursor: pointer;
    background-color: #e1e1e1;
}

.group-header input[type="checkbox"]:checked {
    background-color: #ffffff;
    border: 2px solid #ffffff;
}

.group-header input[type="checkbox"]:checked::after {
    content: '';
    position: absolute;
    left: 4px;
    top: 1px;
    width: 5px;
    height: 9px;
    border: solid #050505;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

/* Ensure sublayer checkbox has proper border and contrast */
.sublayer-checkbox {
  border: 1px solid #777 !important;
  background-color: white !important;
}

/* Add existing styles from index.html */
.layer-control-wrapper {
    position: relative;
    margin: 0;
    z-index: 1;
}

.mapboxgl-ctrl.layer-control {
    width: 400px;
    background: #ffffff11;
    margin: 0;
    padding: 0 0 0 55px;
    transition: transform 0.2s ease;
    overflow-y: auto;
    max-height: calc(100vh - 180px);
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1;
}

.mapboxgl-ctrl.layer-control.no-transition {
    transition: none !important;
}

.mapboxgl-ctrl.layer-control.collapsed {
    transform: translateX(-420px);
}

@media (min-width: 768px) {
    .layer-control-wrapper {
        margin: 10px 0 0 10px;
    }
    
    .mapboxgl-ctrl.layer-control {
        max-width: 400px;
    }
}

/* Update header font style */
header h1 {
    font-family: 'Open Sans', sans-serif;
}


/* Popup styles */
.mapboxgl-popup-content {
    padding: 0;
    border: 1px solid #ccc;
    border-radius: 2px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    background: white;
    position: relative;
    overflow: hidden;
}

.mapboxgl-popup-content a{
    text-decoration: underline;
}

/* Ensure text remains readable over the background image */
.map-popup {
    position: relative;
    z-index: 1;
    background: transparent;
}

.mapboxgl-popup-close-button {
    padding: 0;
    width: 24px;
    height: 24px;
    color: hsl(0, 0%, 0%);
    font-size: 16px;
    right: 6px;
    top: 6px;
    z-index: 2;
    background: none;
}

.mapboxgl-popup-close-button:hover {
    background: none;
    color: #000;
}

/* Hover popup styles */
.hover-popup .mapboxgl-popup-content {
    border: 1px solid #ccc;
    background: white;
    color: black;
    padding: 4px 8px;
    font-size: 12px;
    border-radius: 2px;
}

/* Consolidated hover popup styles */
.consolidated-hover-popup .mapboxgl-popup-content {
    background: white;
    border-radius: 4px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.15);
    max-width: 250px;
    overflow: hidden;
}

/* Feature control visual feedback styles */
.layer-details.has-hover {
    border-left-color: #fbbf24 !important; /* Yellow border for hover */
    border-left-width: 4px !important;
}

.layer-details.has-selection {
    border-left-color: #ef4444 !important; /* Red border for selection - sticky until cleared */
    border-left-width: 4px !important;
}

/* Selection takes priority over hover - red stays when selected */
.layer-details.has-hover.has-selection {
    border-left-color: #ef4444 !important; /* Red border takes priority */
    border-left-width: 4px !important;
}

/* Animation for smooth border transitions */
.layer-details {
    transition: border-left-color 0.2s ease, border-left-width 0.2s ease;
}

.consolidated-popup {
    max-height: 200px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(0,0,0,0.2) transparent;
    padding: 8px 10px !important;
}

.consolidated-popup::-webkit-scrollbar {
    width: 4px;
}

.consolidated-popup::-webkit-scrollbar-track {
    background: transparent;
}

.consolidated-popup::-webkit-scrollbar-thumb {
    background-color: rgba(0,0,0,0.2);
    border-radius: 2px;
}

.consolidated-popup .text-xs {
    font-size: 0.7rem;
    font-weight: 500;
    margin-top: 6px;
    border-bottom: 1px solid rgba(0,0,0,0.07);
    padding-bottom: 2px;
}

.consolidated-popup .text-xs:first-child {
    margin-top: 0;
}

.consolidated-popup .text-sm {
    font-size: 0.85rem;
    padding: 2px 0;
}

.hover-popup .mapboxgl-popup-tip {
    border-top-color: white;
}

/* Ensure text is black in both hover and active popups */
.map-popup .text-sm,
.map-popup .text-2xl,
.hover-popup .text-sm {
    color: black !important;
}

/* Update legend container styles */
.legend-container {
    border-top: 1px solid rgba(0,0,0,0.1);
    padding-top: 1rem;
    max-height: 300px; /* Limit maximum height */
    overflow: hidden;
    transition: max-height 0.3s ease;
}

/* Style the legend toggle button */
.legend-container button {
    font-size: 0.875rem;
    padding: 0.25rem 0;
    width: 100%;
    text-align: left;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Style the legend icon */
.legend-container .legend-icon {
    display: inline-block;
    font-size: 0.75rem;
    transition: transform 0.2s ease;
    width: 16px;
    text-align: center;
}

/* Style the legend content wrapper */
.legend-content {
    overflow-y: auto;
    max-height: 250px; /* Limit scrollable area height */
    margin-right: -8px; /* Compensate for scrollbar */
    padding-right: 8px;
    scrollbar-width: thin;
    scrollbar-color: rgba(0,0,0,0.2) transparent;
}

/* Style the legend image */
.legend-content img {
    max-width: 100%;
    height: auto;
    margin-top: 0.5rem;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

/* Webkit scrollbar styles */
.legend-content::-webkit-scrollbar {
    width: 6px;
}

.legend-content::-webkit-scrollbar-track {
    background: transparent;
}

.legend-content::-webkit-scrollbar-thumb {
    background-color: rgba(0,0,0,0.2);
    border-radius: 3px;
}

/* When legend is hidden */
.legend-content.hidden {
    max-height: 0;
    margin-top: 0;
}

/* Modal styles */
.legend-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.75);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.legend-modal:not(.hidden) {
    opacity: 1;
    visibility: visible;
}

.legend-modal-content {
    background: white;
    padding: 1rem;
    border-radius: 8px;
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    overflow: auto;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.legend-modal-content img {
    display: block;
    max-width: 100%;
    height: auto;
}

.legend-modal-close {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    background: white;
    border: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: #666;
    transition: all 0.2s ease;
}

.legend-modal-close:hover {
    background: #f0f0f0;
    color: #000;
}

/* Update legend image cursor */
.legend-content img {
    cursor: pointer;
    transition: opacity 0.2s ease;
}

.legend-content img:hover {
    opacity: 0.9;
}


sl-drawer{
    --header-spacing: 5px;
    --body-spacing:5px;
    color: white;
}
sl-drawer::part(overlay) {
    background: none;
    pointer-events: none; /* Prevent overlay from capturing clicks */
}

sl-drawer::part(panel) {
    background: hsla(0, 0%, 35%, 0.902);
    backdrop-filter: blur(8px);
    border-right: 1px solid rgba(0, 0, 0, 0.1);
    width: 400px;
    z-index: 50;
    padding: 5px 10px;
}

sl-drawer::part(close-button) {
    color: #fdfdfd;
    font-size: 1.5rem;
}

/* Update opacity toggle button styles */
button.opacity-toggle {
    margin-left: auto !important;
    width: 20px !important;
    height: 20px !important;
    border-radius: 50% !important;
    padding: 0 !important;
    border: 2px solid #ddd !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 0 !important;
    background: white !important;
}

button.opacity-toggle[data-opacity="0.5"] {
    background: #999 !important;
}

button.opacity-toggle:hover {
    border-color: #999 !important;
}

button.opacity-toggle.hidden {
    display: none !important;
}

/* Style the opacity toggle sl-icon-button */
sl-icon-button.opacity-toggle {
    --sl-color-primary-600: hsl(0, 0%, 61%) !important;
    --sl-color-primary-500: #fff !important;
    --sl-color-primary-400: #fff !important;
}

sl-icon-button.opacity-toggle::part(base) {
    color: #ffffff !important;
}

sl-icon-button.opacity-toggle::part(base):hover {
    background-color: rgba(255, 235, 59, 0.1) !important;
}

sl-icon-button.opacity-toggle::part(base):active,
sl-icon-button.opacity-toggle::part(base):focus {
    background-color: #a8a8a833 !important;
    color: hsl(0, 0%, 86%) !important;
}

/* Remove old opacity control styles */
.opacity-control {
    display: none;
}


/* Style all skeleton loaders in the drawer */
#layer-controls-loader sl-skeleton::part(base) {
    --border-radius: 0;
    height: 50px;
    width: 100%;
}

/* Add hover effect */
#layer-controls-loader sl-skeleton {
    opacity: 0.8;
}

#layer-controls-loader sl-skeleton:hover {
    opacity: 1;
}

/* Ensure main container is properly positioned for contained drawer */

/* Update map container to be relative for drawer containment */
#map {
    width: 100%;
    height: 100%;
    position: relative;
}

sl-details.map-controls-group::part(base) {
    width: 100%;
}

/* Hide the summary icon for map controls group to prevent interference with background images */
sl-details.map-controls-group::part(summary-icon) {
    display: none;
}

/* Add styles to ensure proper spacing and scrolling for fog settings */
.fog-settings-content {
    max-height: 70vh; /* Limit maximum height */
    overflow-y: auto; /* Enable vertical scrolling if needed */
    padding-right: 8px; /* Add some padding for the scrollbar */
}

/* Add smooth scrolling for a better user experience */
.fog-settings-content {
    scroll-behavior: smooth;
}

/* Style the scrollbar for better visibility */
.fog-settings-content::-webkit-scrollbar {
    width: 6px;
}

.fog-settings-content::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.fog-settings-content::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 3px;
}

.fog-settings-content::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Style the terrain control container */
.terrain-control-container {
    max-height: 400px;  /* Set a maximum height */
    overflow-y: auto;   /* Enable vertical scrolling */
    padding-right: 12px; /* Add padding for scrollbar */
}

/* Style the terrain settings sections */
.terrain-settings-section {
    background: rgba(255, 255, 255, 0.8);
    border-radius: 4px;
    padding: 12px;
    margin-bottom: 12px;
}

/* Style the scrollbar */
.terrain-control-container::-webkit-scrollbar {
    width: 6px;
}

.terrain-control-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.terrain-control-container::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 3px;
}

.terrain-control-container::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Ensure proper spacing for controls */
.terrain-control-container .terrain-settings-section:last-child {
    margin-bottom: 0;
}

/* Style the fog settings checkbox area */
.terrain-control-container label.flex.items-center {
    padding: 8px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.8);
    margin-bottom: 8px;
}

/* Style the input controls */
.terrain-control-container input[type="range"],
.terrain-control-container input[type="color"] {
    width: 100%;
    margin: 4px 0;
}

/* Style the color picker containers */
.terrain-control-container .flex.items-center {
    gap: 8px;
}


/* Add toast notification styles */
.toast-notification {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background-color: #4CAF50;
    color: white;
    padding: 12px 24px;
    border-radius: 4px;
    z-index: 1000;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
    max-width: 90%;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    font-size: 14px;
    line-height: 1.4;
}

.toast-notification.show {
    opacity: 1;
    transform: translateY(0);
}

/* Make toast more visible on iPad */
@media (max-width: 1024px) {
    .toast-notification {
        font-size: 16px;
        padding: 16px 24px;
        bottom: 30px;
        right: 30px;
    }
}

/* Add these attribution-specific styles */
.layer-attribution {
    font-size: 12px;
    color: #777;
    margin-top: 8px;
    border-radius: 4px;
}

a:not(header a) {
    color: #0078A8!important;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}




/* Update basemap control to overlay control */
.overlay-control {
    background: rgba(255, 255, 255, 0.9);
    padding: 12px;
    margin-bottom: 16px;
    border-radius: 4px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.overlay-control label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.overlay-control input[type="checkbox"] {
    margin: 0;
    cursor: pointer;
}

.overlay-control span {
    font-size: 14px;
    color: #333;
}

/* Update the layer control styles to ensure proper scrolling */
.mapboxgl-ctrl.layer-control {
    display: flex;
    flex-direction: column;
}

/* Ensure the overlay control stays at the top */
.layer-control > .overlay-control {
    flex-shrink: 0;
}

/* Update the container for the rest of the controls */
.layer-control > div:not(.overlay-control) {
    flex-grow: 1;
    overflow-y: auto;
}

/* Style the share button */
.share-button {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    font-size: 0.875rem;
    color: #ffffff;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    transition: all 0.2s ease;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.share-button:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.4);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.share-button:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.share-button svg {
    width: 1rem;
    height: 1rem;
}



header .icon-button {
    color: #ffffff !important;
}

/* Options button hover styles - simple and subtle */
.feature-control-button-container sl-button[variant="text"]:hover {
    background-color: rgba(251, 191, 36, 0.15) !important;
}

.feature-control-button-container sl-button[variant="text"]:hover sl-icon {
    color: #fbbf24 !important;
}

/* Active state hover (when drawer is open) - subtle difference */
.feature-control-button-container sl-button[variant="text"][data-drawer-open="true"]:hover {
    background-color: rgba(251, 191, 36, 0.2) !important;
}

/* Smooth transitions for the options button */
.feature-control-button-container sl-button[variant="text"] {
    transition: background-color 0.15s ease !important;
}

.feature-control-button-container sl-button[variant="text"] sl-icon {
    transition: color 0.15s ease !important;
}

#map-controls-drawer sl-details::part(header) {
    padding: 0;
}
sl-details::part(header) {
    opacity: 0.9;
    padding: 0px;
}
sl-details::part(header):hover {
    opacity: 1;
}
sl-details::part(base) {
    padding: 0px;
}
sl-details::part(content) {
    padding: 0px;
}
sl-drawer sl-details::part(base) {
    padding: 0;
    border: 1px solid #535353;
    box-shadow: inset 0px 0px 3px rgb(69 69 69);
}
sl-drawer sl-details::part(content) {
    padding: 10px;
    box-shadow: inset 0px 0px 3px rgb(69 69 69);
    background-color: rgb(255, 251, 243);
}

/* Add these styles for the attribution section in popups */
.attribution-container {
    position: relative;
}

.attribution-content {
    overflow: hidden;
    transition: all 0.2s ease;
}

.attribution-content.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.expand-attribution {
    display: block;
    width: 100%;
    text-align: left;
    padding: 2px 0;
}

.expand-attribution:hover {
    text-decoration: underline;
}

/* Toggle Switch Styles for layer controls */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 36px;
  height: 20px;
  margin-right: 8px;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #aaa;
  transition: .3s;
  border-radius: 34px;
  box-shadow: inset 0 0 3px rgba(0, 0, 0, 0.2);
}

.toggle-slider:before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 2px;
  bottom: 2px;
  background-color: white;
  transition: .3s;
  border-radius: 50%;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

input:checked + .toggle-slider {
  background-color: #F96302;
}

input:checked + .toggle-slider:before {
  transform: translateX(16px);
}

/* Add pulse animation when toggle is activated */
@keyframes togglePulse {
  0% { box-shadow: 0 0 0 0 rgba(249, 99, 2, 0.7); }
  70% { box-shadow: 0 0 0 6px rgba(249, 99, 2, 0); }
  100% { box-shadow: 0 0 0 0 rgba(249, 99, 2, 0); }
}

/* Animate the toggle button with pulse effect */
input:checked + .toggle-slider:before {
  animation: togglePulse 0.5s 1;
}

/* Style for sublayer toggles in Street Map to ensure proper contrast */
.layer-controls .toggle-switch {
  width: 30px;
  height: 16px;
}

.layer-controls .toggle-slider:before {
  height: 12px;
  width: 12px;
}

.layer-controls input:checked + .toggle-slider:before {
  transform: translateX(14px);
}

/* Additional styles for Street Map layer toggles */
.layer-controls .toggle-slider {
  background-color: #f0f0f0;
  border: 1px solid #333;
}

.layer-controls .toggle-slider:before {
  background-color: #fff;
  border: 1px solid #666;
  height: 12px;
  width: 12px;
}

.layer-controls input:checked + .toggle-slider {
  background-color: #F96302;
  border-color: #D85600;
}

.layer-controls input:checked + .toggle-slider:before {
  transform: translateX(14px);
}

/* Enhanced styling for layer groups to improve on/off state visibility */
.layer-group.active,
.layer-group:has(.toggle-switch input:checked) {
  background: linear-gradient(to right, rgba(249, 99, 2, 0.05), #e8e8e8);
  opacity: 1;
  box-shadow: 0 0 0 1px rgba(249, 99, 2, 0.3);
  border-left: 3px solid #F96302;
}

/* Make the active layer title slightly brighter */
.layer-group.active .control-title,
.layer-group:has(.toggle-switch input:checked) .control-title {
  color: #fff;
  text-shadow: 0 0 3px rgba(0, 0, 0, 0.3);
}

/* Add hover effects for clickable layer titles */
.layer-group .control-title {
  transition: color 0.2s;
}

.layer-group:hover .control-title {
  color: #fff;
  text-shadow: 0 0 2px rgba(255, 255, 255, 0.5);
}

/* Make sublayer labels visibly clickable */
.layer-controls label {
  transition: color 0.2s;
  padding: 3px 0;
}

.layer-controls label:hover {
  color: #F96302;
}

/* Layer Settings Modal Styles */
.layer-settings-dialog::part(base) {
    --width: 90vw;
    --max-width: 1200px;
    --height: 80vh;
}

.layer-settings-dialog::part(header) {
    padding: 0;
}

.layer-settings-dialog .settings-header {
    position: relative;
    height: 100px;
    overflow: hidden;
}

.layer-settings-dialog .header-bg {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-size: cover;
    background-position: center;
    transition: opacity 0.3s ease;
}

.layer-settings-dialog .header-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to bottom, rgba(0,0,0,0.4), rgba(0,0,0,0.7));
}

.layer-settings-dialog .header-title {
    position: absolute;
    bottom: 1rem;
    left: 0;
    right: 0;
    font-size: 1.5rem;
    font-weight: 500;
}


.layer-settings-content {
    height: 100%;
    overflow-y: auto;
}

.layer-settings-content .settings-header {
    position: relative;
}

.layer-settings-content .settings-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 50px;
    background: linear-gradient(to bottom, transparent, rgba(0,0,0,0.5));
}

/* Style JSON editors */
.layer-settings-content sl-textarea::part(base) {
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', monospace;
    font-size: 12px;
    line-height: 1.4;
}

.layer-settings-content sl-textarea::part(textarea) {
    padding: 8px;
    background: #f5f5f5;
}

/* Settings button styles */
.settings-button {
    color: #ffffff;
    opacity: 0.8;
    transition: opacity 0.2s ease;
}

.settings-button:hover {
    opacity: 1;
}



.source-details .font-mono {
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', monospace;
}

/* Modal footer styles */
.layer-settings-dialog::part(footer) {
    padding: 1rem;
    border-top: 1px solid #e5e5e5;
    background: #f5f5f5;
}

/* Responsive grid layout */
@media (max-width: 1024px) {
    .settings-body {
        grid-template-columns: 1fr !important;
        gap: 2rem !important;
    }
}

/* Style Legend Styles */
.style-legend {
    font-family: system-ui, -apple-system, sans-serif;
}

.style-legend .style-category {
    background: #f5f5f5;
    border-radius: 4px;
    overflow: hidden;
}

.style-legend .style-properties {
    padding: 0.5rem;
}

.style-legend .style-property {
    background: white;
    padding: 0.5rem;
    border-radius: 4px;
    border: 1px solid #eee;
}

.style-legend .style-property pre {
    margin: 0;
    font-size: 0.75rem;
    color: #666;
    background: #f8f8f8;
    padding: 0.25rem;
    border-radius: 2px;
    max-height: 100px;
    overflow-y: auto;
}

/* Color swatch styles */
.style-legend .style-property [style*="background-color"] {
    border: 1px solid #ddd;
}

/* Line pattern preview styles */
.style-legend .style-property svg line {
    stroke: #333;
}

/* Vector Legend Styles */
.vector-legend {
    font-family: system-ui, -apple-system, sans-serif;
    max-height: 100%;
    display: flex;
    flex-direction: column;
}

.vector-legend .legend-container {
    border: 1px solid #e5e5e5;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
    overflow-y: auto;
    max-height: calc(100vh - 300px); /* Allow scrolling for many items */
    scrollbar-width: thin;
    scrollbar-color: rgba(0,0,0,0.2) transparent;
}

/* Webkit scrollbar styles */
.vector-legend .legend-container::-webkit-scrollbar {
    width: 6px;
}

.vector-legend .legend-container::-webkit-scrollbar-track {
    background: transparent;
}

.vector-legend .legend-container::-webkit-scrollbar-thumb {
    background-color: rgba(0,0,0,0.2);
    border-radius: 3px;
}

.vector-legend .legend-items {
    display: flex;
    flex-direction: column;
}

.vector-legend .legend-item {
    display: flex;
    align-items: center;
    padding: 0.5rem;
    transition: background-color 0.2s;
}

.vector-legend .legend-item:not(:last-child) {
    border-bottom: 1px solid #f0f0f0;
}

.vector-legend .legend-symbol {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
}

.vector-legend .legend-symbol svg {
    filter: drop-shadow(0 1px 1px rgba(0,0,0,0.1));
}

.vector-legend .legend-info {
    display: flex;
    flex-direction: column;
}

.vector-legend .legend-title {
    color: #333;
    line-height: 1.2;
}

.vector-legend .legend-circle {
    box-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

/* Header Navigation Dropdown Styles */
.nav-dropdown-trigger {
    color: white !important;
    --sl-color-neutral-0: transparent;
    --sl-color-neutral-50: rgba(255, 255, 255, 0.1);
    --sl-color-neutral-100: rgba(255, 255, 255, 0.2);
    border: none;
    background: transparent;
}

.nav-dropdown-trigger::part(base) {
    color: white;
    background: transparent;
    border: none;
    font-size: 0.875rem;
    padding: 0.25rem 0.5rem;
}

.nav-dropdown-trigger::part(label) {
    color: white;
}

.nav-dropdown-trigger::part(caret) {
    color: white;
}

.nav-dropdown-trigger:hover::part(base) {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

/* Config gear button styles */
.config-gear-button {
    color: white;
    font-size: 1rem;
}

.config-gear-button::part(base) {
    color: white;
    background: transparent;
    border: none;
}

.config-gear-button:hover::part(base) {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

/* Menu item styling for navigation */
sl-menu-item.nav-active {
    --sl-color-neutral-600: #F96302;
    font-weight: 500;
}

sl-menu-item.nav-active::part(base) {
    color: #F96302;
}

/* Ensure dropdown menus have proper z-index */
sl-dropdown::part(panel) {
    z-index: 1000;
}

/* Style dropdown menu items */
sl-menu-item::part(base) {
    color: #333;
    padding: 0.5rem 1rem;
}

sl-menu-item:hover::part(base) {
    background-color: #f5f5f5;
}

sl-menu-item[href]::part(base) {
    cursor: pointer;
}

/* Responsive adjustments for header dropdowns */
@media (max-width: 768px) {
    .nav-dropdown-trigger::part(base) {
        font-size: 0.75rem;
        padding: 0.25rem;
    }
    
    .nav-dropdown-trigger .w-4.h-4 {
        width: 0.875rem;
        height: 0.875rem;
    }
    
    /* Mobile optimization for dropdown panel */
    sl-dropdown::part(panel) {
        max-width: calc(100vw - 1rem);
        width: auto;
        min-width: 260px;
        left: 0.5rem !important;
    }
    
    /* Share button mobile styles */
    .share-button {
        padding: 0.375rem;
        font-size: 0.75rem;
        gap: 0.375rem;
    }
    
    .share-button svg {
        width: 0.875rem;
        height: 0.875rem;
    }
}

/* Menu label styling for site title */
sl-menu-label {
    padding: 0.75rem 1rem 0.5rem 1rem;
}

sl-menu-label a {
    text-decoration: none;
    font-family: 'Open Sans', sans-serif;
    display: block;
    text-align: center;
}

sl-menu-label a:hover {
    text-decoration: underline;
}

/* Ensure divider has proper spacing */
sl-divider {
    margin: 0.5rem 0;
}

/* Interactive navigation button styling */
.interactive-nav-button::part(base) {
    color: white;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    padding: 0.5rem;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.interactive-nav-button:hover::part(base) {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.4);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.interactive-nav-button:active::part(base) {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Dark theme styling for navigation dropdown menu */
sl-dropdown::part(panel) {
    background: #1f2937; /* Same as bg-gray-800 */
    border: 1px solid #374151; /* Gray-700 */
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    overflow: hidden;
}

sl-menu {
    background: #1f2937;
}

sl-menu-item::part(base) {
    color: #f9fafb; /* Light gray text */
    background: transparent;
    padding: 0.75rem 1rem;
    transition: all 0.2s ease;
}

sl-menu-item:hover::part(base) {
    background-color: #374151; /* Gray-700 on hover */
    color: #ffffff;
}

sl-menu-item.nav-active::part(base) {
    color: #F96302; /* Orange for active item */
    background-color: rgba(249, 99, 2, 0.1);
}

sl-menu-item.nav-active:hover::part(base) {
    background-color: rgba(249, 99, 2, 0.2);
}

/* Dark theme for menu label */
sl-menu-label {
    background: #111827; /* Darker background for header */
    border-bottom: 1px solid #374151;
}

sl-menu-label a {
    color: #F96302; /* Orange color for site title */
}

sl-menu-label a:hover {
    color: #ff7c33; /* Lighter orange on hover */
}

/* Dark theme for dividers */
sl-divider {
    --color: #374151; /* Gray-700 for dividers */
}

/* Menu icon styling in dark theme */
sl-menu-item svg {
    color: #9ca3af; /* Gray-400 for icons */
}

sl-menu-item:hover svg {
    color: #ffffff; /* White icons on hover */
}

sl-menu-item.nav-active svg {
    color: #F96302; /* Orange icons for active items */
}

/* Config submenu styles */
sl-menu sl-menu {
    margin-left: 0;
}

sl-menu sl-menu sl-menu-item::part(base) {
    padding-left: 2rem;
    font-size: 0.875rem;
    color: #6b7280;
}

sl-menu sl-menu sl-menu-item:hover::part(base) {
    background-color: #f3f4f6;
    color: #374151;
}

sl-menu sl-menu sl-menu-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.5rem 1rem 0.25rem 2rem;
}

sl-menu sl-menu sl-divider {
    margin: 0.25rem 1rem;
}

/* Layer type icons in submenu */
sl-menu sl-menu sl-menu-item svg {
    width: 0.875rem;
    height: 0.875rem;
    color: #9ca3af;
}

sl-menu sl-menu sl-menu-item:hover svg {
    color: #6b7280;
}

/* Config layer item background styling */
sl-menu-item.config-layer-item::part(base) {
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

sl-menu-item.config-layer-item.has-background-image::part(base) {
    background-image: var(--layer-bg-image);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    color: white;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
    position: relative;
}

/* Add overlay for better text contrast */
sl-menu-item.config-layer-item.has-background-image::part(base)::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        135deg,
        rgba(0, 0, 0, 0.6) 0%,
        rgba(0, 0, 0, 0.3) 50%,
        rgba(0, 0, 0, 0.7) 100%
    );
    z-index: 1;
}

/* Ensure text and icons are above the overlay */
sl-menu-item.config-layer-item.has-background-image::part(label),
sl-menu-item.config-layer-item.has-background-image svg {
    position: relative;
    z-index: 2;
    color: white;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}

/* Hover effects for background image items */
sl-menu-item.config-layer-item.has-background-image:hover::part(base) {
    transform: scale(1.02);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

sl-menu-item.config-layer-item.has-background-image:hover::part(base)::before {
    background: linear-gradient(
        135deg,
        rgba(0, 0, 0, 0.4) 0%,
        rgba(0, 0, 0, 0.2) 50%,
        rgba(0, 0, 0, 0.5) 100%
    );
}

/* Fallback styling for items without background images */
sl-menu-item.config-layer-item:not(.has-background-image)::part(base) {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 1px solid #dee2e6;
    color: #495057;
}

sl-menu-item.config-layer-item:not(.has-background-image):hover::part(base) {
    background: linear-gradient(135deg, #e9ecef 0%, #dee2e6 100%);
    color: #212529;
}

sl-menu-item.config-layer-item:not(.has-background-image) svg {
    color: #6c757d;
}

sl-menu-item.config-layer-item:not(.has-background-image):hover svg {
    color: #495057;
}

/* Ensure proper spacing and sizing */
sl-menu-item.config-layer-item::part(base) {
    min-height: 48px;
    padding: 0.75rem 1rem;
    margin: 2px 0;
    border-radius: 6px;
}

/* Icon styling for config layer items */
sl-menu-item.config-layer-item svg {
    width: 1rem;
    height: 1rem;
    margin-right: 0.5rem;
    filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.3));
}

/* Share button mobile styles */
.share-button {
    padding: 0.375rem;
    font-size: 0.75rem;
    gap: 0.375rem;
}

.share-button svg {
    width: 0.875rem;
    height: 0.875rem;
}

/* Hide share button text on mobile, keep only icon */
.share-button {
    font-size: 0;
    gap: 0;
    padding: 0.5rem;
}

.share-button svg {
    width: 1.25rem;
    height: 1.25rem;
}

/* More aggressive first level menu item compacting */
sl-menu-item::part(base) {
    padding: 0.375rem 0.5rem !important;
    font-size: 0.8rem !important;
    min-height: 36px !important;
}

/* Reduce first level icon sizes */
sl-menu-item svg {
    width: 0.875rem !important;
    height: 0.875rem !important;
}

/* Reduce padding and font size for submenu items on mobile */
sl-menu sl-menu sl-menu-item::part(base) {
    padding-left: 0.75rem !important;
    padding-right: 0.375rem !important;
    padding-top: 0.375rem !important;
    padding-bottom: 0.375rem !important;
    font-size: 0.75rem !important;
    min-height: 32px !important;
}

/* Hide icons in submenu items and remove icon spacing */
sl-menu sl-menu sl-menu-item svg {
    display: none !important;
}

/* Remove icon spacing from submenu items */
sl-menu sl-menu sl-menu-item::part(base) {
    padding-left: 0.5rem !important;
}

/* Reduce menu label padding on mobile */
sl-menu-label {
    padding: 0.375rem 0.5rem 0.25rem 0.5rem !important;
    font-size: 0.875rem !important;
}

/* Optimize config layer items for mobile */
sl-menu-item.config-layer-item::part(base) {
    min-height: 36px !important;
    padding: 0.375rem 0.5rem !important;
    font-size: 0.75rem !important;
}

/* Reduce icon sizes in submenu on mobile */
sl-menu sl-menu sl-menu-item svg {
    width: 0.75rem !important;
    height: 0.75rem !important;
}

/* Make dividers more compact */
sl-divider {
    margin: 0.25rem 0 !important;
}

/* Reduce gap between menu items */
sl-menu {
    --sl-spacing-x-small: 0.125rem;
}

sl-menu {
    border: none;
}

/* Bus tracking and live departure board styles */
.departure-row {
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

.departure-row:hover {
    background-color: rgba(34, 197, 94, 0.1);
    border-color: rgba(34, 197, 94, 0.3);
}

.departure-row-selected {
    background-color: rgba(34, 197, 94, 0.2) !important;
    border-color: rgba(34, 197, 94, 0.6) !important;
}

.departure-row-hover {
    background-color: rgba(34, 197, 94, 0.1);
    border-color: rgba(34, 197, 94, 0.3);
}

/* Status indicators */
.status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.status-live {
    background-color: #22c55e;
    box-shadow: 0 0 8px rgba(34, 197, 94, 0.6);
    animation: pulse 2s infinite;
}

.status-scheduled {
    background-color: #f59e0b;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

/* Route badges */
.route-badge {
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
}

.route-badge-text {
    font-weight: bold;
}

/* Selection indicator */
.selection-indicator {
    margin-bottom: 0.5rem;
}

/* Bus tracking notification */
#bus-tracking-notification {
    z-index: 1000;
    animation: slideInRight 0.3s ease-out;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Bus location markers on map */
.user-location-marker {
    cursor: pointer;
}

@keyframes pulse {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.1);
        opacity: 0.7;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Mapbox popup styles for bus info */
.mapboxgl-popup-content {
    padding: 1px;
    background: rgba(17, 24, 39, 0.95);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(34, 197, 94, 0.3);
    color: white;
    min-width: 200px;
}

.mapboxgl-popup-tip {
    border-top-color: rgba(17, 24, 39, 0.95) !important;
}

/* Enhanced departure board styling */
.departure-board {
    background: rgba(17, 24, 39, 0.95);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(34, 197, 94, 0.3);
}

/* Live tracking badge */
.tracking-badge {
    background: linear-gradient(45deg, #22c55e, #16a34a);
    color: white;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Default map cursor - hand for dragging */
.mapboxgl-canvas {
    cursor: grab;
}

.mapboxgl-canvas:active {
    cursor: grabbing;
}

/* Nearby stops panel */
.nearby-stop-item {
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.nearby-stop-item:hover {
    border-color: rgba(34, 197, 94, 0.4);
    transform: translateY(-1px);
}

/* Mobile responsive adjustments */
@media (max-width: 768px) {
    #bus-tracking-notification {
        top: 1rem;
        right: 1rem;
        left: 1rem;
        max-width: none;
    }
    
    .departure-row {
        padding: 0.75rem;
    }
    
    .route-badge {
        font-size: 0.7rem;
        padding: 0.25rem 0.5rem;
    }
}

/* Bus popup enhanced styling */
.bus-popup-content {
    background: linear-gradient(135deg, rgba(17, 24, 39, 0.98), rgba(31, 41, 55, 0.98));
    border: 1px solid rgba(34, 197, 94, 0.4);
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(15px);
}

/* Location banner enhanced styling */
#location-banner {
    background: linear-gradient(135deg, rgba(17, 24, 39, 0.95), rgba(31, 41, 55, 0.95));
    border: 1px solid rgba(34, 197, 94, 0.3);
    backdrop-filter: blur(10px);
}

/* Enhanced stop info styling */
#stop-info {
    background: rgba(17, 24, 39, 0.95);
    backdrop-filter: blur(10px);
}

/* Loading states for live data */
.loading-departures {
    position: relative;
}

.loading-departures::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(34, 197, 94, 0.1), transparent);
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

/* Stop selector dropdown styles */
#stop-selector-btn {
    position: relative;
    z-index: 10;
}

#stop-dropdown {
    z-index: 60;
    backdrop-filter: blur(10px);
    background: rgba(31, 41, 55, 0.95);
    border: 1px solid rgba(34, 197, 94, 0.3);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.3), 0 10px 10px -5px rgba(0, 0, 0, 0.1);
}

.stop-option {
    padding: 12px 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    border-bottom: 1px solid rgba(55, 65, 81, 0.5);
}

.stop-option:hover {
    background-color: rgba(34, 197, 94, 0.1);
    border-left: 3px solid #22c55e;
    transform: translateX(2px);
}

.stop-option:last-child {
    border-bottom: none;
}

.stop-option-selected {
    background-color: rgba(34, 197, 94, 0.2);
    border-left: 3px solid #22c55e;
}

.stop-option-name {
    font-weight: 600;
    color: white;
    margin-bottom: 2px;
}

.stop-option-details {
    font-size: 0.75rem;
    color: #9ca3af;
    display: flex;
    align-items: center;
    gap: 8px;
}

.stop-option-distance {
    color: #22c55e;
    font-weight: 500;
}

.stop-option-routes {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 4px;
}

/* Interactive route badges */
.interactive-route-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid transparent;
    position: relative;
    overflow: hidden;
}

.interactive-route-badge:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
}

.interactive-route-badge:active {
    transform: translateY(0);
}

.interactive-route-badge.selected {
    border-color: #fbbf24;
    box-shadow: 0 0 12px rgba(251, 191, 36, 0.5);
    animation: route-glow 2s infinite;
}

@keyframes route-glow {
    0%, 100% {
        box-shadow: 0 0 12px rgba(251, 191, 36, 0.5);
    }
    50% {
        box-shadow: 0 0 20px rgba(251, 191, 36, 0.8);
    }
}

/* BEST agency route styling */
.route-best-ac {
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    color: white;
}

.route-best-regular {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
}

.route-best-default {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
}

/* Other agency routes */
.route-other-live {
    background: linear-gradient(135deg, #22c55e, #16a34a);
    color: white;
}

.route-other-scheduled {
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    color: white;
}

/* Route badge size variants */
.route-badge-small {
    padding: 2px 6px;
    font-size: 0.7rem;
}

.route-badge-normal {
    padding: 4px 8px;
    font-size: 0.75rem;
}

/* Search input focus states */
#stop-search-input:focus {
    background-color: rgba(55, 65, 81, 0.8);
    border-color: #22c55e;
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.1);
}

/* Loading states */
.stop-option-loading {
    opacity: 0.6;
    pointer-events: none;
}

.stop-option-loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(34, 197, 94, 0.1), transparent);
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    #bus-tracking-notification {
        top: 1rem;
        right: 1rem;
        left: 1rem;
        max-width: none;
    }
    
    .departure-row {
        padding: 0.75rem;
    }
    
    .route-badge {
        font-size: 0.7rem;
        padding: 0.25rem 0.5rem;
    }
    
    #stop-dropdown {
        max-height: 50vh;
    }
    
    .stop-option {
        padding: 10px 12px;
    }
    
    .interactive-route-badge {
        font-size: 0.7rem;
        padding: 3px 6px;
    }
}

/* Enhanced Map Feature Control with nested Shoelace Details styling */
/* Map Feature Control - Minimal Clean Design */
.map-feature-control {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: rgba(255, 255, 255, 0.95) !important;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(0, 0, 0, 0.1) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
}

/* Main Map Layers details component */
.map-feature-control .map-layers-main::part(base) {
    background: transparent;
    border: none;
    border-radius: 0;
    overflow: visible;
}

.map-feature-control .map-layers-main::part(header) {
    padding: 6px;
    background: transparent;
    border: none;
}

.map-feature-control .map-layers-main::part(content) {
    padding: 0;
    background: #f3f3f3;
}

.map-feature-control .map-layers-main::part(summary-icon) {
    color: #666;
    font-size: 12px;
}

/* Individual layer details styling */
.map-feature-control .layer-details::part(base) {
    background: transparent;
    border: none;
    border-radius: 0;
    margin-bottom: 0;
    overflow: visible;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.map-feature-control .layer-details:last-child::part(base) {
    border-bottom: none;
}

.map-feature-control .layer-details::part(header) {
    padding: 0;
    background: rgba(0, 0, 0, 0.02);
    border: none;
    border-top: 1px solid #fafafa;
    /* Header background image styling - applied dynamically via JavaScript */
}

.map-feature-control .layer-details::part(content) {
    padding: 0px 6px;
    background: transparent;
}

.map-feature-control .layer-details::part(summary-icon) {
    color: #666;
    font-size: 12px;
}

/* Nested details components (Source, Legend, Features) */
.map-feature-control .source-details::part(base),
.map-feature-control .legend-details::part(base),
.map-feature-control .features-details::part(base) {
    background: transparent;
    border: none;
    border-radius: 0;
    margin-bottom: 0;
}

.map-feature-control .source-details::part(header),
.map-feature-control .legend-details::part(header),
.map-feature-control .features-details::part(header) {
    padding: 0;
    background: transparent;
    border: none;
}

.map-feature-control .source-details::part(content),
.map-feature-control .legend-details::part(content),
.map-feature-control .features-details::part(content) {
    padding: 0;
    background: transparent;
}

.map-feature-control .source-details::part(summary-icon),
.map-feature-control .legend-details::part(summary-icon),
.map-feature-control .features-details::part(summary-icon) {
    color: #888;
    font-size: 10px;
}

/* Layer action controls styling - Compact */
.map-feature-control .layer-actions sl-dropdown sl-button::part(base) {
    font-size: 10px;
    border-radius: 3px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    background: transparent;
    color: hsl(210, 2%, 47%);
    transition: all 0.15s ease;
}

.map-feature-control .layer-actions sl-dropdown sl-button:hover::part(base) {
    border-color: #dee2e6;
}

.map-feature-control .layer-actions sl-button[variant="text"]::part(base) {
    color: #ef4444;
    transition: all 0.15s ease;
    min-width: auto;
    background: transparent;
    border: none;
}

.map-feature-control .layer-actions sl-button[variant="text"]:hover::part(base) {
    background: rgba(239, 68, 68, 0.1);
    color: #dc2626;
}

/* Dropdown menu styling for opacity options */
.map-feature-control .layer-actions sl-dropdown sl-menu-item::part(base) {
    font-size: 10px;
    padding: 4px 8px;
}

.map-feature-control .layer-actions sl-dropdown sl-menu-item:hover::part(base) {
    background: rgba(0, 0, 0, 0.05);
}

/* Drawer toggle switch styling - Minimal */
.map-feature-control .map-layers-summary sl-switch::part(control) {
    --thumb-size: 12px;
    --width: 24px;
    --height: 14px;
    border: 1px solid rgba(0, 0, 0, 0.2);
    background: rgba(0, 0, 0, 0.05);
}

.map-feature-control .map-layers-summary sl-switch::part(thumb) {
    background: white;
    border: 1px solid rgba(0, 0, 0, 0.1);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.map-feature-control .map-layers-summary sl-switch[checked]::part(control) {
    background: #3b82f6;
    border-color: #3b82f6;
}

.map-feature-control .map-layers-summary sl-switch[checked]::part(thumb) {
    background: white;
    border-color: white;
}

/* Feature content styling within details - Minimal */
.map-feature-control .feature-control-feature {
    border-radius: 0;
    transition: none;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.map-feature-control .feature-control-feature:hover {
    background: rgba(0, 0, 0, 0.02) !important;
    transform: none;
    box-shadow: none;
}

.map-feature-control .feature-inspector-properties-table tr:hover {
    background-color: rgba(0, 0, 0, 0.02) !important;
}

/* Scrollbar styling for nested content - Minimal */
.map-feature-control .features-content::-webkit-scrollbar,
.map-feature-control .feature-inspector-table-content::-webkit-scrollbar {
    width: 3px;
}

.map-feature-control .features-content::-webkit-scrollbar-track,
.map-feature-control .feature-inspector-table-content::-webkit-scrollbar-track {
    background: transparent;
}

.map-feature-control .features-content::-webkit-scrollbar-thumb,
.map-feature-control .feature-inspector-table-content::-webkit-scrollbar-thumb {
    background-color: rgba(0, 0, 0, 0.2);
    border-radius: 2px;
}

/* Legend image styling - Minimal */
.map-feature-control .legend-details img {
    transition: none;
    border-radius: 3px;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.map-feature-control .legend-details img:hover {
    transform: none;
    box-shadow: none;
}

/* Mobile responsive adjustments - Minimal */
@media (max-width: 768px) {
    .map-feature-control {
        max-width: calc(100vw - 16px);
        min-width: 200px;
    }
    
    .map-feature-control .layer-actions {
        flex-direction: row;
        gap: 6px;
    }
    
    .map-feature-control .layer-actions sl-dropdown {
        flex: 1;
    }
    
    .map-feature-control .layer-actions sl-dropdown sl-button::part(base) {
        font-size: 9px;
        padding: 3px 6px;
    }
    
    /* Compact feature table on mobile */
    .map-feature-control .feature-inspector-properties-table {
        font-size: 8px !important;
    }
    
    .map-feature-control .feature-inspector-properties-table td {
        padding: 2px 3px !important;
        font-size: 7px !important;
    }
    
    /* Mobile responsive for main actions */
    .map-feature-control .map-layers-actions {
        flex-wrap: wrap;
        gap: 4px;
    }
    
    .map-feature-control .map-layers-actions label {
        font-size: 10px !important;
    }
    
    .map-feature-control .map-layers-actions sl-button {
        font-size: 9px !important;
    }
}

/* Animation for expanding/collapsing details */
.map-feature-control sl-details::part(content) {
    transition: all 0.15s ease;
}

/* Details group spacing - accordion style */
.map-feature-control [class*="details-group-"] sl-details:not(:last-child) {
    margin-bottom: 1px;
}

/* Actions sections styling */
.map-feature-control .map-layers-actions {
    background: rgba(0, 0, 0, 0.02);
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

/* Switch styling in actions sections */
.map-feature-control .map-layers-actions sl-switch::part(control),
.map-feature-control .layer-actions-section sl-switch::part(control) {
    background: rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(0, 0, 0, 0.15);
}

.map-feature-control .map-layers-actions sl-switch::part(thumb),
.map-feature-control .layer-actions-section sl-switch::part(thumb) {
    background: white;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.map-feature-control .map-layers-actions sl-switch[checked]::part(control),
.map-feature-control .layer-actions-section sl-switch[checked]::part(control) {
    background: #3b82f6;
    border-color: #3b82f6;
}

.map-feature-control .map-layers-actions sl-switch[checked]::part(thumb),
.map-feature-control .layer-actions-section sl-switch[checked]::part(thumb) {
    background: white;
    border-color: white;
}

/* Focus styles for accessibility */
.map-feature-control sl-details::part(header):focus-visible {
    outline: 2px solid #fbbf24;
    outline-offset: 2px;
}

.map-feature-control sl-switch:focus-visible::part(control) {
    outline: 2px solid #fbbf24;
    outline-offset: 2px;
}

.map-feature-control sl-button:focus-visible::part(base) {
    outline: 2px solid #fbbf24;
    outline-offset: 2px;
}

/* Feature action buttons styling */
.map-feature-control .feature-actions {
    min-width: 200px;
}

.map-feature-control .feature-action-button {
    flex-shrink: 0;
    min-width: fit-content;
}

.map-feature-control .feature-action-button span {
    flex-shrink: 0;
}

/* Additional information section styling - improve contrast on dark backgrounds */
.map-feature-control .feature-inspector-additional-info {
    color: #d1d5db !important;
}

.map-feature-control .feature-inspector-additional-info .font-semibold {
    color: #f3f4f6 !important;
}

.map-feature-control .feature-inspector-additional-info .text-gray-500,
.map-feature-control .feature-inspector-additional-info .text-gray-600,
.map-feature-control .feature-inspector-additional-info .text-gray-800 {
    color: #9ca3af !important;
}

.map-feature-control .feature-inspector-additional-info a {
    color: #60a5fa !important;
}

.map-feature-control .feature-inspector-additional-info a:hover {
    color: #93c5fd !important;
}

  /* Language Radio Button Group Styling - Dark Theme */
.language-radio-group sl-radio-button {
    cursor: pointer;
    transition: all 0.2s ease;
}

.language-radio-group sl-radio-button::part(button) {
    transition: all 0.2s ease;
    border: 1px solid #4b5563;
    border-color: hsl(0, 0%, 51%);
    color: #f9fafb;
}

.language-radio-group sl-radio-button:hover::part(button) {
    border-color: #60a5fa;
    background-color: hsl(240, 1%, 30%);
    border-color: hsl(0, 0%, 51%);
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.language-radio-group sl-radio-button::part(button--checked) {
    background-color: hwb(216 39% 53%);
    border-color: hsl(0, 0%, 51%);
    color: #ffffff;
}

.language-radio-group sl-radio-button:hover::part(button--checked) {
    background-color: hwb(217 27% 62%);
    border-color: hwb(0 74% 26%);
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(96, 165, 250, 0.4);
}

/* Document Viewer Dialog Styles */
/* General sl-dialog styling for document viewer appearance */
sl-dialog::part(base) {
    /* Subtle drop shadow for depth */
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

sl-dialog::part(panel) {
    /* Document viewer appearance with rounded corners */
    border-radius: 12px;
    overflow: hidden;
    background-color: #374151;
}

sl-dialog::part(body) {
    /* Dark grey body for document viewer look */
    background-color: #374151;
    color: #f9fafb;
    padding: 1.5rem;
    font-family: system-ui, -apple-system, sans-serif;
    line-height: 1.6;
}

sl-dialog::part(header) {
    /* Clean header styling */
    background-color: #374151;
    border-bottom: 1px solid #e5e7eb;
    padding: 1rem 1.5rem;
}

sl-dialog::part(footer) {
    /* Clean footer styling */
    background-color: #374151;
    border-top: 1px solid #e5e7eb;
    padding: 1rem 1.5rem;
}

sl-dialog::part(title) {
    /* Title styling */
    color: hsl(0, 0%, 99%);
    font-weight: 600;
    font-size: 1.125rem;
}

/* Overlay styling for better contrast */
sl-dialog::part(overlay) {
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

/* Specific styling for intro modal to maintain its no-header appearance */
.intro-modal::part(body) {
    background-color: #374151;
    color: #f9fafb;
    padding: 2rem;
}

/* Intro modal title styling */
.intro-title {
    color: #ffffff !important;
}

.intro-title div {
    color: #ffffff !important;
    line-height: 1.2;
}

/* Dark theme for sl-details within dialogs */
sl-dialog sl-details::part(base) {
    border: 1px solid #4b5563;
    border-radius: 8px;
    background-color: #1f2937;
    margin-bottom: 0.5rem;
}

sl-dialog sl-details::part(header) {
    background-color: #374151;
    color: #f9fafb;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #4b5563;
    font-weight: 500;
}

sl-dialog sl-details::part(content) {
    background-color: #1f2937;
    color: #f9fafb;
    padding: 1rem;
    line-height: 1.6;
}

sl-dialog sl-details::part(summary-icon) {
    color: #9ca3af;
}

/* Hover effects for details */
sl-dialog sl-details:hover::part(header) {
    background-color: #4b5563;
}

/* Open state styling */
sl-dialog sl-details[open]::part(header) {
    background-color: #4b5563;
}

/* Ensure text content in dialogs is readable with high contrast */
sl-dialog p, sl-dialog div, sl-dialog span {
    color: #f9fafb;
}

/* Make headings more white for better contrast */
sl-dialog h1, sl-dialog h2, sl-dialog h3, sl-dialog h4, sl-dialog h5, sl-dialog h6 {
    color: #ffffff !important;
    font-weight: 600;
}

/* Ensure strong/bold text is also highly visible */
sl-dialog strong, sl-dialog b {
    color: #ffffff;
    font-weight: 700;
}

/* Make list items more white */
sl-dialog li {
    color: #f9fafb;
}

/* Style any links in dialog content */
sl-dialog a {
    color: #60a5fa;
    text-decoration: underline;
}

sl-dialog a:hover {
    color: #93c5fd;
}

/* Ensure code blocks and inline code are visible */
sl-dialog code {
    background-color: #1f2937;
    color: #e5e7eb;
    padding: 0.125rem 0.25rem;
    border-radius: 0.25rem;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', monospace;
}

sl-dialog pre {
    background-color: #1f2937;
    color: #e5e7eb;
    padding: 1rem;
    border-radius: 0.5rem;
    overflow-x: auto;
}

/* Make blockquotes more visible */
sl-dialog blockquote {
    color: #d1d5db;
    border-left: 4px solid #4b5563;
    padding-left: 1rem;
    font-style: italic;
}

/* End of styles */

/* 3D Terrain Control Styles */
.terrain-3d-panel {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.terrain-3d-panel h3 {
    margin: 0 0 15px 0;
    font-size: 16px;
    font-weight: bold;
    color: #333;
}

.terrain-3d-panel label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #333;
}

.terrain-3d-panel input[type="checkbox"] {
    margin-right: 8px;
    cursor: pointer;
}

.terrain-3d-panel input[type="range"] {
    width: 100%;
    margin-bottom: 5px;
    cursor: pointer;
}

.terrain-3d-panel span {
    font-size: 12px;
    color: #666;
    font-weight: bold;
}

.terrain-3d-panel button {
    position: absolute;
    top: 5px;
    right: 10px;
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: #999;
    padding: 0;
    width: 20px;
    height: 20px;
    line-height: 1;
}

.terrain-3d-panel button:hover {
    color: #666;
    background: none;
    transform: none;
    box-shadow: none;
}

/* Mapbox control button styling for 3D control */
.mapboxgl-ctrl-group .mapboxgl-ctrl-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    font-size: 12px;
    font-weight: bold;
    color: #666;
    background: #ffffff;
    border: 1px solid #ccc;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.mapboxgl-ctrl-group .mapboxgl-ctrl-icon:hover {
    background-color: #f0f0f0;
}

.mapboxgl-ctrl-group .mapboxgl-ctrl-icon span {
    display: block;
    line-height: 1;
}