﻿/*//////////////////////*/
       /*NEW CSS*/
/*//////////////////////*/

/* ============================================ */
/* TITLE BAR / HEADER STYLES                    */
/* ============================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    overflow: hidden;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.title-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 70px;
    background: #183352;
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 25px;
    z-index: 10000;
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.title-bar-left {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

    .title-bar-left i {
        font-size: 24px;
        color: #ffd700;
    }

.portal-title {
    font-size: 22px;
    font-weight: bold;
}

.geo-text {
    color: #ff4444;
}

.dss-text {
    color: #ffd700;
}

.title-bar-center {
    flex: 2;
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 4px;
}

.bharatfs-title {
    font-size: 18px;
    font-weight: bold;
    letter-spacing: 1px;
    color: white;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
}

.seoc-subtitle {
    font-size: 15px;
    font-weight: 500;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.title-bar-right {
    flex: 1;
    display: flex;
    justify-content: flex-end;
    align-items: center;
}

.logo-container {
    display: flex;
    gap: 30px;
    align-items: center;
    justify-content: flex-end;
    height: 100%;
}

.nav-logo {
    height: 70px;
    width: auto;
    object-fit: contain;
    transition: transform 0.3s ease;
}

    .nav-logo:hover {
        transform: scale(1.05);
    }

/* ============================================ */
/* MAIN CONTAINER                              */
/* ============================================ */

.app-container {
    display: flex;
    width: 100%;
    height: 100vh;
    overflow: hidden;
    padding-top: 70px;
}

/* Map Section */
.map-section {
    flex: 0 0 60%;
    position: relative;
    height: calc(100vh - 70px);
}

#map {
    width: 100%;
    height: 100%;
    z-index: 1;
}

/* Graph Section */
.graph-section {
    flex: 0 0 40%;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: -5px 0 15px rgba(0,0,0,0.3);
    z-index: 2;
    height: calc(100vh - 70px);
}

.graph-content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
}

/* Graph Header */
.graph-header {
    background: rgba(0,0,0,0.3);
    padding: 15px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    flex-shrink: 0;
}

    .graph-header h3 {
        color: #fff;
        margin-bottom: 10px;
        font-size: 1.2em;
    }

        .graph-header h3 i {
            color: #4CAF50;
            margin-right: 8px;
        }

/* Graph Tabs */
.graph-tabs {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

.tab-btn {
    background: rgba(255,255,255,0.1);
    border: none;
    padding: 8px 16px;
    border-radius: 20px;
    color: #ccc;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 13px;
}

    .tab-btn i {
        margin-right: 5px;
    }

    .tab-btn:hover {
        background: rgba(255,255,255,0.2);
        color: #fff;
    }

    .tab-btn.active {
        background: #4CAF50;
        color: white;
    }

/* Temperature subtabs */
.temperature-subtabs {
    display: flex;
    gap: 5px;
    margin-left: 10px;
    padding-left: 10px;
    border-left: 1px solid rgba(255,255,255,0.2);
    flex-wrap: wrap;
}

.temp-tab {
    background: rgba(255,255,255,0.1);
    border: none;
    padding: 6px 12px;
    border-radius: 20px;
    color: #ccc;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 11px;
}

    .temp-tab:hover {
        background: rgba(255,255,255,0.2);
        color: #fff;
    }

    .temp-tab.active {
        background: #ff9800;
        color: white;
    }

/* Graph Containers */
.graph-container {
    padding: 20px;
    display: none;
    position: relative;
    min-height: auto;
    height: auto;
}

    .graph-container.active {
        display: block;
    }

/* Charts */
#rainfallChart, #tmaxChart, #tminChart, #tavgChart, #humidityChart, #cloudChart, #mslpChart, #windCombinedChart {
    max-height: 350px;
    width: 100%;
}

/* Controls Panel - Desktop */
.controls-panel {
    position: absolute;
    top: 90px;
    left: 50px;
    z-index: 1000;
    background: rgba(30,30,40,0.95);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    min-width: 280px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
    border: 1px solid rgba(255,255,255,0.1);
    transition: all 0.3s;
}

.panel-header {
    padding: 12px 15px;
    background: rgba(0,0,0,0.3);
    border-radius: 12px 12px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
}

    .panel-header h4 {
        color: #fff;
        font-size: 14px;
        margin: 0;
    }

        .panel-header h4 i {
            color: #4CAF50;
            margin-right: 8px;
        }

.collapse-btn {
    background: none;
    border: none;
    color: #fff;
    cursor: pointer;
    font-size: 12px;
    transition: transform 0.3s;
}

.panel-content {
    padding: 15px;
    transition: all 0.3s;
}

    .panel-content.collapsed {
        display: none;
    }

.control-group {
    display: flex;
    gap: 8px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.btn-run, .btn-stop {
    padding: 6px 15px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: bold;
    transition: all 0.3s;
}

.btn-run {
    background: #4CAF50;
    color: white;
}

    .btn-run:hover {
        background: #45a049;
        transform: translateY(-2px);
    }

.btn-stop {
    background: #f44336;
    color: white;
}

    .btn-stop:hover {
        background: #da190b;
        transform: translateY(-2px);
    }

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 5px;
    color: #fff;
    font-size: 12px;
    cursor: pointer;
}

    .checkbox-label i {
        color: #4CAF50;
    }

.time-info {
    color: #fff;
    font-size: 12px;
    margin-bottom: 10px;
    padding: 8px;
    background: rgba(255,255,255,0.1);
    border-radius: 6px;
}

    .time-info i {
        margin-right: 5px;
        color: #4CAF50;
    }

.slider-container {
    display: flex;
    align-items: center;
    gap: 10px;
}

#timeSlider {
    flex: 1;
    height: 4px;
    border-radius: 2px;
    background: #4CAF50;
    outline: none;
}

    #timeSlider::-webkit-slider-thumb {
        width: 15px;
        height: 15px;
        border-radius: 50%;
        background: #4CAF50;
        cursor: pointer;
    }

#sliderLabel {
    color: #fff;
    font-size: 11px;
}

/* Basemap Gallery - Desktop */
.basemap-wrapper {
    position: absolute;
    top: 90px;
    right: 42%;
    z-index: 1000;
    min-width: 160px;
}

.basemap-toggle {
    background: rgba(30,30,40,0.95);
    backdrop-filter: blur(10px);
    padding: 10px 15px;
    border-radius: 10px;
    color: white;
    cursor: pointer;
    font-size: 13px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    border: 1px solid rgba(255,255,255,0.1);
    transition: all 0.3s;
}

    .basemap-toggle:hover {
        background: rgba(30,30,40,1);
    }

.basemap-gallery {
    margin-top: 5px;
    background: rgba(30,30,40,0.95);
    backdrop-filter: blur(10px);
    border-radius: 10px;
    padding: 10px;
    display: none;
    flex-direction: column;
    gap: 5px;
    border: 1px solid rgba(255,255,255,0.1);
}

    .basemap-gallery.show {
        display: flex;
    }

.basemap-btn {
    background: rgba(255,255,255,0.1);
    border: none;
    padding: 8px 12px;
    border-radius: 6px;
    color: white;
    cursor: pointer;
    font-size: 12px;
    text-align: left;
    transition: all 0.3s;
}

    .basemap-btn i {
        margin-right: 8px;
        width: 20px;
    }

    .basemap-btn:hover {
        background: rgba(255,255,255,0.2);
    }

    .basemap-btn.active {
        background: #4CAF50;
        border-left: 3px solid #ffd700;
    }

/* Location Search */
.search-container {
    position: absolute;
    top: 25px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2000;
    width: 300px;
}

#locationSearch {
    width: 100%;
    padding: 10px 15px;
    border-radius: 25px;
    border: none;
    outline: none;
    font-size: 14px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.3);
}

.suggestions-box {
    background: white;
    border-radius: 8px;
    margin-top: 5px;
    max-height: 250px;
    overflow-y: auto;
    display: none;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}

.suggestion-item {
    padding: 10px;
    cursor: pointer;
    font-size: 13px;
}

    .suggestion-item:hover {
        background: #f0f0f0;
    }



/* ============================================ */
/* LEGEND                                      */
/* ============================================ */

.legend {
    background: rgba(30,30,40,0.9) !important;
    backdrop-filter: blur(10px);
    padding: 10px;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.1);
    color: white;
    font-size: 11px;
    max-width: 250px;
    max-height: 90vh;
    overflow-y: auto;
}

    .legend strong {
        color: #4CAF50;
    }

    .legend i {
        vertical-align: middle;
        margin-right: 4px;
    }


/* LEGEND - RESPONSIVE                         */

/* Tablet (768px - 1200px) - Only position adjustment */
@media (min-width: 768px) and (max-width: 1200px) {
    .legend {
        bottom: 80px !important;
        right: 10px !important;
        top: auto !important;
        left: auto !important;
    }
}

/* Mobile (max-width: 768px) */
@media (max-width: 768px) {
    .legend {
        font-size: 8px !important;
        padding: 6px 8px !important;
        max-width: 140px !important;
        border-radius: 6px !important;
        bottom: 10px !important;
        right: 10px !important;
        left: auto !important;
        top: auto !important;
        max-height: 60vh !important;
        overflow-y: auto !important;
    }

        .legend strong {
            font-size: 8px !important;
        }

        .legend i {
            width: 16px !important;
            height: 10px !important;
            display: inline-block !important;
            margin-right: 3px !important;
            border-radius: 2px !important;
        }

        .legend div {
            font-size: 7px !important;
            line-height: 1.4 !important;
        }
}

/* Small Mobile (max-width: 480px) */
@media (max-width: 480px) {
    .legend {
        font-size: 6px !important;
        padding: 4px 6px !important;
        max-width: 110px !important;
        border-radius: 4px !important;
        bottom: 5px !important;
        right: 5px !important;
        max-height: 50vh !important;
        overflow-y: auto !important;
    }

        .legend strong {
            font-size: 7px !important;
            display: block !important;
            margin-bottom: 2px !important;
        }

        .legend i {
            width: 12px !important;
            height: 8px !important;
            margin-right: 2px !important;
        }

        .legend div {
            font-size: 6px !important;
            line-height: 1.3 !important;
            padding: 1px 0 !important;
        }
}

/* Landscape Mobile */
@media (max-width: 768px) and (orientation: landscape) {
    .legend {
        font-size: 7px !important;
        padding: 4px 6px !important;
        max-width: 120px !important;
        bottom: 5px !important;
        max-height: 60vh !important;
    }

        .legend strong {
            font-size: 7px !important;
        }

        .legend i {
            width: 14px !important;
            height: 9px !important;
        }
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: #1a1a2e;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb {
    background: #4CAF50;
    border-radius: 3px;
}

    ::-webkit-scrollbar-thumb:hover {
        background: #45a049;
    }

/* District and Tehsil Labels */
.district-label, .tehsil-label {
    background: transparent !important;
    border: none !important;
}

.district-label-text {
    color: #ffd700;
    font-size: 12px;
    font-weight: bold;
    font-family: 'Segoe UI', sans-serif;
    white-space: nowrap;
    text-shadow: 1px 1px 2px #000, -1px -1px 2px #000, 1px -1px 2px #000, -1px 1px 2px #000;
    pointer-events: none;
    letter-spacing: 0.5px;
}

.tehsil-label-text {
    color: #ffd700;
    font-size: 10px;
    font-weight: bold;
    font-family: 'Segoe UI', sans-serif;
    white-space: nowrap;
    text-shadow: 1px 1px 2px #000, -1px -1px 2px #000, 1px -1px 2px #000, -1px 1px 2px #000;
    pointer-events: none;
    letter-spacing: 0.5px;
}

/* Polygon Draw Tool */
.polygon-draw-tool-container {
    bottom: 80px !important;
    left: 10px !important;
    z-index: 1000 !important;
}

/* Time Aggregation Buttons */
.time-aggregation-buttons {
    background: rgba(30, 30, 40, 0.95);
    border-radius: 12px;
    margin: 15px 20px 20px 20px;
    padding: 12px 16px;
    border: 1px solid rgba(76, 175, 80, 0.3);
    backdrop-filter: blur(5px);
}

.aggregation-header {
    font-size: 13px;
    font-weight: bold;
    color: #4CAF50;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

    .aggregation-header i {
        font-size: 14px;
    }

.aggregation-note {
    font-size: 10px;
    color: #888;
    font-weight: normal;
}

.aggregation-btn-group {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.agg-btn {
    background: rgba(20, 20, 30, 0.9);
    border: 1px solid #444;
    color: #ddd;
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 12px;
    font-weight: bold;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
    position: relative;
}

    .agg-btn i {
        font-size: 12px;
    }

    .agg-btn:hover {
        background: rgba(76, 175, 80, 0.2);
        border-color: #4CAF50;
        transform: translateY(-1px);
    }

    .agg-btn.active {
        background: #4CAF50;
        border-color: #4CAF50;
        color: white;
        box-shadow: 0 2px 8px rgba(76, 175, 80, 0.3);
    }

.agg-badge {
    font-size: 9px;
    background: rgba(0,0,0,0.5);
    padding: 2px 5px;
    border-radius: 10px;
    font-weight: normal;
}

.agg-btn.active .agg-badge {
    background: rgba(255,255,255,0.2);
}

.aggregation-rules-tooltip {
    font-size: 10px;
    color: #888;
    display: flex;
    align-items: center;
    gap: 6px;
    padding-top: 8px;
    border-top: 1px solid rgba(255,255,255,0.1);
    margin-top: 5px;
}

    .aggregation-rules-tooltip i {
        color: #4CAF50;
        font-size: 11px;
    }

/* ============================================ */
/* RESPONSIVE DESIGN - MOBILE FIRST            */
/* ============================================ */

/* Tablets and Mobile (max-width: 768px) */
@media (max-width: 768px) {
    /* Title Bar */
    .title-bar {
        padding: 0 12px;
        height: 55px;
    }

    .title-bar-left i {
        font-size: 14px;
    }

    .portal-title {
        font-size: 10px;
    }

    .geo-text, .dss-text {
        font-size: 10px;
    }

    .bharatfs-title {
        font-size: 10px;
        white-space: normal;
        line-height: 1.2;
    }

    .seoc-subtitle {
        font-size: 7px;
        white-space: normal;
        text-align: center;
        line-height: 1.2;
        max-width: 150px;
    }

    .logo-container {
        gap: 8px;
    }

    .nav-logo {
        height: 35px;
    }

    /* App Container */
    .app-container {
        flex-direction: column;
        padding-top: 55px;
    }

    /* Map Section */
    .map-section {
        flex: 0 0 45%;
        height: 45vh;
    }

    /* Graph Section */
    .graph-section {
        flex: 0 0 55%;
        height: 55vh;
    }

    /* Graph Header */
    .graph-header {
        padding: 8px 12px;
    }

        .graph-header h3 {
            font-size: 12px;
            margin-bottom: 6px;
        }


    /* Graph Tabs - Horizontal Scroll */
    .graph-tabs {
        gap: 6px;
        flex-wrap: nowrap;
        overflow-x: auto;
        overflow-y: hidden;
        padding-bottom: 6px;
        -webkit-overflow-scrolling: touch;
        display: flex;
        flex-direction: row;
        align-items: center;
        scrollbar-width: thin; /* Firefox */
        scrollbar-color: #4CAF50 rgba(255,255,255,0.1); /* Firefox */
    }

        /* Custom scrollbar for graph tabs */
        .graph-tabs::-webkit-scrollbar {
            height: 3px;
        }

        .graph-tabs::-webkit-scrollbar-track {
            background: rgba(255,255,255,0.1);
            border-radius: 2px;
        }

        .graph-tabs::-webkit-scrollbar-thumb {
            background: #4CAF50;
            border-radius: 2px;
        }

    .tab-btn {
        padding: 5px 12px;
        font-size: 10px;
        white-space: nowrap;
        flex-shrink: 0; /* Prevent buttons from shrinking */
    }

        .tab-btn i {
            margin-right: 4px;
            font-size: 10px;
        }

    .temperature-subtabs {
        gap: 4px;
        margin-left: 0;
        padding-left: 0;
        border-left: none;
        flex-wrap: nowrap;
    }

    .temp-tab {
        padding: 4px 10px;
        font-size: 9px;
        white-space: nowrap;
    }

    /* Graph Containers */
    .graph-container {
        padding: 10px;
        min-height: 150px; /* Ensure minimum height */
    }

    /* Charts */
    #rainfallChart, #tmaxChart, #tminChart, #tavgChart,
    #humidityChart, #cloudChart, #mslpChart, #windCombinedChart {
        max-height: 150px;
    }

    /* Controls Panel - Mobile (Inside Graph Section) */
    .controls-panel {
        position: relative;
        top: auto;
        left: auto;
        right: auto;
        bottom: auto;
        margin: 10px;
        min-width: auto;
        max-width: calc(100% - 20px);
        order: 2;
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
    }

    .panel-header h4 {
        font-size: 11px;
    }

    .control-group {
        gap: 6px;
    }

    .btn-run, .btn-stop {
        padding: 4px 10px;
        font-size: 10px;
    }

    .checkbox-label {
        font-size: 10px;
    }

    .time-info {
        font-size: 9px;
        padding: 6px;
    }

    .slider-container {
        gap: 8px;
    }

    #sliderLabel {
        font-size: 9px;
    }

    /* Graph Section Layout for Mobile */
    .graph-section {
        display: flex;
        flex-direction: column;
        overflow-y: auto;
        height: 55vh; /* Ensure fixed height on mobile */
        max-height: 55vh;
    }

    /* Time aggregation buttons - inside graph section */
    /*.time-aggregation-buttons {
        margin: 4px 6px !important;
        padding: 6px 8px !important;
        border-radius: 8px;
        order: 4;*/ /* Keep after weather cards */
        /*display: block !important;*/ /* Force display */
        /*visibility: visible !important;
        opacity: 1 !important;
        flex-shrink: 0;*/ /* Prevent shrinking */
    /*}*/

    /* Time aggregation buttons - inside graph section */
    .time-aggregation-buttons {
        margin: 4px 6px !important;
        padding: 6px 8px !important;
        border-radius: 8px;
        order: 4; /* Keep after weather cards */
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        flex-shrink: 0; /* Prevent shrinking */
        max-height: 80px !important; /* Limit height */
        overflow-y: auto !important; /* Allow scrolling if needed */
    }


    .aggregation-header {
        font-size: 9px;
        margin-bottom: 5px;
        gap: 4px;
    }

    .aggregation-note {
        font-size: 7px;
    }

    .aggregation-btn-group {
        gap: 4px;
        margin-bottom: 4px;
    }

 /*   .agg-btn {
        padding: 4px 8px;
        font-size: 8px;
        gap: 3px;
        border-radius: 4px;
        min-height: 24px;
    }*/

    .agg-btn {
        padding: 3px 6px;
        font-size: 7px;
        gap: 2px;
        border-radius: 4px;
        min-height: 20px;
        white-space: nowrap; /* Prevent wrapping */
    }

        .agg-btn i {
            font-size: 8px;
        }

    .agg-badge {
        display: none;
    }

    .aggregation-rules-tooltip {
        font-size: 7px;
        padding-top: 4px;
        margin-top: 3px;
        flex-wrap: wrap;
    }

        .aggregation-rules-tooltip i {
            font-size: 8px;
        }

    /* Basemap Gallery - Top right of map section */
    .basemap-wrapper {
        position: absolute;
        top: 10px;
        right: 10px;
        left: auto;
        bottom: auto;
        min-width: 110px;
        z-index: 1001;
    }

    .basemap-toggle {
        padding: 6px 10px;
        font-size: 10px;
    }

    .basemap-btn {
        padding: 5px 8px;
        font-size: 9px;
    }

        .basemap-btn i {
            margin-right: 5px;
            width: 14px;
            font-size: 10px;
        }

    /* Polygon Draw Tool - Bottom left of map section */
    .polygon-draw-tool-container {
        position: absolute !important;
        bottom: 10px !important;
        left: 10px !important;
        top: auto !important;
        right: auto !important;
        transform: scale(0.9);
        transform-origin: bottom left;
        z-index: 1001 !important;
    }

    /* Location Search */
    .search-container {
        top: 10px;
        left: 50%;
        transform: translateX(-50%);
        width: calc(100% - 20px);
        max-width: 260px;
        z-index: 1001;
    }

    #locationSearch {
        padding: 8px 12px;
        font-size: 12px;
    }

    /* Legend */
    .legend {
        bottom: 10px;
        right: 10px;
        top: auto;
        left: auto;
        max-width: 120px;
        font-size: 8px;
        padding: 5px;
        z-index: 1001;
    }



    /* District Labels */
    .district-label-text {
        font-size: 9px;
    }

    .tehsil-label-text {
        font-size: 7px;
    }
}

/* Small Mobile Devices (320px - 480px) */
@media (max-width: 480px) {
    .title-bar {
        padding: 0 8px;
        height: 50px;
    }

    .app-container {
        padding-top: 50px;
    }

    .portal-title {
        font-size: 8px;
    }

    .geo-text, .dss-text {
        font-size: 8px;
    }

    .bharatfs-title {
        font-size: 8px;
    }

    .seoc-subtitle {
        font-size: 6px;
        max-width: 100px;
    }

    .nav-logo {
        height: 28px;
    }

    .map-section {
        flex: 0 0 40%;
        height: 40vh;
    }

    .graph-section {
        flex: 0 0 60%;
        height: 60vh;
    }

    .graph-header h3 {
        font-size: 11px;
    }

    .tab-btn {
        padding: 4px 10px;
        font-size: 9px;
    }

    .temp-tab {
        padding: 3px 8px;
        font-size: 8px;
    }

    .graph-container {
        padding: 8px;
    }

    #rainfallChart, #tmaxChart, #tminChart, #tavgChart,
    #humidityChart, #cloudChart, #mslpChart, #windCombinedChart {
        max-height: 150px;
    }

    .controls-panel {
        margin: 8px;
    }

    .time-aggregation-buttons {
        margin: 3px 4px !important;
        padding: 4px 6px !important;
        order: 4; /* Keep after weather cards */
    }

    .aggregation-header {
        font-size: 8px;
    }

    .aggregation-note {
        display: none; /* Hide note on very small screens */
    }

    .agg-btn {
        padding: 3px 6px;
        font-size: 7px;
        min-height: 20px;
        border-width: 0.5px;
    }

        .agg-btn i {
            font-size: 7px;
        }

    .aggregation-rules-tooltip {
        font-size: 6px;
        padding-top: 3px;
    }

    .basemap-wrapper {
        min-width: 95px;
    }

    .basemap-toggle {
        padding: 5px 8px;
        font-size: 9px;
    }

    .basemap-btn {
        padding: 4px 6px;
        font-size: 8px;
    }

    .legend {
        max-width: 100px;
        font-size: 7px;
    }

    .info-panel {
        font-size: 7px;
        padding: 3px 6px;
    }
}

/* Landscape Mode for Mobile */
@media (max-width: 768px) and (orientation: landscape) {
    .title-bar {
        height: 45px;
    }

    .app-container {
        padding-top: 45px;
    }

    .nav-logo {
        height: 30px;
    }

    .map-section {
        flex: 0 0 50%;
        height: calc(100vh - 45px);
    }

    .graph-section {
        flex: 0 0 50%;
        height: calc(100vh - 45px);
    }

    .controls-panel {
        margin: 5px;
    }

    .time-aggregation-buttons {
        margin: 5px;
        padding: 5px;
    }

    .graph-tabs {
        gap: 4px;
    }

    .tab-btn {
        padding: 3px 8px;
        font-size: 8px;
    }

    .temp-tab {
        padding: 2px 6px;
        font-size: 7px;
    }

    #rainfallChart, #tmaxChart, #tminChart, #tavgChart,
    #humidityChart, #cloudChart, #mslpChart, #windCombinedChart {
        max-height: 100px;
    }
}


/* Touch-Friendly Adjustments */
@media (max-width: 768px) {
    button, .tab-btn, .temp-tab, .basemap-btn, .agg-btn {
        cursor: pointer;
        min-height: 36px;
        min-width: 44px;
    }

    .tab-btn, .temp-tab {
        min-height: 32px;
    }

    #timeSlider::-webkit-slider-thumb {
        width: 20px;
        height: 20px;
    }

    .suggestion-item {
        padding: 12px;
        font-size: 14px;
    }
}

/* Loading Spinner */
@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.fa-spinner {
    animation: spin 1s linear infinite;
}





/* Download Button Styles */
.download-btn {
    background: linear-gradient(135deg, #4CAF50, #45a049);
    color: white;
    border: none;
    border-radius: 6px;
    padding: 6px 12px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(76, 175, 80, 0.3);
}

    .download-btn:hover {
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(76, 175, 80, 0.4);
    }

    .download-btn:active {
        transform: translateY(0px);
    }

    .download-btn i {
        margin-right: 4px;
    }

    /* Download button animation when loading */
    .download-btn.loading {
        background: #ff9800;
        cursor: wait;
        opacity: 0.7;
    }

    .download-btn .fa-spinner {
        animation: spin 1s linear infinite;
    }

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Notification toast */
.toast-notification {
    position: fixed;
    bottom: 30px;
    right: 30px;
    padding: 15px 25px;
    border-radius: 8px;
    color: white;
    font-size: 14px;
    z-index: 9999;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.5s ease;
}

    .toast-notification.show {
        transform: translateY(0);
        opacity: 1;
    }

.toast-success {
    background: linear-gradient(135deg, #4CAF50, #388E3C);
}

.toast-error {
    background: linear-gradient(135deg, #f44336, #c62828);
}

.toast-warning {
    background: linear-gradient(135deg, #ff9800, #f57c00);
}




/* ============================================ */
/* CONTROLS PANEL - BOTTOM LEFT VERSION         */
/* ============================================ */

.controls-panel-bottom {
    position: absolute;
    bottom: 10px;
    left: 20px;
    z-index: 1000;
    background: rgba(30, 30, 40, 0.92);
    backdrop-filter: blur(12px);
    border-radius: 16px;
    padding: 12px 20px;
    box-shadow: 0 4px 25px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
    width: 45%;
    max-width: calc(100% - 200px); /* Increased from 145px to leave more space for legend */
    margin: 0;
    min-width: 280px;
}

.panel-content-bottom {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 12px;
}

.control-group-bottom {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

    .control-group-bottom .btn-run,
    .control-group-bottom .btn-stop {
        padding: 8px 18px;
        border: none;
        border-radius: 8px;
        cursor: pointer;
        font-size: 13px;
        font-weight: bold;
        transition: all 0.3s ease;
        white-space: nowrap;
    }

    .control-group-bottom .btn-run {
        background: #4CAF50;
        color: white;
    }

        .control-group-bottom .btn-run:hover {
            background: #45a049;
            transform: translateY(-2px);
            box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3);
        }

    .control-group-bottom .btn-stop {
        background: #f44336;
        color: white;
    }

        .control-group-bottom .btn-stop:hover {
            background: #da190b;
            transform: translateY(-2px);
            box-shadow: 0 4px 12px rgba(244, 67, 54, 0.3);
        }

    .control-group-bottom .checkbox-label {
        display: flex;
        align-items: center;
        gap: 6px;
        color: #fff;
        font-size: 13px;
        cursor: pointer;
        padding: 6px 12px;
        background: rgba(255, 255, 255, 0.08);
        border-radius: 8px;
        transition: all 0.3s ease;
        white-space: nowrap;
    }

        .control-group-bottom .checkbox-label:hover {
            background: rgba(255, 255, 255, 0.15);
        }

        .control-group-bottom .checkbox-label i {
            color: #4CAF50;
        }

.slider-container-bottom {
    flex: 1;
    min-width: 180px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.time-info-bottom {
    color: #fff;
    font-size: 12px;
    padding: 4px 10px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 6px;
    display: inline-block;
    align-self: flex-start;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

    .time-info-bottom i {
        margin-right: 6px;
        color: #4CAF50;
    }

.slider-wrapper {
    display: flex;
    align-items: center;
    gap: 15px;
    width: 100%;
}

#timeSlider {
    flex: 1;
    height: 6px;
    border-radius: 3px;
    background: linear-gradient(to right, #4CAF50, #45a049);
    outline: none;
    -webkit-appearance: none;
    appearance: none;
    min-width: 80px;
}

    #timeSlider::-webkit-slider-thumb {
        -webkit-appearance: none;
        appearance: none;
        width: 18px;
        height: 18px;
        border-radius: 50%;
        background: #4CAF50;
        cursor: pointer;
        border: 2px solid white;
        box-shadow: 0 2px 8px rgba(76, 175, 80, 0.4);
        transition: all 0.2s ease;
    }

        #timeSlider::-webkit-slider-thumb:hover {
            transform: scale(1.15);
            box-shadow: 0 4px 12px rgba(76, 175, 80, 0.6);
        }

    #timeSlider::-moz-range-thumb {
        width: 18px;
        height: 18px;
        border-radius: 50%;
        background: #4CAF50;
        cursor: pointer;
        border: 2px solid white;
    }

#sliderLabel {
    color: #fff;
    font-size: 12px;
    font-weight: bold;
    min-width: 70px;
    text-align: center;
    padding: 4px 10px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 130px;
}

/* Large Desktop Screens (1400px and above) */
@media (min-width: 1400px) {
    .controls-panel-bottom {
        width: 40%;
        max-width: calc(100% - 250px);
        min-width: 350px;
        padding: 14px 25px;
        bottom: 20px;
        left: 25px;
    }

    .control-group-bottom .btn-run,
    .control-group-bottom .btn-stop {
        padding: 10px 22px;
        font-size: 14px;
    }

    .slider-container-bottom {
        min-width: 250px;
    }

    #sliderLabel {
        min-width: 90px;
        font-size: 13px;
        max-width: 160px;
    }

    .time-info-bottom {
        font-size: 13px;
    }
}

/* Standard Desktop (1200px - 1399px) */
@media (min-width: 1200px) and (max-width: 1399px) {
    .controls-panel-bottom {
        width: 45%;
        max-width: calc(100% - 220px);
        min-width: 320px;
        padding: 12px 20px;
        bottom: 18px;
        left: 22px;
    }

    .control-group-bottom .btn-run,
    .control-group-bottom .btn-stop {
        padding: 8px 16px;
        font-size: 13px;
    }

    .slider-container-bottom {
        min-width: 200px;
    }

    #sliderLabel {
        min-width: 80px;
        max-width: 140px;
    }
}

/* Small Desktop / Large Tablet (992px - 1199px) */
@media (min-width: 992px) and (max-width: 1199px) {
    .controls-panel-bottom {
        width: 50%;
        max-width: calc(100% - 200px);
        min-width: 300px;
        padding: 10px 16px;
        bottom: 15px;
        left: 18px;
    }

    .control-group-bottom .btn-run,
    .control-group-bottom .btn-stop {
        padding: 7px 14px;
        font-size: 12px;
    }

    .control-group-bottom .checkbox-label {
        font-size: 12px;
        padding: 5px 10px;
    }

    .slider-container-bottom {
        min-width: 160px;
    }

    .time-info-bottom {
        font-size: 11px;
        padding: 3px 8px;
    }

    #sliderLabel {
        font-size: 11px;
        min-width: 60px;
        padding: 3px 8px;
        max-width: 110px;
    }

    #timeSlider {
        height: 5px;
        min-width: 70px;
    }
}

/* Tablet (768px - 991px) */
@media (min-width: 768px) and (max-width: 991px) {
    .controls-panel-bottom {
        width: 55%;
        max-width: calc(100% - 160px);
        min-width: 280px;
        padding: 10px 16px;
        bottom: 15px;
        left: 15px;
    }

    .control-group-bottom .btn-run,
    .control-group-bottom .btn-stop {
        padding: 6px 14px;
        font-size: 12px;
    }

    .control-group-bottom .checkbox-label {
        font-size: 11px;
        padding: 5px 10px;
    }

    .slider-container-bottom {
        min-width: 150px;
    }

    .time-info-bottom {
        font-size: 10px;
        padding: 3px 8px;
    }

    #sliderLabel {
        font-size: 10px;
        min-width: 55px;
        padding: 3px 8px;
        max-width: 100px;
    }

    #timeSlider {
        height: 5px;
        min-width: 60px;
    }
}

/* Mobile (max-width: 767px) */
@media (max-width: 767px) {
    .controls-panel-bottom {
        bottom: 10px;
        left: 10px;
        right: 10px;
        padding: 10px 15px;
        width: calc(100% - 20px);
        max-width: calc(100% - 20px);
        min-width: unset;
        border-radius: 12px;
    }

    .panel-content-bottom {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }

    .control-group-bottom {
        justify-content: center;
        gap: 8px;
        flex-wrap: wrap;
    }

        .control-group-bottom .btn-run,
        .control-group-bottom .btn-stop {
            padding: 6px 14px;
            font-size: 11px;
            flex: 1;
            text-align: center;
        }

        .control-group-bottom .checkbox-label {
            font-size: 11px;
            padding: 4px 10px;
        }

    .slider-container-bottom {
        min-width: unset;
        width: 100%;
    }

    .time-info-bottom {
        font-size: 10px;
        padding: 3px 8px;
        align-self: center;
        white-space: normal;
        word-break: break-word;
        text-align: center;
        width: 100%;
        max-width: 100%;
    }

    .slider-wrapper {
        gap: 10px;
        flex-wrap: nowrap;
    }

    #sliderLabel {
        font-size: 10px;
        min-width: 50px;
        padding: 2px 8px;
        max-width: 90px;
    }

    #timeSlider {
        height: 4px;
        min-width: 50px;
    }

        #timeSlider::-webkit-slider-thumb {
            width: 16px;
            height: 16px;
        }
}

/* Small Mobile (max-width: 480px) */
@media (max-width: 480px) {
    .controls-panel-bottom {
        bottom: 8px;
        left: 8px;
        right: 8px;
        padding: 8px 12px;
        width: calc(100% - 16px);
        max-width: calc(100% - 16px);
        border-radius: 10px;
    }

    .control-group-bottom {
        gap: 6px;
    }

        .control-group-bottom .btn-run,
        .control-group-bottom .btn-stop {
            padding: 5px 10px;
            font-size: 10px;
        }

        .control-group-bottom .checkbox-label {
            font-size: 10px;
            padding: 3px 8px;
        }

    .time-info-bottom {
        font-size: 9px;
        padding: 2px 6px;
    }

    #sliderLabel {
        font-size: 9px;
        min-width: 40px;
        padding: 2px 6px;
        max-width: 70px;
    }

    #timeSlider {
        height: 3px;
        min-width: 40px;
    }
}

/* Landscape Mode for Mobile */
@media (max-width: 767px) and (orientation: landscape) {
    .controls-panel-bottom {
        padding: 8px 14px;
        bottom: 8px;
    }

    .panel-content-bottom {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 6px;
    }

    .control-group-bottom {
        flex: 0 0 auto;
    }

    .slider-container-bottom {
        flex: 1;
        min-width: 120px;
    }

    .time-info-bottom {
        font-size: 9px;
        padding: 2px 6px;
        white-space: nowrap;
    }

    .slider-wrapper {
        gap: 8px;
    }

    #sliderLabel {
        font-size: 9px;
        min-width: 40px;
        padding: 2px 6px;
        max-width: 80px;
    }

    #timeSlider {
        min-width: 60px;
    }
}

/* Remove old controls-panel styles */
.controls-panel {
    display: none;
}


/* ============================================ */
/* POLYGON DRAW TOOL - RESPONSIVE               */
/* ============================================ */

/* Desktop - positioned below zoom controls */
.polygon-draw-tool-container {
    position: absolute !important;
    top: 80px !important;
    left: 10px !important;
    z-index: 1000 !important;
}

/* Mobile adjustments */
@media (max-width: 768px) {
    .polygon-draw-tool-container {
        top: 80px !important;
        left: 10px !important;
        transform: scale(0.85) !important;
        transform-origin: top left !important;
    }

        .polygon-draw-tool-container .polygon-tool-panel {
            min-width: 150px !important;
            padding: 8px !important;
        }

        .polygon-draw-tool-container .polygon-draw-btn,
        .polygon-draw-tool-container .polygon-clear-btn {
            padding: 5px 10px !important;
            font-size: 10px !important;
        }

        .polygon-draw-tool-container .polygon-download-btn {
            padding: 5px 10px !important;
            font-size: 10px !important;
        }

        .polygon-draw-tool-container .polygon-tool-expand-btn {
            width: 30px !important;
            height: 30px !important;
            font-size: 15px !important;
        }

            .polygon-draw-tool-container .polygon-tool-expand-btn i {
                font-size: 15px !important;
                line-height: 26px !important;
            }
}

@media (max-width: 480px) {
    .polygon-draw-tool-container {
        top: 70px !important;
        left: 10px !important;
        transform: scale(0.75) !important;
        transform-origin: top left !important;
    }

        .polygon-draw-tool-container .polygon-tool-panel {
            min-width: 130px !important;
            padding: 6px !important;
            gap: 5px !important;
        }

        .polygon-draw-tool-container .polygon-draw-btn,
        .polygon-draw-tool-container .polygon-clear-btn {
            padding: 4px 8px !important;
            font-size: 9px !important;
        }

        .polygon-draw-tool-container .polygon-download-btn {
            padding: 4px 8px !important;
            font-size: 9px !important;
        }

        .polygon-draw-tool-container .polygon-tool-expand-btn {
            width: 26px !important;
            height: 26px !important;
            font-size: 13px !important;
        }

            .polygon-draw-tool-container .polygon-tool-expand-btn i {
                font-size: 13px !important;
                line-height: 22px !important;
            }
}

/* Landscape mode for mobile */
@media (max-width: 768px) and (orientation: landscape) {
    .polygon-draw-tool-container {
        top: 60px !important;
        transform: scale(0.7) !important;
    }
}


/* ============================================ */
/* GRAPH SECTION LAYOUT ORDER                   */
/* ============================================ */

.graph-section {
    display: flex;
    flex-direction: column;
}

/* Order of elements in graph section */
.graph-header {
    order: 1;
}

.graph-content {
    order: 2;
}

/* WEATHER CARDS NOW FIRST (Order 3) */
.weather-cards-container {
    order: 3;
}

/* TIME AGGREGATION BUTTONS NOW SECOND (Order 4) */
.time-aggregation-buttons {
    order: 4;
}

/* Mobile adjustments */
@media (max-width: 768px) {
    .graph-section {
        display: flex;
        flex-direction: column;
    }

    .graph-header {
        order: 1;
        flex-shrink: 0;
    }

    .graph-content {
        order: 2;
        flex: 0 0 auto; /* Changed from flex:1 to auto */
        overflow-y: auto;
        max-height: 35vh; /* Limit height to leave room for other elements */
    }

    /* WEATHER CARDS NOW FIRST (Order 3) */
    .weather-cards-container {
        order: 3;
        flex-shrink: 0;
        margin: 4px 8px 8px 8px !important;
        padding: 8px 10px !important;
        max-height: 100px; /* Limit height */
        overflow: hidden; /* Prevent overflow */
    }

    /* TIME AGGREGATION BUTTONS NOW SECOND (Order 4) */
    .time-aggregation-buttons {
        order: 4;
        flex-shrink: 0;
        margin: 8px 10px !important;
        padding: 8px 10px !important;
    }
}

@media (max-width: 480px) {
    /* WEATHER CARDS NOW FIRST */
    .weather-cards-container {
        margin: 4px 6px 6px 6px !important;
        padding: 6px 8px !important;
    }

    /* TIME AGGREGATION BUTTONS NOW SECOND */
    .time-aggregation-buttons {
        margin: 2px 8px !important;
        padding: 2px 8px !important;
    }
}

/* ============================================ */
/* WEATHER CARDS - PARAMETER DISPLAY            */
/* ============================================ */

.weather-cards-container {
    background: rgba(30, 30, 40, 0.95);
    border-radius: 12px;
    margin: 10px 15px 10px 15px;
    padding: 12px 16px;
    border: 1px solid rgba(76, 175, 80, 0.2);
    backdrop-filter: blur(5px);
}

.weather-cards-grid {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 8px;
    margin-bottom: 8px;
}

.weather-card {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 8px 6px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.3s ease;
    min-height: 70px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

    .weather-card:hover {
        background: rgba(255, 255, 255, 0.08);
        border-color: rgba(76, 175, 80, 0.3);
        transform: translateY(-2px);
    }

    .weather-card .card-icon {
        font-size: 14px;
        color: #4CAF50;
        margin-bottom: 2px;
    }

    .weather-card .card-value {
        font-size: 18px;
        font-weight: bold;
        color: #fff;
        line-height: 1.2;
    }

    .weather-card .card-label {
        font-size: 9px;
        color: #888;
        text-transform: uppercase;
        letter-spacing: 0.5px;
        margin-top: 2px;
    }

    .weather-card .card-unit {
        font-size: 8px;
        color: #666;
        margin-top: 1px;
    }

    /* Color coding for different parameters */
    .weather-card[data-param="rainfall"] .card-icon {
        color: #42a5f5;
    }

    .weather-card[data-param="tmax"] .card-icon {
        color: #f44336;
    }

    .weather-card[data-param="tmin"] .card-icon {
        color: #2196f3;
    }

    .weather-card[data-param="tavg"] .card-icon {
        color: #4caf50;
    }

    .weather-card[data-param="humidity"] .card-icon {
        color: #00bcd4;
    }

    .weather-card[data-param="cloud"] .card-icon {
        color: #9c27b0;
    }

    .weather-card[data-param="windspeed"] .card-icon {
        color: #ff9800;
    }

    .weather-card[data-param="winddirection"] .card-icon {
        color: #e91e63;
    }

.weather-cards-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    font-size: 11px;
    color: #ccc;
    flex-wrap: wrap;
    gap: 5px;
}

    .weather-cards-footer i {
        margin-right: 5px;
        color: #4CAF50;
    }

#cardLocationName {
    color: #4CAF50;
    font-weight: 500;
}

#cardForecastTime {
    color: #888;
    font-size: 10px;
}

/* ============================================ */
/* WEATHER CARDS - RESPONSIVE                   */
/* ============================================ */

/* Large Desktop (1400px+) */
@media (min-width: 1400px) {
    .weather-cards-grid {
        grid-template-columns: repeat(8, 1fr);
        gap: 10px;
    }

    .weather-card {
        padding: 10px 8px;
        min-height: 80px;
    }

        .weather-card .card-value {
            font-size: 20px;
        }

        .weather-card .card-label {
            font-size: 10px;
        }
}

/* Standard Desktop (1200px - 1399px) */
@media (min-width: 1200px) and (max-width: 1399px) {
    .weather-cards-grid {
        grid-template-columns: repeat(8, 1fr);
        gap: 8px;
    }

    .weather-card {
        padding: 8px 5px;
        min-height: 70px;
    }

        .weather-card .card-value {
            font-size: 17px;
        }
}

/* Small Desktop / Large Tablet (992px - 1199px) */
@media (min-width: 992px) and (max-width: 1199px) {
    .weather-cards-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 8px;
    }

    .weather-card {
        padding: 8px 6px;
        min-height: 65px;
    }

        .weather-card .card-value {
            font-size: 16px;
        }
}

/* Tablet (768px - 991px) */
@media (min-width: 768px) and (max-width: 991px) {
    .weather-cards-container {
        margin: 8px 10px;
        padding: 10px 12px;
    }

    .weather-cards-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 6px;
    }

    .weather-card {
        padding: 6px 4px;
        min-height: 60px;
    }

        .weather-card .card-value {
            font-size: 15px;
        }

        .weather-card .card-label {
            font-size: 8px;
        }

        .weather-card .card-icon {
            font-size: 12px;
        }

    .weather-cards-footer {
        font-size: 10px;
    }
}

/* Mobile (max-width: 767px) */
@media (max-width: 767px) {
    .weather-cards-container {
        margin: 4px 6px;
        padding: 6px 8px;
        border-radius: 8px;
        order: 3; /* Keep before time aggregation */
    }

    .weather-cards-grid {
        grid-template-columns: repeat(8, 1fr);
        gap: 3px;
        margin-bottom: 4px;
    }

    .weather-card {
        padding: 3px 2px;
        min-height: 45px;
        border-radius: 4px;
    }

        .weather-card .card-value {
            font-size: 11px;
        }

        .weather-card .card-label {
            font-size: 6px;
            letter-spacing: 0.2px;
            margin-top: 1px;
        }

        .weather-card .card-unit {
            font-size: 6px;
            margin-top: 0px;
        }

        .weather-card .card-icon {
            font-size: 10px;
            margin-bottom: 1px;
        }

    .weather-cards-footer {
        font-size: 8px;
        padding-top: 4px;
        flex-direction: row;
        align-items: center;
        flex-wrap: wrap;
        gap: 3px;
    }

    #cardLocationName {
        font-size: 9px;
    }

    #cardForecastTime {
        font-size: 8px;
    }
}

/* Small Mobile (max-width: 480px) */
@media (max-width: 480px) {
    .weather-cards-container {
        margin: 0px 4px;
        padding: 0px 6px;
        border-radius: 6px;
        order: 3; /* Keep before time aggregation */
    }

    .weather-cards-grid {
        grid-template-columns: repeat(8, 1fr);
        gap: 2px;
        margin-bottom: 3px;
    }

    .weather-card {
        padding: 2px 1px;
        min-height: 38px;
        border-radius: 3px;
        border-width: 0.5px;
    }

        .weather-card .card-value {
            font-size: 10px;
            line-height: 1.1;
        }

        .weather-card .card-label {
            font-size: 5px;
            letter-spacing: 0px;
            margin-top: 0px;
        }

        .weather-card .card-unit {
            font-size: 5px;
            margin-top: 0px;
            display: none; /* Hide unit on very small screens */
        }

        .weather-card .card-icon {
            font-size: 8px;
            margin-bottom: 0px;
        }

    .weather-cards-footer {
        font-size: 7px;
        padding-top: 3px;
        flex-direction: column;
        align-items: flex-start;
        gap: 2px;
    }

    #cardLocationName {
        font-size: 8px;
    }

    #cardForecastTime {
        font-size: 7px;
    }
}

/* Landscape Mode for Mobile */
@media (max-width: 768px) and (orientation: landscape) {
    .weather-cards-grid {
        grid-template-columns: repeat(8, 1fr);
        gap: 3px;
    }

    .weather-card {
        min-height: 38px;
        padding: 3px 2px;
    }

        .weather-card .card-value {
            font-size: 10px;
        }

        .weather-card .card-label {
            font-size: 5px;
        }

        .weather-card .card-icon {
            font-size: 8px;
        }

    .weather-cards-container {
        margin: 0px 6px;
        padding: 0px 6px;
    }
}

/* Add this to your StyleSheet.css */
@media (max-width: 768px) {
    .leaflet-popup {
        display: none !important;
    }
}


