@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&display=swap');

:root {
    --bg-dark: #09090b; /* Very dark midnight */
    --surface-dark: rgba(15, 23, 42, 0.6); /* Glass surface */
    --surface-light: rgba(30, 41, 59, 0.7); /* Lighter glass */
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --border-color: rgba(255, 255, 255, 0.08);
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    --radius: 24px;
    
    --aqi-good: #10b981;
    --aqi-moderate: #f59e0b;
    --aqi-sensitive: #f97316;
    --aqi-unhealthy: #ef4444;
    --aqi-very-unhealthy: #8b5cf6;
    --aqi-hazardous: #7f1d1d;
    --aqi-unknown: #64748b;
    
    --accent: #10b981;
    --accent-glow: rgba(16, 185, 129, 0.3);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Outfit', sans-serif;
}

body.dark-theme {
    background-color: var(--bg-dark);
    color: var(--text-primary);
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

/* AURA BACKGROUND */
.aura-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
}

.aura {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.4;
    animation: float 20s infinite alternate ease-in-out;
}

.aura-1 {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(16,185,129,0.15) 0%, rgba(0,0,0,0) 70%);
    top: -100px;
    left: -100px;
    animation-delay: 0s;
}

.aura-2 {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(16,185,129,0.15) 0%, rgba(0,0,0,0) 70%);
    bottom: -150px;
    right: -150px;
    animation-delay: -5s;
}

@keyframes float {
    0% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(30px, 50px) scale(1.1); }
    100% { transform: translate(-20px, 20px) scale(0.9); }
}

/* GLASSMORPHISM UTILITIES */
.glass-panel {
    background: var(--surface-dark);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    box-shadow: var(--glass-shadow);
}

/* HEADER */
.app-header {
    padding: 1.25rem 1.5rem 1rem 1.5rem;
    border-bottom-left-radius: 32px;
    border-bottom-right-radius: 32px;
    margin-bottom: 0.5rem;
    position: relative;
    z-index: 10;
}

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.app-logo-container {
    display: flex;
    align-items: center;
}

.app-logo {
    height: 40px;
    width: auto;
    object-fit: contain;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));
}

.user-details {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
}

.location-weather {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0.75rem;
}

.location {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.05);
    padding: 4px 10px;
    border-radius: 12px;
}

.weather {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
}

.main-title {
    font-size: 1.8rem;
    font-weight: 800;
    margin-bottom: 1.5rem;
    background: linear-gradient(135deg, #fff 0%, #94a3b8 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.5px;
}

/* GAUGES */
.national-gauges {
    display: flex;
    gap: 1rem;
}

.gauge-container {
    flex: 1;
    background: var(--surface-light);
    border-radius: var(--radius);
    padding: 0.65rem 0.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    border: 1px solid rgba(255,255,255,0.05);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.3s, border-color 0.3s;
    --glow-color: transparent;
}

.gauge-container:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 20px var(--glow-color);
    border-color: var(--glow-color);
}

.gauge-title {
    font-size: 0.65rem;
    color: var(--text-secondary);
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    text-align: center;
    gap: 0.25rem;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.gauge {
    position: relative;
    width: 120px;
    height: 60px;
    margin: 0 auto;
}

.gauge-svg {
    width: 100%;
    height: 100%;
    overflow: visible;
}

.gauge-bg {
    fill: none;
    stroke: rgba(0,0,0,0.3);
    stroke-width: 10;
    stroke-linecap: round;
}

.gauge-fill {
    fill: none;
    stroke-width: 10;
    stroke-linecap: round;
    transition: stroke-dashoffset 1.5s cubic-bezier(0.4, 0, 0.2, 1), stroke 0.5s;
    filter: drop-shadow(0 0 6px currentColor); /* Neon glow */
}

.gauge-content {
    position: absolute;
    bottom: -12px;
    left: 0;
    width: 100%;
    text-align: center;
}

.gauge-value {
    font-size: 1.4rem;
    font-weight: 800;
    line-height: 1;
    text-shadow: 0 2px 10px rgba(0,0,0,0.5);
}

.gauge-label {
    font-size: 0.5rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 2px;
}

/* MAIN CONTENT */
.app-content {
    padding: 0 1.5rem 1.5rem 1.5rem;
    max-width: 800px;
    margin: 0 auto;
}

/* MAP */
.map-section {
    border-radius: var(--radius);
    overflow: hidden;
    height: 380px;
    margin-bottom: 0.5rem;
    border: 1px solid var(--border-color);
    box-shadow: var(--glass-shadow);
    position: relative;
    z-index: 1;
}

#map {
    width: 100%;
    height: 100%;
    background-color: #0f172a;
}

/* Leaflet dark theme tweaks */
.leaflet-container {
    background: #0f172a !important;
    font-family: 'Outfit', sans-serif;
}

.leaflet-control-zoom-in,
.leaflet-control-zoom-out,
.leaflet-control-attribution {
    filter: invert(100%) hue-rotate(180deg) brightness(90%) contrast(90%);
}

/* Glass panel style for layer controls */
.leaflet-control-layers {
    background: rgba(15, 23, 42, 0.3) !important;
    backdrop-filter: blur(5px) !important;
    -webkit-backdrop-filter: blur(5px) !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    border-radius: 8px !important;
    color: var(--text-primary) !important;
}

.leaflet-control-layers-expanded {
    background: rgba(15, 23, 42, 0.6) !important;
    padding: 8px 12px !important;
}

.leaflet-control-layers-toggle {
    /* Invert the default black layers icon to make it light/white */
    filter: invert(100%) hue-rotate(180deg) brightness(120%);
    background-size: 16px !important;
    width: 26px !important;
    height: 26px !important;
}

.leaflet-control-layers-list label {
    color: var(--text-secondary);
    font-size: 0.75rem;
    font-weight: 500;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    white-space: nowrap;
}
.leaflet-control-layers-list label:last-child {
    margin-bottom: 0;
}

/* Style the radio buttons */
.leaflet-control-layers-selector {
    margin-right: 8px !important;
    accent-color: var(--primary-color) !important;
}

.leaflet-popup-content-wrapper {
    background: rgba(15, 23, 42, 0.85) !important;
    backdrop-filter: blur(8px);
    color: var(--text-primary) !important;
    border: 1px solid var(--border-color);
    border-radius: 16px !important;
    box-shadow: var(--glass-shadow) !important;
}
.leaflet-popup-tip {
    background: rgba(15, 23, 42, 0.85) !important;
}

/* DETAILS LIST */
.details-section {
    border-radius: var(--radius);
    padding: 0.5rem;
    margin-bottom: 0.5rem;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.85rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.section-header h2 {
    font-size: 0.75rem;
    color: var(--text-primary);
    font-weight: 700;
    letter-spacing: 0.5px;
    display: flex;
    gap: 6px;
    align-items: center;
}

#selected-city-name {
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.65rem;
}

.details-list {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.empty-state {
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.9rem;
    padding: 2rem 0;
}

.detail-item {
    display: flex;
    align-items: center;
    background: rgba(255,255,255,0.02);
    border: 1px solid transparent;
    border-radius: 16px;
    padding: 0.4rem 0.8rem;
    transition: all 0.3s ease;
    animation: slideUp 0.4s ease forwards;
    opacity: 0;
    transform: translateY(10px);
}

.detail-item:nth-child(1) { animation-delay: 0.05s; }
.detail-item:nth-child(2) { animation-delay: 0.1s; }
.detail-item:nth-child(3) { animation-delay: 0.15s; }
.detail-item:nth-child(4) { animation-delay: 0.2s; }
.detail-item:nth-child(5) { animation-delay: 0.25s; }

@keyframes slideUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.detail-item:hover {
    background: var(--surface-light);
    border-color: rgba(255,255,255,0.1);
    transform: translateX(6px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.2);
}

.dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-right: 1.25rem;
    flex-shrink: 0;
    background-color: currentColor;
    box-shadow: 0 0 12px currentColor;
    position: relative;
}

.dot::after {
    content: '';
    position: absolute;
    top: -4px;
    left: -4px;
    right: -4px;
    bottom: -4px;
    border-radius: 50%;
    border: 2px solid currentColor;
    opacity: 0.4;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(0.8); opacity: 0.5; }
    100% { transform: scale(1.5); opacity: 0; }
}

.detail-content {
    flex: 1;
}

.detail-title {
    font-weight: 700;
    font-size: 1rem;
    margin-bottom: 0.25rem;
    color: var(--text-primary);
}

.detail-value {
    font-weight: 800;
    font-size: 2.2rem; text-shadow: 0 4px 12px rgba(0,0,0,0.4);
    text-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.detail-provider {
    font-size: 0.75rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-weight: 500;
}

/* BOTTOM NAV */
.bottom-nav {
    position: fixed;
    bottom: calc(env(safe-area-inset-bottom, 0px) + 16px);
    left: 50%;
    transform: translateX(-50%);
    width: 374px;
    max-width: calc(100% - 32px);
    height: 48px;
    background: rgba(13, 22, 41, 0.6);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 4000;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.7);
    transition: all var(--transition, 0.3s);
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    overflow: hidden;
}

html.is-native-app .bottom-nav {
    bottom: calc(env(safe-area-inset-bottom, 0px) + 4px) !important;
    border-radius: 24px;
}

.nav-indicator {
    position: absolute;
    bottom: 4px;
    height: 40px;
    background: rgba(16, 185, 129, 0.2);
    border-radius: 20px;
    z-index: -1;
    transition: all var(--spring, 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275));
    pointer-events: none;
    border: 1px solid rgba(16, 185, 129, 0.3);
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.15);
    display: block !important;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #cbd5e1;
    text-decoration: none;
    font-size: 0.68rem;
    font-weight: 700;
    gap: 4px;
    transition: color 0.3s, transform 0.2s;
    position: relative;
    -webkit-tap-highlight-color: transparent;
    z-index: 1;
    width: 20%;
}

.nav-item:active {
    transform: scale(0.9);
}

.nav-item.active svg {
    stroke: var(--aqi-good);
    transform: translateY(-2px);
    filter: drop-shadow(0 0 8px rgba(16, 185, 129, 0.6));
}

.nav-item svg {
    width: 22px;
    height: 22px;
    stroke-width: 1.6;
    stroke-linecap: round;
    stroke-linejoin: round;
    opacity: 0.85;
    transition: transform var(--spring, 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275)), stroke 0.3s;
}

.nav-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #FF3B30;
    color: white;
    font-size: 0.65rem;
    font-weight: 800;
    min-width: 16px;
    height: 16px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    border: 2px solid var(--surface);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.5);
    z-index: 10;
}

/* LOADER */
.loader-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--bg-dark);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.5s ease;
}

.spinner {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: 3px solid rgba(255,255,255,0.05);
    border-top-color: var(--accent);
    animation: spin 1s cubic-bezier(0.68, -0.55, 0.265, 1.55) infinite;
    box-shadow: 0 0 20px var(--accent-glow);
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ANALYTICS WIDGETS */
.analytics-widgets {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0;
    overflow-x: auto;
    padding-bottom: 0.5rem;
    scrollbar-width: none; /* Firefox */
}

.analytics-widgets::-webkit-scrollbar {
    display: none; /* Safari and Chrome */
}

.widget {
    flex: 1;
    min-width: 140px;
    border-radius: var(--radius);
    padding: 0.5rem;
    display: flex;
    flex-direction: column;
}

.widget-title {
    font-size: 0.65rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    font-weight: 700;
    margin-bottom: 0.85rem;
    letter-spacing: 0.5px;
    line-height: 1.2;
}

.widget-chart-container {
    flex: 1;
    height: 120px;
    min-height: 80px;
    position: relative;
    width: 100%;
}

.top-polluted-list {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    flex: 1;
}

.top-polluted-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.top-polluted-val {
    font-size: 1.1rem;
    font-weight: 800;
    line-height: 1;
}

.top-polluted-city {
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-weight: 500;
}

@media (max-width: 400px) {
    .gauge-value {
        font-size: 1.4rem;
    }
    .main-title {
        font-size: 1.5rem;
    }
    .gauge-title {
        font-size: 0.55rem;
    }
    .gauge-label {
        font-size: 0.5rem;
    }
    .national-gauges {
        gap: 0.5rem;
    }
    .gauge-container {
        padding: 0.75rem 0.5rem;
    }
}
            height: 68px;
            height: 68px;
            padding: 0 16px;
            display: flex;
            align-items: center;
            justify-content: space-between;
            background: var(--surface);
            border-bottom: 1px solid rgba(255, 255, 255, 0.05);
            position: relative;
            z-index: 1001;
        }

        #map {
            width: 100%;
            height: calc(100vh - 68px - 75px);
            background: #000000;
        }

        .m-marker {
            background: transparent !important;
            border: none !important;
        }

        body {
            background: #000000;
        }

        /* Modern Pin Component */
        .pin-container {
            position: relative;
            display: flex;
            flex-direction: column;
            align-items: center;
            cursor: pointer;
            transform: scale(var(--pin-scale, 1));
            transform-origin: bottom center;
            transition: transform 0.1s linear;
        }

        .pin-pill {
            padding: 3px 8px;
            border-radius: 20px;
            font-size: 11px;
            font-weight: 800;
            white-space: nowrap;
            box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
            border: 1.5px solid rgba(255, 255, 255, 0.2);
            position: relative;
            z-index: 2;
            display: flex;
            align-items: center;
            gap: 3px;
        }

        .pin-beak {
            width: 0;
            height: 0;
            border-left: 5px solid transparent;
            border-right: 5px solid transparent;
            border-top: 6px solid #1e293b;
            margin-top: -2px;
            z-index: 1;
        }

        /* Rain Indicator Pulse */
        .rain-pulse {
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            width: 35px;
            height: 35px;
            background: rgba(16, 185, 129, 0.5);
            border-radius: 50%;
            z-index: 0;
            animation: mapPulse 2s infinite;
        }

        @keyframes mapPulse {
            0% {
                transform: translate(-50%, -50%) scale(0.5);
                opacity: 0.8;
            }

            100% {
                transform: translate(-50%, -50%) scale(2.2);
                opacity: 0;
            }
        }

        @keyframes rainGlow {
            0% {
                box-shadow: 0 0 5px rgba(52, 211, 153, 0.4);
                border-color: rgba(255, 255, 255, 0.2);
            }

            100% {
                box-shadow: 0 0 15px 4px rgba(52, 211, 153, 0.8), 0 0 30px rgba(16, 185, 129, 0.5);
                border-color: #38bdf8;
            }
        }

        .pin-rain-glow {
            animation: rainGlow 1.5s infinite alternate !important;
            border-width: 2px !important;
            z-index: 5 !important;
        }

        .rain-drop-icon {
            color: #fff;
            margin-right: 2px;
            display: inline-flex;
        }

        /* Mobile Map Legend */
        .map-legend {
            position: absolute;
            bottom: 80px;
            left: 15px;
            background: rgba(15, 23, 42, 0.7);
            backdrop-filter: blur(16px);
            padding: 12px 14px;
            border-radius: 14px;
            border: 1px solid rgba(255, 255, 255, 0.08);
            z-index: 1000;
            color: #fff;
            font-family: inherit;
            box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
            max-width: 140px;
            transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
        }

        .ui-minimized .map-legend {
            transform: translateX(calc(-100% - 20px));
            opacity: 0;
            pointer-events: none;
        }

        .legend-title {
            font-size: 0.65rem;
            text-transform: uppercase;
            color: #94a3b8;
            margin-bottom: 8px;
            font-weight: 800;
        }

        .legend-item {
            display: flex;
            align-items: center;
            gap: 8px;
            font-size: 0.75rem;
            margin-bottom: 5px;
            font-weight: 600;
        }

        .legend-color {
            width: 10px;
            height: 10px;
            border-radius: 3px;
        }

        /* Chip Bar */
        .layer-chip-bar {
            position: absolute;
            top: 12px;
            left: 0;
            right: 0;
            display: flex;
            align-items: center;
            gap: 8px;
            padding: 0 12px;
            overflow-x: auto;
            overflow-y: visible;
            z-index: 1000;
            scrollbar-width: none;
            -ms-overflow-style: none;
            transition: opacity 0.4s, transform 0.4s;
        }

        .layer-chip-bar::-webkit-scrollbar {
            display: none;
        }

        .ui-minimized .layer-chip-bar {
            opacity: 0;
            pointer-events: none;
            transform: translateY(-40px);
        }

        .layer-chip {
            flex-shrink: 0;
            display: inline-flex;
            align-items: center;
            gap: 5px;
            padding: 6px 12px;
            border-radius: 20px;
            font-size: 12px;
            font-weight: 700;
            color: #94a3b8;
            background: rgba(15, 23, 42, 0.82);
            backdrop-filter: blur(16px);
            -webkit-backdrop-filter: blur(16px);
            border: 1px solid rgba(255, 255, 255, 0.1);
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
            cursor: pointer;
            transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
            user-select: none;
            white-space: nowrap;
        }

        .layer-chip:active {
            transform: scale(0.94);
        }

        .layer-chip.active {
            color: #fff;
            background: rgba(16, 185, 129, 0.25);
            border-color: rgba(16, 185, 129, 0.6);
            box-shadow: 0 0 0 1px rgba(16, 185, 129, 0.3), 0 4px 12px rgba(16, 185, 129, 0.2);
        }

        .layer-chip.active-rain {
            color: #fff;
            background: rgba(52, 211, 153, 0.2);
            border-color: rgba(52, 211, 153, 0.6);
            box-shadow: 0 0 0 1px rgba(52, 211, 153, 0.3), 0 4px 12px rgba(52, 211, 153, 0.2);
        }

        .layer-chip.active-min {
            color: #fff;
            background: rgba(96, 165, 250, 0.22);
            border-color: rgba(96, 165, 250, 0.6);
        }

        .layer-chip.active-max {
            color: #fff;
            background: rgba(251, 113, 133, 0.22);
            border-color: rgba(251, 113, 133, 0.6);
        }

        .layer-chip.active-radar {
            color: #fff;
            background: rgba(52, 211, 153, 0.22);
            border-color: rgba(52, 211, 153, 0.6);
        }

        .layer-chip.active-lightning {
            color: #facc15;
            background: rgba(250, 204, 21, 0.15);
            border-color: rgba(250, 204, 21, 0.5);
        }

        .chip-divider {
            flex-shrink: 0;
            width: 1px;
            height: 24px;
            background: rgba(255, 255, 255, 0.1);
        }

        /* Overhaul Controls (utility only) */
        .m-map-controls {
            position: absolute;
            top: 68px;
            right: 12px;
            display: flex;
            flex-direction: column;
            gap: 8px;
            z-index: 1000;
            transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
        }

        .m-ctrl-btn {
            background: rgba(15, 23, 42, 0.75);
            backdrop-filter: blur(16px);
            -webkit-backdrop-filter: blur(16px);
            width: 42px;
            height: 42px;
            border-radius: 12px;
            border: 1px solid rgba(255, 255, 255, 0.08);
            color: #94a3b8;
            display: flex;
            align-items: center;
            justify-content: center;
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
            cursor: pointer;
            transition: all 0.2s;
        }

        .m-ctrl-btn:active {
            transform: scale(0.92);
        }

        .m-ctrl-btn.active {
            color: #10b981;
            border-color: rgba(16, 185, 129, 0.4);
            background: rgba(16, 185, 129, 0.12);
        }

        /* Leaflet Popup Sync with portal1 */
        .leaflet-popup-content-wrapper {
            background: #1e293b !important;
            color: #f1f5f9 !important;
            border-radius: 12px !important;
            padding: 0 !important;
            border: 1px solid rgba(255, 255, 255, 0.1) !important;
            box-shadow: 0 10px 25px rgba(0, 0, 0, 0.6) !important;
        }

        .leaflet-popup-content {
            margin: 0 !important;
            width: max-content !important;
            padding: 10px !important;
            font-family: inherit;
        }

        .leaflet-popup-tip {
            background: #1e293b !important;
        }

        .leaflet-popup-close-button {
            color: rgba(255, 255, 255, 0.5) !important;
        }

        /* AQI Dot Layer */
        .aqi-dot {
            position: absolute;
            bottom: -4px;
            right: -4px;
            width: 12px;
            height: 12px;
            border-radius: 50%;
            border: 2px solid #000;
            box-shadow: 0 0 8px rgba(0, 0, 0, 0.5);
        }

        .m-aqi-target {
            z-index: 1000 !important;
        }

        /* Refresh Spin */
        .rotating {
            animation: spin 1s linear infinite;
        }

        @keyframes spin {
            from {
                transform: rotate(0deg);
            }

            to {
                transform: rotate(360deg);
            }
        }

        /* Sync Status Icons */
        .sync-status {
            position: absolute;
            top: -4px;
            left: -4px;
            z-index: 10;
            filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.5));
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            width: 16px;
            height: 16px;
        }

        .sync-status.stale {
            color: #f59e0b;
            background: rgba(15, 23, 42, 0.9);
            border: 1px solid rgba(245, 158, 11, 0.3);
        }

        .sync-status.offline {
            color: #ef4444;
            background: rgba(15, 23, 42, 0.9);
            border: 1px solid rgba(239, 68, 68, 0.3);
            animation: statusPulse 2s infinite;
        }

        @keyframes statusPulse {
            0% {
                transform: scale(0.9);
                opacity: 0.7;
            }

            50% {
                transform: scale(1.1);
                opacity: 1;
            }

            100% {
                transform: scale(0.9);
                opacity: 0.7;
            }
        }

        .wind-arrow {
            display: inline-block;
            transition: transform 0.3s;
        }

        /* Raindrop Pin (padavine) */
        .raindrop-pin {
            width: 32px;
            height: 32px;
            background: #10b981;
            border-radius: 50% 50% 50% 0;
            transform: rotate(-45deg);
            display: flex;
            align-items: center;
            justify-content: center;
            box-shadow: -2px 4px 8px rgba(0, 0, 0, 0.5);
            border: 2px solid rgba(255, 255, 255, 0.4);
            position: relative;
            z-index: 2;
            transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
        }

        .pin-container.is-raindrop {
            margin-top: -20px;
        }

        .pin-container:hover .raindrop-pin {
            transform: rotate(-45deg) scale(1.15);
            border-color: #fff !important;
            box-shadow: -4px 6px 12px rgba(0, 0, 0, 0.7);
        }

        .raindrop-text {
            transform: rotate(45deg);
            color: #fff;
            font-size: 11px;
            font-weight: 800;
            text-align: center;
            padding-right: 2px;
            padding-bottom: 2px;
            text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
        }

        .raindrop-no-data {
            opacity: 0.3;
            filter: grayscale(100%);
        }

        /* Diamond Pin (min/max temperatura) */
        .diamond-pin {
            width: 36px;
            height: 36px;
            background: #10b981;
            border-radius: 6px;
            transform: rotate(45deg);
            display: flex;
            align-items: center;
            justify-content: center;
            box-shadow: 4px 4px 10px rgba(0, 0, 0, 0.5);
            border: 2px solid rgba(255, 255, 255, 0.4);
            position: relative;
            z-index: 2;
            transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
        }

        .pin-container.is-diamond {
            margin-top: -10px;
        }

        .pin-container:hover .diamond-pin {
            transform: rotate(45deg) scale(1.15);
            border-color: #fff !important;
            box-shadow: 6px 6px 14px rgba(0, 0, 0, 0.7);
        }

        .diamond-text {
            transform: rotate(-45deg);
            color: #fff;
            text-align: center;
            text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
            display: flex;
            flex-direction: column;
            line-height: 1.1;
            font-weight: 800;
        }

        /* Dedicated Map Fullscreen Fix */
        body.map-fullscreen-view {
            overflow: hidden !important;
            height: 100vh !important;
            width: 100vw !important;
        }

        body.map-fullscreen-view header,
        body.map-fullscreen-view .bottom-nav {
            display: none !important;
        }

        body.map-fullscreen-view #map-wrapper {
            position: fixed !important;
            inset: 0 !important;
            height: 100vh !important;
            width: 100vw !important;
            z-index: 100000 !important;
            margin: 0 !important;
            padding: 0 !important;
        }

        body.map-fullscreen-view #map {
            height: 100vh !important;
            border-radius: 0 !important;
        }

        body.map-fullscreen-view .m-map-controls {
            top: 20px !important;
            right: 15px !important;
            z-index: 200000 !important;
        }

        body.map-fullscreen-view .layer-chip-bar {
            top: 15px !important;
            z-index: 200001 !important;
            padding-right: 70px;
        }

        .map-close-btn {
            position: fixed;
            top: 20px;
            left: 20px;
            width: 44px;
            height: 44px;
            background: rgba(15, 23, 42, 0.8);
            backdrop-filter: blur(8px);
            border: 1px solid rgba(255, 255, 255, 0.2);
            border-radius: 12px;
            color: #fff;
            display: none;
            align-items: center;
            justify-content: center;
            z-index: 200001;
            box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
        }

        body.map-fullscreen-view .map-close-btn {
            display: flex;
        }

        /* AQI Markers on Map */
        .aqi-marker-icon {
            background: transparent !important;
            border: none !important;
        }
        
        .modern-aqi-marker {
            width: 28px;
            height: 28px;
            background-color: var(--aqi-color, #10b981);
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            color: white;
            font-size: 11px;
            font-weight: 700;
            box-shadow: 0 0 10px var(--aqi-color, #10b981);
            border: 2px solid rgba(255, 255, 255, 0.9);
            transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
        }
        
        .modern-aqi-marker.high-danger {
            animation: aqi-pulse 2s infinite;
        }
        
        @keyframes aqi-pulse {
            0% { box-shadow: 0 0 0 0 var(--aqi-color); }
            70% { box-shadow: 0 0 0 10px rgba(0,0,0,0); }
            100% { box-shadow: 0 0 0 0 rgba(0,0,0,0); }
        }
        
        .modern-aqi-marker .aqi-val {
            position: relative;
            z-index: 2;
        }

.widget-trend { flex: 1.8; }
.widget-polluted { flex: 1; }
/* Station Picker Modal */
.sp-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.6); backdrop-filter: blur(4px);
    z-index: 10000; display: none; opacity: 0; transition: opacity 0.3s;
}
.sp-overlay.active { display: block; opacity: 1; }

.sp-sheet {
    position: fixed; bottom: -100%; left: 0; width: 100%; max-height: 85vh;
    background: #0f172a; border-top-left-radius: 24px; border-top-right-radius: 24px;
    z-index: 10001; display: flex; flex-direction: column;
    transition: bottom 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 -10px 40px rgba(0,0,0,0.5);
}
.sp-sheet.active { bottom: 0; }

.sp-handle {
    width: 40px; height: 5px; background: rgba(255,255,255,0.2);
    border-radius: 5px; margin: 12px auto;
}
.sp-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 0 20px 15px; border-bottom: 1px solid rgba(255,255,255,0.05);
}
.sp-title-wrap h3 { margin: 0; font-size: 2.2rem; text-shadow: 0 4px 12px rgba(0,0,0,0.4); font-weight: 700; }
.sp-title-wrap p { margin: 4px 0 0; font-size: 0.8rem; color: #94a3b8; }
.sp-close { background: rgba(255,255,255,0.05); border: none; color: #fff; border-radius: 50%; width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; cursor: pointer; }

.sp-search-wrap { padding: 15px 20px; position: relative; }
.sp-search-icon { position: absolute; left: 35px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: #94a3b8; }
.sp-search-input { 
    width: 100%; background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.1);
    color: #fff; padding: 12px 15px 12px 40px; border-radius: 12px; font-family: 'Outfit', sans-serif;
    box-sizing: border-box;
}
.sp-search-input:focus { outline: none; border-color: var(--accent); }

.sp-body { padding: 0 20px 20px; overflow-y: auto; flex: 1; }
.sp-list { display: flex; flex-direction: column; gap: 8px; }

.sp-item { 
    display: flex; justify-content: space-between; align-items: center; 
    padding: 12px 15px; background: rgba(255,255,255,0.03); 
    border-radius: 12px; cursor: pointer; transition: background 0.2s;
}
.sp-item:hover { background: rgba(255,255,255,0.08); }
.sp-item-name { font-weight: 600; font-size: 0.95rem; }
.sp-item-city { font-size: 0.75rem; color: #94a3b8; margin-top: 2px; }
.sp-item-dist { font-size: 0.8rem; font-weight: 700; color: var(--accent); background: rgba(16,185,129,0.1); padding: 4px 8px; border-radius: 8px; }

.location-weather .location { cursor: pointer; padding: 4px 8px; border-radius: 8px; transition: background 0.3s; }
.location-weather .location:hover { background: rgba(255,255,255,0.05); }
.onboarding-overlay {
    position: fixed;
    inset: 0;
    z-index: 999998;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s ease;
}

.onboarding-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.onboarding-card {
    width: 100%;
    max-width: 400px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.02) 100%), var(--surface);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 32px;
    padding: 30px;
    text-align: center;
    box-shadow: 0 40px 100px rgba(0, 0, 0, 0.9);
    transform: translateY(30px) scale(0.95);
    transition: all 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.onboarding-overlay.active .onboarding-card {
    transform: translateY(0) scale(1);
}

.onboarding-logo {
    width: 64px;
    height: 64px;
    background: var(--accent-glow);
    border-radius: 20px;
    margin: 0 auto 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent);
    box-shadow: 0 10px 30px var(--accent-glow);
}

.onboarding-card h2 {
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: 10px;
    letter-spacing: -0.5px;
}

.onboarding-card p {
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 30px;
}

.onboarding-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.ob-btn {
    width: 100%;
    padding: 16px;
    border-radius: 18px;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    -webkit-tap-highlight-color: transparent;
}

.ob-btn-primary {
    background: var(--accent);
    color: #fff;
    box-shadow: 0 10px 25px var(--accent-glow);
}

.ob-btn-primary:active {
    transform: scale(0.96);
    background: #059669;
}

.ob-btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
}

.ob-btn-secondary:active {
    background: rgba(255, 255, 255, 0.1);
}

.ob-city-select-wrap {
    margin-top: 15px;
    display: none;
    flex-direction: column;
    gap: 10px;
    animation: fadeInDown 0.4s ease;
}

.ob-select {
    width: 100%;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 14px;
    padding: 14px;
    color: #fff;
    font-size: 1rem;
    font-family: inherit;
    outline: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 18px;
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* --- LOCAL PARTNER ADS --- */
.local-ad-container {
    width: 100%;
    margin: 10px 0;
    display: none;
    /* Controlled by JS */
}

.local-ad-link {
    display: block;
    width: 100%;
    text-decoration: none;
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.local-ad-link:hover {
    transform: scale(1.005);
    border-color: rgba(255, 255, 255, 0.1);
}

.local-ad-img {
    width: 100%;
    height: auto;
    display: block;
    max-height: 120px;
    object-fit: contain;
}

.local-ad-badge {
    position: absolute;
    top: 6px;
    right: 8px;
    background: rgba(16, 185, 129, 0.9);
    color: #fff;
    font-size: 0.55rem;
    font-weight: 900;
    padding: 2px 6px;
    border-radius: 4px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    backdrop-filter: blur(4px);
    pointer-events: none;
}

/* --- Aeropalynological Calendar (SEPA Style) --- */
.pollen-calendar-modal {
    position: fixed;
    inset: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    background: #020617;
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    z-index: 200000;
    display: none;
    flex-direction: column;
    padding: 30px 20px;
    align-items: center;
    justify-content: flex-start;
    overflow-y: auto;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.pollen-calendar-modal.active {
    display: flex;
    opacity: 1;
}

.pollen-calendar-content {
    background: transparent;
    width: 100%;
    max-width: 1000px;
    padding: 0;
    position: relative;
    box-shadow: none;
    transform: translateY(20px);
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.pollen-calendar-modal.active .pollen-calendar-content {
    transform: translateY(0);
}

.pollen-grid {
    display: grid;
    grid-template-columns: minmax(60px, 80px) repeat(9, 1fr);
    gap: clamp(2px, 1vw, 8px);
    margin-top: 20px;
    overflow-x: auto;
    padding-bottom: 10px;
}

.pollen-grid-header {
    font-size: 0.6rem;
    color: var(--text-muted);
    text-align: center;
    font-weight: 800;
    padding-bottom: 8px;
    text-transform: uppercase;
}

.pollen-row-label {
    font-size: 0.7rem;
    font-weight: 700;
    color: #fff;
    display: flex;
    align-items: center;
    white-space: nowrap;
}

.pollen-cell {
    aspect-ratio: 1;
    border-radius: clamp(3px, 1vw, 6px);
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: transform 0.2s ease;
    min-width: 25px;
}

.pollen-cell.low {
    background: #10b981;
    opacity: 0.3;
}

.pollen-cell.mod {
    background: #f59e0b;
    opacity: 0.5;
}

.pollen-cell.high {
    background: #ef4444;
    opacity: 0.75;
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.2);
}

.pollen-cell.extreme {
    background: #7c3aed;
    opacity: 1;
    box-shadow: 0 0 15px rgba(124, 58, 237, 0.4);
}

.pollen-cell.current-month {
    border: 2px solid #fff;
    transform: scale(1.15);
    z-index: 2;
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.3);
}

.pollen-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.65rem;
    color: var(--text-muted);
}

.legend-box {
    width: 10px;
    height: 10px;
    border-radius: 3px;
}

/* --- DASHBOARD MODULE CUSTOMIZATION (User Toggles) --- */
html.hide-agro .agro-widget, html.hide-agro .mod-agro { display: none !important; }
html.hide-pigeon .pigeon-widget, html.hide-pigeon .mod-pigeon { display: none !important; }
html.hide-biker .biker-widget, html.hide-biker .mod-biker { display: none !important; }
html.hide-astro .astro-widget, html.hide-astro .mod-astro { display: none !important; }
html.hide-fishing .fishing-widget, html.hide-fishing .mod-fishing { display: none !important; }


/* SweetAlert2 Z-Index Overrides */
.swal2-container {
    z-index: 999999 !important;
}

/* Fix scrolling over ads without completely breaking clicks/viewability */
.native-ad-v2, 
.local-ad-container,
.ad-unit-wrapper {
    /* pointer-events: none completely breaks AdSense */
    touch-action: pan-y !important;
}

/* --- Trend Indicators --- */
.trend-arrow {
    display: inline-block;
    font-size: 0.7em;
    margin-left: 4px;
    vertical-align: middle;
    font-weight: 800;
    opacity: 0;
    animation: fadeIn 0.3s forwards 0.5s;
}
.trend-up {
    color: #ef4444; /* Red for rising pollution */
}
.trend-down {
    color: #10b981; /* Green for falling pollution */
}
.trend-flat {
    color: #94a3b8; /* Slate for stable */
}


/* --- Absolute Trend Arrows --- */
.card-trend-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 2.2rem; text-shadow: 0 4px 12px rgba(0,0,0,0.4);
    font-weight: 800;
    opacity: 0;
    animation: fadeIn 0.3s forwards 0.5s;
}
.arrow-left {
    left: 15px;
}
.arrow-right {
    right: 15px;
}


@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}


.anim-bounce-up {
    animation: bounceUp 2s infinite ease-in-out;
}
.anim-bounce-down {
    animation: bounceDown 2s infinite ease-in-out;
}
@keyframes bounceUp {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-4px); }
}
@keyframes bounceDown {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(4px); }
}


 
 / *   W i d g e t   F u l l s c r e e n   C S S   * / 
 
 . w i d g e t . c h a r t - f u l l s c r e e n   { 
 
         p o s i t i o n :   f i x e d ; 
 
         t o p :   0 ; 
 
         l e f t :   0 ; 
 
         w i d t h :   1 0 0 v w ; 
 
         h e i g h t :   1 0 0 v h ; 
 
         z - i n d e x :   1 0 0 0 0 0 ; 
 
         m a r g i n :   0 ; 
 
         b o r d e r - r a d i u s :   0 ; 
 
         d i s p l a y :   f l e x ; 
 
         f l e x - d i r e c t i o n :   c o l u m n ; 
 
         b a c k g r o u n d :   r g b a ( 1 5 ,   2 3 ,   4 2 ,   0 . 9 8 ) ; 
 
         b a c k d r o p - f i l t e r :   b l u r ( 2 0 p x ) ; 
 
         - w e b k i t - b a c k d r o p - f i l t e r :   b l u r ( 2 0 p x ) ; 
 
         p a d d i n g :   3 0 p x   1 5 p x ; 
 
         o v e r f l o w :   h i d d e n ; 
 
 } 
 
 . w i d g e t . c h a r t - f u l l s c r e e n   . w i d g e t - c h a r t - c o n t a i n e r   { 
 
         f l e x :   1 ; 
 
         h e i g h t :   1 0 0 %   ! i m p o r t a n t ; 
 
         w i d t h :   1 0 0 %   ! i m p o r t a n t ; 
 
         p o s i t i o n :   r e l a t i v e ; 
 
         m a r g i n - t o p :   2 0 p x ; 
 
 } 
 
 . w i d g e t . c h a r t - f u l l s c r e e n   . w i d g e t - t i t l e   { 
 
         f o n t - s i z e :   1 . 2 r e m ; 
 
 } 
 
 . f s - b t n   { 
 
         b a c k g r o u n d :   r g b a ( 2 5 5 , 2 5 5 , 2 5 5 , 0 . 1 ) ; 
 
         b o r d e r :   1 p x   s o l i d   r g b a ( 2 5 5 , 2 5 5 , 2 5 5 , 0 . 1 ) ; 
 
         c o l o r :   # f f f ; 
 
         b o r d e r - r a d i u s :   8 p x ; 
 
         p a d d i n g :   6 p x ; 
 
         c u r s o r :   p o i n t e r ; 
 
         d i s p l a y :   f l e x ; 
 
         a l i g n - i t e m s :   c e n t e r ; 
 
         j u s t i f y - c o n t e n t :   c e n t e r ; 
 
         t r a n s i t i o n :   b a c k g r o u n d   0 . 2 s ; 
 
 } 
 
 . f s - b t n : h o v e r   { 
 
         b a c k g r o u n d :   r g b a ( 2 5 5 , 2 5 5 , 2 5 5 , 0 . 2 ) ; 
 
 } 
 
 
/* --- PORTAL1 FULLSCREEN CHART PRINCIPLE --- */
body.chart-is-fullscreen header,
body.chart-is-fullscreen .bottom-nav {
    display: none !important;
}

.widget.chart-fullscreen-overlay {
    position: fixed;
    z-index: 100000;
    background: rgba(15, 23, 42, 0.98);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    display: flex !important;
    flex-direction: column !important;
    padding: 20px;
    border-radius: 0;
    border: none;
    margin: 0;
    box-sizing: border-box;
}

@media screen and (orientation: portrait) {
    .widget.chart-fullscreen-overlay {
        top: 50%;
        left: 50%;
        width: 100vh !important;
        height: 100vw !important;
        transform: translate(-50%, -50%) rotate(90deg);
        transform-origin: center center;
    }
}

@media screen and (orientation: landscape) {
    .widget.chart-fullscreen-overlay {
        top: 0;
        left: 0;
        width: 100vw !important;
        height: 100vh !important;
        transform: none;
    }
}

.widget.chart-fullscreen-overlay .widget-chart-container {
    flex: 1;
    position: relative;
    height: 100% !important;
    width: 100% !important;
    max-height: none !important;
    min-height: 0 !important;
    margin-top: 10px;
}

.widget.chart-fullscreen-overlay .widget-title {
    font-size: 1rem;
    margin-bottom: 5px;
    text-align: center;
    width: 100%;
}

.chart-close-fullscreen {
    position: absolute;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.4);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
    color: #fff;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100001;
}

.widget.chart-fullscreen-overlay .fs-btn {
    display: none;
}

/* Responsive Close Button Position */
@media screen and (orientation: landscape) {
    .chart-close-fullscreen {
        top: 20px;
        right: 20px;
        left: auto;
    }
}
@media screen and (orientation: portrait) {
    .chart-close-fullscreen {
        top: 20px;
        left: 20px;
        right: auto;
    }
}

.fs-btn { background: transparent !important; border: none !important; color: #94a3b8; border-radius: 8px; padding: 6px; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: color 0.2s; } 
.fs-btn:hover { color: #fff; }
