/* MeteoES Dashboard Styles */

/* ─── Color tokens (mode-aware) ─── */
:root {
    --color-accent: 9 105 218;
    --color-accent-hover: 5 80 174;
}
.dark {
    --color-accent: 88 166 255;
    --color-accent-hover: 121 184 255;
}

[x-cloak] {
    display: none !important;
}

/* ─── Widget (universal card/container) ─── */
.widget {
    background: #161b22;
    border: 1px solid #1c2333;
    border-radius: 12px;
}
:root:not(.dark) .widget {
    background: #ffffff;
    border-color: #d0d7de;
}

/* ─── Widget Dark (always dark, for header/footer) ─── */
.widget-dark {
    background: #161b22;
    border: 1px solid #1c2333;
    border-radius: 12px;
}

/* ─── Accent link helper ─── */
.accent-link {
    color: rgb(var(--color-accent));
}
.accent-link:hover {
    color: rgb(var(--color-accent-hover));
}

/* Tabular numbers for consistent digit width */
.tabular-nums {
    font-variant-numeric: tabular-nums;
}

/* Radar pulse animation for CTA */
.radar-pulse {
    animation: radar-pulse 2s ease-in-out infinite;
}
@keyframes radar-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.4; transform: scale(1.8); }
}

/* Weather card hover transition */
.weather-card-hover {
    transition: box-shadow 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
}
.weather-card-hover:hover {
    transform: translateY(-1px);
}

/* Scrollbar for hourly forecast */
.scrollbar-thin::-webkit-scrollbar {
    height: 6px;
}

.scrollbar-thin::-webkit-scrollbar-track {
    background: #1c2333;
    border-radius: 3px;
}

.scrollbar-thin::-webkit-scrollbar-thumb {
    background: #242d3d;
    border-radius: 3px;
}

.scrollbar-thin::-webkit-scrollbar-thumb:hover {
    background: #30394a;
}

:root:not(.dark) .scrollbar-thin::-webkit-scrollbar-track {
    background: #f1f5f9;
}

:root:not(.dark) .scrollbar-thin::-webkit-scrollbar-thumb {
    background: #cbd5e1;
}

:root:not(.dark) .scrollbar-thin::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Smooth transitions */
.transition {
    transition-property: all;
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
    transition-duration: 150ms;
}

/* Map control buttons */
.map-control-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: #161b22;
    border: 1px solid #1c2333;
    border-radius: 8px;
    color: #8b949e;
    cursor: pointer;
    transition: all 0.15s;
}
.map-control-btn:hover {
    background: #242d3d;
    color: #e6edf3;
}

:root:not(.dark) .map-control-btn {
    background: #f8fafc;
    border-color: #d0d7de;
    color: #475569;
}
:root:not(.dark) .map-control-btn:hover {
    background: #e2e8f0;
    color: #1e293b;
}

.map-control-btn-lg {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: #161b22;
    border: 1px solid #1c2333;
    border-radius: 10px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    color: #8b949e;
    cursor: pointer;
    transition: all 0.15s;
}
.map-control-btn-lg:hover {
    background: #242d3d;
    color: #58a6ff;
}

:root:not(.dark) .map-control-btn-lg {
    background: white;
    border-color: #d0d7de;
    color: #475569;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}
:root:not(.dark) .map-control-btn-lg:hover {
    background: #f1f5f9;
    color: #0969da;
}

/* Leaflet popup override */
.meteo-popup .leaflet-popup-content-wrapper {
    border-radius: 12px;
    padding: 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}
.meteo-popup .leaflet-popup-content {
    margin: 12px 14px;
    font-family: inherit;
    line-height: 1.5;
}
.meteo-popup .leaflet-popup-tip {
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}
.map-popup-content {
    min-width: 200px;
}

/* Dark Leaflet popups */
.dark .meteo-popup .leaflet-popup-content-wrapper {
    background: #161b22;
    color: #e6edf3;
}
.dark .meteo-popup .leaflet-popup-tip {
    background: #161b22;
}
.dark .meteo-popup .leaflet-popup-close-button {
    color: #8b949e;
}
.dark .map-popup-content .text-gray-800 {
    color: #e6edf3;
}
.dark .map-popup-content .text-gray-500 {
    color: #8b949e;
}
.dark .map-popup-content .text-gray-600 {
    color: #c9d1d9;
}
.dark .map-popup-content .border-gray-100 {
    border-color: #1c2333;
}
.dark .map-popup-content .text-gray-400 {
    color: #6e7681;
}

/* Dark Leaflet zoom controls */
.dark .leaflet-control-zoom a {
    background: #161b22;
    color: #8b949e;
    border-color: #1c2333;
}
.dark .leaflet-control-zoom a:hover {
    background: #242d3d;
}

/* Dark Leaflet attribution */
.dark .leaflet-control-attribution {
    background: rgba(13, 17, 23, 0.8);
    color: #8b949e;
}
.dark .leaflet-control-attribution a {
    color: #58a6ff;
}

/* Map legend */
.meteo-legend {
    background: rgba(22, 27, 34, 0.92);
    border: 1px solid #1c2333;
    border-radius: 8px;
    padding: 8px 10px;
    font-size: 11px;
    line-height: 1.4;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
    max-width: 160px;
    backdrop-filter: blur(4px);
    color: #c9d1d9;
}
:root:not(.dark) .meteo-legend {
    background: rgba(255, 255, 255, 0.92);
    border-color: #d0d7de;
    color: #374151;
}
.meteo-legend .legend-title {
    font-weight: 600;
    margin-bottom: 5px;
    font-size: 11px;
    color: #e6edf3;
}
:root:not(.dark) .meteo-legend .legend-title {
    color: #374151;
}
.meteo-legend .legend-items {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.meteo-legend .legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
}
.meteo-legend .legend-color {
    width: 16px;
    height: 10px;
    border-radius: 2px;
    flex-shrink: 0;
    border: 1px solid rgba(255,255,255,0.15);
}
:root:not(.dark) .meteo-legend .legend-color {
    border-color: rgba(0,0,0,0.1);
}
.meteo-legend .legend-label {
    color: #8b949e;
    font-size: 10px;
    white-space: nowrap;
}
:root:not(.dark) .meteo-legend .legend-label {
    color: #6b7280;
}

/* Map cursor: crosshair indicates "click to get info" */
.leaflet-container {
    cursor: crosshair !important;
}
.leaflet-container.leaflet-dragging {
    cursor: grabbing !important;
}
