/* Custom base styles and utilities that complement Tailwind */

/* Apply a clean, modern font stack */
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    transition: background-color 0.5s ease, color 0.5s ease;
}

/* Glass Panel Base Style */
.glass-panel {
    @apply bg-glass-light dark:bg-glass-dark backdrop-blur-xl rounded-2xl border border-stroke-light dark:border-stroke-dark shadow-soft transition-colors duration-300;
}

/* AI Button with Animated Gradient Border */
.ai-btn {
    position: relative;
    overflow: hidden;
    background: linear-gradient(45deg, #29a383, #a18072, #687066, #29a383);
    background-size: 400% 400%;
    animation: gradientShift 3s ease infinite;
    border: 2px solid transparent;
}

.ai-btn::before {
    content: '';
    position: absolute;
    inset: 2px;
    background: rgba(244, 245, 242, 0.8);
    border-radius: 10px;
    z-index: -1;
    transition: all 0.3s ease;
}

.dark .ai-btn::before {
    background: rgba(47, 49, 46, 0.8);
}

.ai-btn:hover::before {
    background: rgba(41, 163, 131, 0.1);
}

.ai-btn i {
    position: relative;
    z-index: 1;
    color: #29a383;
    filter: drop-shadow(0 0 8px rgba(41, 163, 131, 0.5));
    animation: sparkle 2s ease-in-out infinite;
}

#theme-toggle-btn i {
    transition: opacity 0.3s ease, transform 0.3s ease;
}

#theme-toggle-btn .dark\:hidden {
    opacity: 1;
    transform: scale(1) rotate(0deg);
}
.dark #theme-toggle-btn .dark\:hidden {
    opacity: 0;
    transform: scale(0.5) rotate(-90deg);
}
#theme-toggle-btn .dark\:block {
    opacity: 0;
    transform: scale(0.5) rotate(90deg);
}
.dark #theme-toggle-btn .dark\:block {
    opacity: 1;
    transform: scale(1) rotate(0deg);
}

@keyframes gradientShift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

@keyframes sparkle {
    0%, 100% { transform: scale(1) rotate(0deg); filter: drop-shadow(0 0 8px rgba(41, 163, 131, 0.5)); }
    50% { transform: scale(1.1) rotate(180deg); filter: drop-shadow(0 0 12px rgba(41, 163, 131, 0.8)); }
}

/* Professional Timeline Slider */
.timeline-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.timeline-container-new {
    position: relative;
    width: 400px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.timeline-track-new {
    position: absolute;
    width: 100%;
    height: 2px;
    background: rgba(161, 128, 114, 0.2);
    border-radius: 1px;
    z-index: 1;
}

.dark .timeline-track-new {
    background: rgba(104, 112, 102, 0.2);
}

.timeline-ticks {
    position: absolute;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 2;
    pointer-events: none;
}

.timeline-tick {
    width: 2px;
    height: 12px;
    background: rgba(161, 128, 114, 0.4);
    border-radius: 1px;
    transition: all 0.2s ease;
}

.dark .timeline-tick {
    background: rgba(104, 112, 102, 0.4);
}

.timeline-tick.past {
    background: #29a383;
    height: 16px;
    box-shadow: 0 0 4px rgba(41, 163, 131, 0.3);
}

.timeline-tick.current {
    background: #a18072;
    height: 20px;
    width: 3px;
    box-shadow: 0 0 8px rgba(161, 128, 114, 0.5);
}

.timeline-tick.future {
    background: rgba(104, 112, 102, 0.3);
    height: 10px;
}

.dark .timeline-tick.future {
    background: rgba(161, 128, 114, 0.3);
}

.timeline-progress-new {
    position: absolute;
    height: 3px;
    background: linear-gradient(90deg, #29a383 0%, #a18072 100%);
    border-radius: 1.5px;
    z-index: 3;
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 0 6px rgba(41, 163, 131, 0.4);
    left: 0;
}

.timeline-slider-new {
    position: absolute;
    width: 100%;
    height: 100%;
    -webkit-appearance: none;
    appearance: none;
    background: transparent;
    cursor: pointer;
    z-index: 5;
    margin: 0;
    padding: 0;
}

.timeline-slider-new::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: linear-gradient(135deg, #29a383 0%, #ffffff 30%, #a18072 70%, #29a383 100%);
    cursor: pointer;
    box-shadow: 
        0 0 0 3px rgba(41, 163, 131, 0.2),
        0 4px 12px rgba(0, 0, 0, 0.15),
        inset 0 1px 2px rgba(255, 255, 255, 0.3);
    border: 2px solid #ffffff;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.timeline-slider-new::-webkit-slider-thumb:hover {
    transform: scale(1.15);
    box-shadow: 
        0 0 0 4px rgba(41, 163, 131, 0.3),
        0 6px 20px rgba(0, 0, 0, 0.2),
        inset 0 1px 2px rgba(255, 255, 255, 0.4);
}

.timeline-slider-new::-webkit-slider-thumb:active {
    transform: scale(1.05);
    box-shadow: 
        0 0 0 2px rgba(41, 163, 131, 0.4),
        0 2px 8px rgba(0, 0, 0, 0.2),
        inset 0 1px 2px rgba(255, 255, 255, 0.3);
}

.timeline-slider-new::-moz-range-thumb {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: linear-gradient(135deg, #29a383 0%, #ffffff 30%, #a18072 70%, #29a383 100%);
    cursor: pointer;
    border: 2px solid #ffffff;
    box-shadow: 
        0 0 0 3px rgba(41, 163, 131, 0.2),
        0 4px 12px rgba(0, 0, 0, 0.15);
}

.timeline-slider-new::-moz-range-track {
    background: transparent;
    border: none;
    height: 40px;
}

.timeline-labels {
    display: flex;
    justify-content: space-between;
    width: 400px;
    font-size: 10px;
    color: rgba(161, 128, 114, 0.6);
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Roboto Mono', monospace;
    font-weight: 500;
}

.dark .timeline-labels {
    color: rgba(104, 112, 102, 0.6);
}

.timeline-label {
    text-align: center;
    min-width: 30px;
    transition: color 0.2s ease;
}

.timeline-label.active {
    color: #29a383;
    font-weight: 600;
}

.timeline-label.past {
    color: rgba(41, 163, 131, 0.7);
}

.timeline-label.future {
    color: rgba(161, 128, 114, 0.4);
}

.dark .timeline-label.future {
    color: rgba(104, 112, 102, 0.4);
}

/* Modern Opacity Slider */
.opacity-slider-container {
    position: relative;
    width: 80px;
    height: 6px;
    display: flex;
    align-items: center;
}

.opacity-slider-modern {
    position: absolute;
    width: 100%;
    height: 6px;
    -webkit-appearance: none;
    appearance: none;
    background: transparent;
    cursor: pointer;
    z-index: 3;
}

.opacity-track {
    position: absolute;
    width: 100%;
    height: 3px;
    background: rgba(161, 128, 114, 0.3);
    border-radius: 1.5px;
    z-index: 1;
}

.dark .opacity-track {
    background: rgba(104, 112, 102, 0.3);
}

.opacity-progress {
    position: absolute;
    height: 3px;
    background: linear-gradient(90deg, #29a383 0%, #a18072 100%);
    border-radius: 1.5px;
    z-index: 2;
    transition: width 0.2s ease;
}

.opacity-slider-modern::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #29a383;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(41, 163, 131, 0.3);
    transition: all 0.2s ease;
    border: 2px solid #ffffff;
}

.opacity-slider-modern::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 3px 8px rgba(41, 163, 131, 0.5);
}

.opacity-slider-modern::-moz-range-thumb {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background-color: #4a5568; /* Tailwind gray-700 */
    cursor: pointer;
    border: 2px solid #ffffff;
    box-shadow: 0 2px 6px rgba(41, 163, 131, 0.3);
}

/* DEPRECATED - Combined into .control-btn */
/*
.play-pause-btn {
    @apply p-2 rounded-lg transition-colors;
    background-color: rgba(0,0,0,0.1);
    border: none;
    color: white;
}

.play-pause-btn:hover {
    background-color: rgba(0,0,0,0.2);
}
*/

/* Modal Styles */
.modal-overlay {
    @apply fixed inset-0 bg-black bg-opacity-50 flex items-start justify-start pt-16 pl-4 sm:pl-16 z-50 transition-opacity duration-300;
}

.modal-overlay.show {
    opacity: 1;
}

.modal-content {
    background: rgba(244, 245, 242, 0.95);
    backdrop-filter: blur(24px);
    border: 1px solid rgba(161, 128, 114, 0.2);
    border-radius: 16px;
    padding: 24px;
    max-width: 500px;
    width: 90vw;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    transform: translateY(20px) scale(0.95);
    transition: all 0.3s ease;
}

.dark .modal-content {
    background: rgba(26, 28, 25, 0.95);
    border: 1px solid rgba(104, 112, 102, 0.3);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.modal-overlay.show .modal-content {
    transform: translateY(0) scale(1);
}

/* UI Button Base Style */
.ui-button {
    @apply w-10 h-10 rounded-full flex items-center justify-center text-text-secondary-light dark:text-text-secondary-dark hover:bg-black/10 dark:hover:bg-white/10 transition-all duration-200;
}
.ui-button.active {
    @apply bg-primary text-white;
}

/* Context Panel Base Styles */
.context-panel {
    @apply glass-panel absolute top-1/2 -translate-y-1/2 w-80 max-w-[90vw] p-4 pointer-events-auto transition-transform duration-300 ease-in-out z-20;
}
.left-panel {
    @apply left-4 sm:left-20 translate-x-[-100%];
}
.right-panel {
    @apply right-4 sm:right-20 translate-x-[100%];
}
.left-panel.open, .right-panel.open {
    @apply translate-x-0;
}

/* Panel Content Styles */
.panel-header {
    @apply text-lg font-bold text-text-primary-light dark:text-text-primary-dark pb-2 mb-4 border-b border-stroke-light dark:border-stroke-dark;
}
.panel-section {
    @apply mb-4;
}
.panel-subheader {
    @apply text-sm font-semibold text-text-secondary-light dark:text-text-secondary-dark mb-2 border-b border-stroke-light dark:border-stroke-dark pb-1;
}

/* Custom Toggle Switch */
.toggle-switch {
    @apply appearance-none w-12 h-6 bg-gray-300 dark:bg-gray-700 rounded-full relative cursor-pointer transition-colors duration-300;
}
.toggle-switch::before {
    content: '';
    @apply absolute w-5 h-5 bg-white rounded-full top-0.5 left-0.5 transition-transform duration-300;
}
.toggle-switch:checked {
    @apply bg-primary;
}
.toggle-switch:checked::before {
    @apply translate-x-6;
}

/* MapLibre Attribution Control Styling */
.maplibregl-ctrl-attrib {
    @apply glass-panel px-2 py-1 text-xs;
}
.maplibregl-ctrl-attrib a {
    @apply text-text-secondary-light dark:text-text-secondary-dark;
}

/* MapLibre Popup Styling */
.maplibregl-popup-content {
    @apply glass-panel text-text-primary-light dark:text-text-primary-dark p-3 rounded-lg shadow-none;
}
.maplibregl-popup-anchor-bottom .maplibregl-popup-tip {
    @apply border-t-transparent;
}
.maplibregl-popup-close-button {
    @apply text-text-primary-light dark:text-text-primary-dark;
}

/* Modern Weather App Styles */

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    overflow: hidden;
}

/* Glass Panel Effect */
.glass-panel {
    background: rgba(244, 245, 242, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(161, 128, 114, 0.2);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.dark .glass-panel {
    background: rgba(47, 49, 46, 0.8);
    border: 1px solid rgba(104, 112, 102, 0.3);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

/* Control Buttons */
.control-btn {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    border: none;
    background: rgba(244, 245, 242, 0.6);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(161, 128, 114, 0.2);
    color: #2f312e;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.dark .control-btn {
    background: rgba(47, 49, 46, 0.6);
    border: 1px solid rgba(104, 112, 102, 0.3);
    color: #e0e3de;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.control-btn:hover {
    background: rgba(41, 163, 131, 0.1);
    border-color: #29a383;
    color: #29a383;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.control-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Off-canvas Panels */
.offcanvas-panel {
    position: fixed;
    top: 0;
    bottom: 0;
    width: 320px;
    background: rgba(244, 245, 242, 0.95);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid rgba(161, 128, 114, 0.2);
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.1);
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
    overflow-y: auto;
}

.dark .offcanvas-panel {
    background: rgba(26, 28, 25, 0.95);
    border: 1px solid rgba(104, 112, 102, 0.3);
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.3);
}

.offcanvas-panel.left-panel {
    left: 0;
    border-right: 1px solid rgba(161, 128, 114, 0.2);
}

.dark .offcanvas-panel.left-panel {
    border-right: 1px solid rgba(104, 112, 102, 0.3);
}

.offcanvas-panel.right-panel {
    right: 0;
    transform: translateX(100%);
    border-left: 1px solid rgba(161, 128, 114, 0.2);
}

.dark .offcanvas-panel.right-panel {
    border-left: 1px solid rgba(104, 112, 102, 0.3);
}

.offcanvas-panel.open {
    transform: translateX(0);
}

/* Basemap Selector */
#basemap-selector > div {
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid transparent;
    transition: all 0.2s ease;
    cursor: pointer;
}

#basemap-selector > div:hover {
    border-color: rgba(41, 163, 131, 0.5);
    transform: scale(1.02);
}

#basemap-selector > div.border-primary {
    border-color: #29a383;
    box-shadow: 0 0 0 2px rgba(41, 163, 131, 0.2);
}

#basemap-selector img {
    width: 100%;
    height: 60px;
    object-fit: cover;
    border-radius: 6px;
}

/* Toggle Switches */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 24px;
}

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

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(161, 128, 114, 0.3);
    transition: 0.3s;
    border-radius: 24px;
}

.dark .slider {
    background-color: rgba(104, 112, 102, 0.3);
}

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

.toggle-switch input:checked + .slider {
    background-color: #29a383;
}

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

/* Range Inputs */
input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    background: transparent;
    cursor: pointer;
}

input[type="range"]::-webkit-slider-track {
    background: rgba(161, 128, 114, 0.3);
    height: 4px;
    border-radius: 2px;
}

.dark input[type="range"]::-webkit-slider-track {
    background: rgba(104, 112, 102, 0.3);
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    height: 16px;
    width: 16px;
    border-radius: 50%;
    background: #29a383;
    margin-top: -6px;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

input[type="range"]::-moz-range-track {
    background: rgba(161, 128, 114, 0.3);
    height: 4px;
    border-radius: 2px;
    border: none;
}

.dark input[type="range"]::-moz-range-track {
    background: rgba(104, 112, 102, 0.3);
}

input[type="range"]::-moz-range-thumb {
    height: 16px;
    width: 16px;
    border-radius: 50%;
    background: #29a383;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Search Input Styling */
#search-input:focus {
    border-color: #29a383;
    box-shadow: 0 0 0 3px rgba(41, 163, 131, 0.1);
}

/* Mobile Styles */
@media (max-width: 640px) {
    .offcanvas-panel {
        width: 280px;
    }
    
    .glass-panel {
        margin: 8px;
    }
    
    .control-btn {
        width: 44px;
        height: 44px;
    }
}

/* MapLibre Overrides */
.maplibregl-ctrl-attrib {
    background: rgba(244, 245, 242, 0.8) !important;
    backdrop-filter: blur(10px);
    border-radius: 8px !important;
    font-size: 11px !important;
    padding: 4px 8px !important;
    margin: 8px !important;
}

.dark .maplibregl-ctrl-attrib {
    background: rgba(47, 49, 46, 0.8) !important;
    color: #e0e3de !important;
}

.maplibregl-ctrl-attrib a {
    color: #29a383 !important;
    text-decoration: none;
}

.maplibregl-popup-content {
    background: rgba(244, 245, 242, 0.95) !important;
    backdrop-filter: blur(20px);
    border-radius: 12px !important;
    border: 1px solid rgba(161, 128, 114, 0.2) !important;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1) !important;
    padding: 16px !important;
    font-size: 14px !important;
}

.dark .maplibregl-popup-content {
    background: rgba(26, 28, 25, 0.95) !important;
    border: 1px solid rgba(104, 112, 102, 0.3) !important;
    color: #e0e3de !important;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3) !important;
}

.maplibregl-popup-anchor-bottom .maplibregl-popup-tip {
    border-top-color: rgba(244, 245, 242, 0.95) !important;
}

.dark .maplibregl-popup-anchor-bottom .maplibregl-popup-tip {
    border-top-color: rgba(26, 28, 25, 0.95) !important;
}

.maplibregl-popup-close-button {
    color: #687066 !important;
    font-size: 18px !important;
    padding: 4px !important;
}

.dark .maplibregl-popup-close-button {
    color: #8a9087 !important;
}

/* Smooth animations */
* {
    transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
}

/* Scrollbar styling for panels */
.offcanvas-panel::-webkit-scrollbar {
    width: 6px;
}

.offcanvas-panel::-webkit-scrollbar-track {
    background: transparent;
}

.offcanvas-panel::-webkit-scrollbar-thumb {
    background: rgba(161, 128, 114, 0.3);
    border-radius: 3px;
}

.dark .offcanvas-panel::-webkit-scrollbar-thumb {
    background: rgba(104, 112, 102, 0.3);
}

.offcanvas-panel::-webkit-scrollbar-thumb:hover {
    background: rgba(161, 128, 114, 0.5);
}

.dark .offcanvas-panel::-webkit-scrollbar-thumb:hover {
    background: #687066;
}

#radar-legend-container {
    background-color: rgba(47, 49, 46, 0.8); /* glass-dark */
    border-radius: 0.75rem; /* rounded-xl */
    padding: 0.75rem 1rem;
    width: 200px;
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid rgba(104, 112, 102, 0.3); /* stroke-dark */
}

.dark #radar-legend-container {
    background-color: rgba(47, 49, 46, 0.8); /* glass-dark */
    border: 1px solid rgba(104, 112, 102, 0.3); /* stroke-dark */
}

#attribution-container {
    background-color: rgba(47, 49, 46, 0.8); /* glass-dark */
    border-radius: 0.5rem;
    padding: 0.25rem 0.5rem;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

.dark #attribution-container {
    background-color: rgba(47, 49, 46, 0.8);
}

/* --- Radar Timeline Component Styles --- */
#radar-timeline-component {
    display: block;
    width: 100%;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    font-family: 'Inter', sans-serif;
}

#radar-timeline-component .timeline-container {
    position: relative;
    height: 48px;
    display: flex;
    align-items: center;
    cursor: pointer;
}

#radar-timeline-component .timeline-track-bg {
    position: absolute;
    width: 100%;
    height: 8px;
    background-color: #2f312e;
    border-radius: 9999px;
    z-index: 1;
    transition: box-shadow 0.4s ease-in-out;
}

@keyframes pulse-glow {
    0%, 100% { box-shadow: 0 0 12px 2px rgba(41, 163, 131, 0.6); }
    50% { box-shadow: 0 0 16px 5px rgba(41, 163, 131, 0.8); }
}

#radar-timeline-component .timeline-track-bg.forecasting {
    animation: pulse-glow 2s infinite;
}

#radar-timeline-component .timeline-past-fill {
    position: absolute;
    height: 8px;
    background-color: #29a383;
    border-radius: 9999px;
    z-index: 2;
    transition: width 0.15s ease-out;
}

#radar-timeline-component .timeline-future-pattern {
    position: absolute;
    height: 8px;
    width: 100%;
    border-radius: 9999px;
    z-index: 3;
    background-image: repeating-linear-gradient(
        -45deg,
        transparent,
        transparent 4px,
        rgba(41, 163, 131, 0.5) 4px,
        rgba(41, 163, 131, 0.5) 5px
    );
}

#radar-timeline-component .slider-handle {
    position: absolute;
    top: 50%;
    width: 24px;
    height: 24px;
    background-color: #a18072;
    border: 3px solid #1a1c19;
    border-radius: 9999px;
    z-index: 5;
    transform: translate(-50%, -50%);
    cursor: grab;
    transition: left 0.15s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

#radar-timeline-component .slider-handle:active { cursor: grabbing; }

#radar-timeline-component .now-marker {
    position: absolute;
    top: 50%;
    height: 16px;
    width: 2px;
    background-color: #f4f5f2;
    z-index: 4;
    transform: translateY(-50%);
    border-radius: 2px;
}

/* Observation Popup Styles */
.weather-station-popup .maplibregl-popup-content {
    background-color: var(--color-bg-glass-light);
    color: var(--color-text-primary-light);
    border-radius: 8px;
    padding: 0;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    border: 1px solid var(--color-border-light);
}

.dark .weather-station-popup .maplibregl-popup-content {
    background-color: var(--color-bg-glass-dark);
    color: var(--color-text-primary-dark);
    border: 1px solid var(--color-border-dark);
}

.weather-popup-content {
    padding: 12px;
}

.observation-box {
    @apply relative p-2 rounded-md text-center cursor-default transition-all duration-200;
    background-color: rgba(255,255,255,0.1);
}
.dark .observation-box {
    background-color: rgba(0,0,0,0.2);
}

.observation-box .value-container {
    @apply transition-opacity duration-200;
}

.observation-box .label {
    @apply absolute inset-0 flex items-center justify-center text-sm font-bold opacity-0 transition-opacity duration-200;
    background-color: rgba(255,255,255,0.8);
}
.dark .observation-box .label {
    background-color: rgba(0,0,0,0.8);
}

.observation-box:hover .value-container {
    opacity: 0;
}
.observation-box:hover .label {
    opacity: 1;
}

.observation-box .value {
    @apply block text-lg font-bold;
}
.observation-box .unit {
    @apply text-xs -mt-1 block;
}

.observation-box.no-data {
    background-image: repeating-linear-gradient(
        45deg,
        rgba(128, 128, 128, 0.2),
        rgba(128, 128, 128, 0.2) 5px,
        transparent 5px,
        transparent 10px
    );
}

.wind-arrow {
  @apply inline-block ml-1;
  transition: transform 0.3s ease;
}

/* Observation Sidebar Styles */
.observation-box-large {
  @apply relative p-4 rounded-lg text-center cursor-default transition-all duration-200;
  background-color: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  min-height: 80px;
}

.dark .observation-box-large {
  background-color: rgba(0,0,0,0.1);
  border: 1px solid rgba(255,255,255,0.05);
}

.observation-box-large .value-container {
  @apply transition-opacity duration-200;
}

.observation-box-large .label {
  @apply absolute inset-0 flex items-center justify-center text-sm font-bold opacity-0 transition-opacity duration-200;
  background-color: rgba(255,255,255,0.9);
  border-radius: inherit;
}

.dark .observation-box-large .label {
  background-color: rgba(0,0,0,0.9);
}

.observation-box-large:hover .value-container {
  opacity: 0;
}

.observation-box-large:hover .label {
  opacity: 1;
}

.observation-box-large .value-row {
  @apply flex items-center justify-center gap-1;
}

.observation-box-large .value {
  @apply text-2xl font-bold;
}

.observation-box-large .unit {
  @apply text-sm opacity-75;
}

.observation-box-large .direction-label {
  @apply text-xs opacity-75 mt-1;
}

.observation-box-large.no-data {
  background-image: repeating-linear-gradient(
    45deg,
    rgba(128, 128, 128, 0.1),
    rgba(128, 128, 128, 0.1) 8px,
    transparent 8px,
    transparent 16px
  );
}

.observation-box-large.no-data .label {
  opacity: 1;
}

.observation-box-large.no-data .value-container {
  opacity: 0;
}

/* Weather Station Observation Panel Styles */
.observation-panel-header {
    position: sticky;
    top: 0;
    z-index: 10;
    background: rgba(244, 245, 242, 0.98);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(161, 128, 114, 0.2);
    padding: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 80px;
}

.dark .observation-panel-header {
    background: rgba(26, 28, 25, 0.98);
    border-bottom: 1px solid rgba(104, 112, 102, 0.3);
}

.station-title-section {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex: 1;
}

.station-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: linear-gradient(135deg, #29a383, #2d8a70);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
    box-shadow: 0 4px 16px rgba(41, 163, 131, 0.3);
}

.station-info {
    flex: 1;
}

.station-name {
    font-size: 1.25rem;
    font-weight: 700;
    color: #2f312e;
    margin: 0 0 0.25rem 0;
    line-height: 1.2;
}

.dark .station-name {
    color: #e0e3de;
}

.station-details {
    font-size: 0.875rem;
    color: #687066;
    margin: 0;
    line-height: 1.3;
}

.dark .station-details {
    color: #8a9087;
}

.panel-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.control-btn-mini {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    border: none;
    background: rgba(41, 163, 131, 0.1);
    color: #29a383;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 1rem;
}

.control-btn-mini:hover {
    background: rgba(41, 163, 131, 0.2);
    transform: scale(1.05);
}

.control-btn-mini:active {
    transform: scale(0.95);
}

.observation-content {
    flex: 1;
    padding: 0;
    overflow-y: auto;
    height: calc(100vh - 80px);
}

.observation-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    padding: 3rem;
    text-align: center;
}

.placeholder-icon {
    width: 80px;
    height: 80px;
    border-radius: 20px;
    background: linear-gradient(135deg, rgba(41, 163, 131, 0.1), rgba(41, 163, 131, 0.05));
    display: flex;
    align-items: center;
    justify-content: center;
    color: #29a383;
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
    border: 2px dashed rgba(41, 163, 131, 0.3);
}

.placeholder-text {
    font-size: 1rem;
    color: #687066;
    margin: 0;
    line-height: 1.5;
    max-width: 200px;
}

.dark .placeholder-text {
    color: #8a9087;
}

/* Enhanced observation display styles */
.observation-data {
    padding: 1.5rem;
    animation: slideInUp 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.weather-summary-card {
    background: linear-gradient(135deg, rgba(41, 163, 131, 0.1), rgba(41, 163, 131, 0.05));
    border-radius: 16px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    border: 1px solid rgba(41, 163, 131, 0.2);
    position: relative;
    overflow: hidden;
}

.weather-summary-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #29a383, #2d8a70);
}

.summary-header {
    display: flex;
    justify-content: between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.current-temp {
    font-size: 3rem;
    font-weight: 800;
    color: #2f312e;
    line-height: 1;
    margin: 0;
}

.dark .current-temp {
    color: #e0e3de;
}

.temp-unit {
    font-size: 1.5rem;
    color: #687066;
    margin-left: 0.5rem;
}

.dark .temp-unit {
    color: #8a9087;
}

.weather-condition {
    font-size: 1.125rem;
    color: #687066;
    margin: 0.5rem 0;
    font-weight: 500;
}

.dark .weather-condition {
    color: #8a9087;
}

.feels-like {
    font-size: 0.875rem;
    color: #687066;
    margin: 0;
}

.dark .feels-like {
    color: #8a9087;
}

.observation-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.observation-card {
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(161, 128, 114, 0.2);
    border-radius: 12px;
    padding: 1rem;
    text-align: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.dark .observation-card {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(104, 112, 102, 0.3);
}

.observation-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    border-color: rgba(41, 163, 131, 0.4);
}

.observation-card.primary {
    background: linear-gradient(135deg, rgba(41, 163, 131, 0.1), rgba(41, 163, 131, 0.05));
    border-color: rgba(41, 163, 131, 0.3);
}

.observation-card.secondary {
    background: linear-gradient(135deg, rgba(161, 128, 114, 0.1), rgba(161, 128, 114, 0.05));
    border-color: rgba(161, 128, 114, 0.3);
}

.observation-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: linear-gradient(135deg, #29a383, #2d8a70);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.25rem;
    margin: 0 auto 0.75rem auto;
    box-shadow: 0 4px 16px rgba(41, 163, 131, 0.3);
}

.observation-icon.secondary {
    background: linear-gradient(135deg, #a18072, #8a6b5b);
    box-shadow: 0 4px 16px rgba(161, 128, 114, 0.3);
}

.observation-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #2f312e;
    margin: 0;
    line-height: 1.2;
}

.dark .observation-value {
    color: #e0e3de;
}

.observation-label {
    font-size: 0.75rem;
    color: #687066;
    margin: 0.25rem 0 0 0;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.dark .observation-label {
    color: #8a9087;
}

.observation-change {
    font-size: 0.75rem;
    margin: 0.25rem 0 0 0;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
}

.observation-change.positive {
    color: #dc2626;
}

.observation-change.negative {
    color: #2563eb;
}

.observation-change.neutral {
    color: #687066;
}

.wind-display {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.wind-arrow {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: linear-gradient(135deg, #29a383, #2d8a70);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.875rem;
    transition: transform 0.3s ease;
}

.wind-direction {
    font-size: 0.875rem;
    font-weight: 600;
    color: #687066;
    margin: 0;
}

.dark .wind-direction {
    color: #8a9087;
}

.section-header {
    font-size: 0.875rem;
    font-weight: 600;
    color: #687066;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 0 0 1rem 0;
    padding: 0 0.5rem;
    border-bottom: 1px solid rgba(161, 128, 114, 0.2);
    padding-bottom: 0.5rem;
}

.dark .section-header {
    color: #8a9087;
    border-bottom-color: rgba(104, 112, 102, 0.3);
}

.observation-history {
    margin-top: 1.5rem;
}

.history-item {
    background: rgba(255, 255, 255, 0.5);
    border: 1px solid rgba(161, 128, 114, 0.2);
    border-radius: 10px;
    padding: 1rem;
    margin-bottom: 0.75rem;
    transition: all 0.2s ease;
}

.dark .history-item {
    background: rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(104, 112, 102, 0.3);
}

.history-item:hover {
    background: rgba(255, 255, 255, 0.8);
    border-color: rgba(41, 163, 131, 0.3);
}

.dark .history-item:hover {
    background: rgba(0, 0, 0, 0.2);
    border-color: rgba(104, 112, 102, 0.4);
}

.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.history-temp {
    font-size: 1.125rem;
    font-weight: 700;
    color: #2f312e;
}

.dark .history-temp {
    color: #e0e3de;
}

.history-time {
    font-size: 0.75rem;
    color: #687066;
    font-weight: 500;
}

.dark .history-time {
    color: #8a9087;
}

.history-details {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: #687066;
}

.dark .history-details {
    color: #8a9087;
}

.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(41, 163, 131, 0.3);
    border-radius: 50%;
    border-top-color: #29a383;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.error-message {
    background: rgba(220, 38, 38, 0.1);
    border: 1px solid rgba(220, 38, 38, 0.3);
    border-radius: 10px;
    padding: 1rem;
    color: #dc2626;
    text-align: center;
    margin: 1rem;
}

.no-data {
    background: repeating-linear-gradient(
        45deg,
        rgba(161, 128, 114, 0.1),
        rgba(161, 128, 114, 0.1) 10px,
        transparent 10px,
        transparent 20px
    );
    opacity: 0.7;
}

.dark .no-data {
    background: repeating-linear-gradient(
        45deg,
        rgba(104, 112, 102, 0.1),
        rgba(104, 112, 102, 0.1) 10px,
        transparent 10px,
        transparent 20px
    );
}

/* Responsive design */
@media (max-width: 768px) {
    .observation-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }
    
    .observation-card {
        padding: 0.75rem;
    }
    
    .observation-icon {
        width: 32px;
        height: 32px;
        font-size: 1rem;
    }
    
    .observation-value {
        font-size: 1.25rem;
    }
    
    .current-temp {
        font-size: 2.5rem;
    }
}

/* Animation for refresh button */
.refreshing {
    animation: spin 1s linear infinite;
}

/* Accessibility improvements */
.observation-card:focus {
    outline: 2px solid #29a383;
    outline-offset: 2px;
}

.control-btn-mini:focus {
    outline: 2px solid #29a383;
    outline-offset: 2px;
}