/* Global Reset */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* CSS Variables */
:root {
    /* Light mode colors */
    --light-bg: #f8f9fa;
    --light-text: #333;
    --light-secondary-text: #64748b;
    --light-border: #eaeaea;
    --light-hover-bg: #f1f5f9;
    --light-card-bg: white;
    
    /* Error colors */
    --error-bg: #ffdddd;
    --error-text: #d32f2f;

    /* Dark mode colors */
    --dark-bg: #1a1a1a;
    --dark-text: #e0e0e0;
    --dark-secondary-text: #a0a0a0;
    --dark-border: #2a2a2a;
    --dark-hover-bg: #2c2c2c;
    --dark-card-bg: #242424;
    --dark-error-bg: #3a2222;
    --dark-error-text: #ff5252;

    /* Return to Home Button */
.return-to-home-container {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1000;
    pointer-events: auto;
    opacity: 0; /* Start hidden */
    transition: opacity 1.5s ease-in-out;
    will-change: opacity;
}

.return-to-home-container.visible {
    opacity: 1;
}

.return-to-home {
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 50px;
    padding: 15px 30px;
    font-size: 1.2rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    pointer-events: auto;
    min-width: 180px;
}

.return-to-home:hover {
    background: #1d4ed8;
    transform: scale(1.05);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2);
}

.return-to-home i {
    font-size: 1.3rem;
    transition: transform 0.3s ease;
}

.return-to-home:hover i {
    transform: scale(1.1);
}

/* Other variables */
    --sidebar-width: 215px;
    --sidebar-width-collapsed: 80px;
    --primary-color: #2563eb;
    --card-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    --bottom-navbar-height: 80px;

    /* New Variables for Minimum Card Widths */
    --min-small-card-width: 125px;
    --max-small-card-width: 200px;
    --min-medium-card-width: 300px;

    /* Responsive Font Size Variables */
    --min-font-size: 12px;
    --preferred-font-size: 2.5vw;
    --max-font-size: 16px;

    /* Responsive Card Header Font Size Variables */
    --min-card-header-font-size: 12px;
    --preferred-card-header-font-size: 3vw;
    --max-card-header-font-size: 16px;

    /* Responsive Card Value Font Size Variables */
    --min-card-value-font-size: 12px;
    --preferred-card-value-font-size: 2vw;
    --max-card-value-font-size: 16px;

    /* Card Height Variables */
    --min-small-card-height: 150px;
    --max-small-card-height: 100%;

    --min-medium-card-height: 200px;
    --max-medium-card-height: 600px;

    --min-large-card-height: 500px;
    --max-large-card-height: 1000px;
}

/* Base Styling */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--light-bg);
    color: var(--light-text);
    min-height: 100vh;
    overflow-x: hidden;
    justify-content: center;
    transition: background-color 0.3s, color 0.3s;
}

body.dark-mode {
    background: var(--dark-bg);
    color: var(--dark-text);
}

.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #ffffff;
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}


body.dark-mode .loading-screen {
    background-color: var(--dark-bg);
    color: var(--dark-text);
}

.loader-container {
    text-align: center;
}

.spinner {
    width: 70px;
    height: 70px;
    margin: 0 auto 20px;
    border: 6px solid #f3f3f3;
    border-top: 6px var(--primary-color) solid;
    border-radius: 50%;
    animation: spin 1.5s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.button--loading {
    position: relative;
    color: transparent;
}

.button--loading::after {
    content: "";
    position: absolute;
    width: 16px;
    height: 16px;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    margin: auto;
    border: 3px solid transparent;
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: button-loading-spinner 1s linear infinite;
}

@keyframes button-loading-spinner {
    from {
        transform: rotate(0turn);
    }
    to {
        transform: rotate(1turn);
    }
}

.terminal-container {
    margin: 20px 0;
    border-radius: 6px;
    overflow: hidden;
}

.terminal-header {
    background-color: #333;
    color: white;
    padding: 8px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.terminal-controls {
    display: flex;
    gap: 8px;
}

.terminal-control {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.terminal-close {
    background-color: #ff5f56;
}

.terminal-minimize {
    background-color: #ffbd2e;
}

.terminal-maximize {
    background-color: #27c93f;
}

.terminal-title {
    font-family: monospace;
    font-size: 14px;
}

.terminal-output {
    background-color: #000;
    color: #ddd;
    padding: 15px;
    font-family: monospace;
    white-space: pre-wrap;
    overflow-y: auto;
    max-height: 300px;
    line-height: 1.5;
}

.terminal-output .command {
    color: var(--primary-color);
}

.terminal-output .error {
    color: #ff5f56;
}


/* Layout Containers */
.dashboard-container {
    display: flex;
    min-height: 100vh;
    position: relative;
}

/* Sidebar Styles */
.sidebar {
    width: var(--sidebar-width);
    background: var(--light-card-bg);
    padding: 20px 0;
    border-right: 1px solid var(--light-border);
    position: fixed;
    height: 100vh;
    transition: all .75s ease;
    z-index: 1000;
    padding-top: 25px;
}

body.dark-mode .sidebar {
    background: var(--dark-card-bg);
    border-right: 1px solid var(--dark-border);
}

/* Logo Styles */
.sidebar-logo {
    display: flex;
    align-items: center;
    padding: 10px 20px;
    margin-bottom: 38px;
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--primary-color);
    justify-items: center;
}

.sidebar-logo i {
    margin-right: 12px;
    font-size: 1.2rem;
}

/* Navigation Items */
.nav-item {
    display: flex;
    align-items: left;
    padding: 12px 20px;
    margin: 5px 0;
    color: var(--light-secondary-text);
    text-decoration: none;
    transition: all 0.2s ease;
    cursor: pointer;
}

.hourly-table {
    width: 100%;
    border-collapse: collapse;
}
.hourly-table th, .hourly-table td {
    padding: 8px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

body.dark-mode .nav-item {
    color: var(--dark-secondary-text);
}

.nav-item:hover,
.nav-item.active {
    background: var(--light-hover-bg);
    color: var(--primary-color);
    font-weight: 600;
}

body.dark-mode .nav-item:hover,
body.dark-mode .nav-item.active {
    background: var(--dark-hover-bg);
}

.nav-item i {
    width: 24px;
    margin-right: 12px;
    font-size: 1.2rem;
    text-align: center;
}

.nav-item span {
    font-size: 1rem;
}

/* Main Content Area */
.main-content {
    margin-left: var(--sidebar-width);
    width: calc(100% - var(--sidebar-width));
    transition: all 0.3s ease;
}

.conditions-overview {
    font-size: 0.9rem;
    font-weight: 500;
    color: #333;
}

.table-responsive {
    overflow-x: auto;
    max-height: 300px;
    overflow-y: auto;
}

.table-responsive table {
    width: 100%;
    border-collapse: collapse;
}

.table-responsive th,
.table-responsive td {
    padding: 8px;
    border: 1px solid #ddd;
    font-size: 0.85rem;
}

.table-responsive th {
    background-color: #f5f5f5;
    position: sticky;
    top: 0;
}

.sticky-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: all 0.3s ease-in-out;
}

.sticky-header .dashboard-header {
    background: var(--light-card-bg);
    padding: 20px;
    transition: all 0.3s ease-in-out;
}

body.dark-mode .sticky-header .dashboard-header {
    background: var(--dark-card-bg);
}

.sticky-header .dashboard-header h1 {
    font-size: 2rem;
    color: var(--light-text);
    font-weight: 1000;
    transition: all 0.3s ease-in-out;
}

body.dark-mode .sticky-header .dashboard-header h1 {
    color: var(--dark-text);
}

.sticky-header .date-display {
    color: var(--light-secondary-text);
    font-size: 1rem;
    margin-top: 10px;
    transition: all 0.3s ease-in-out;
}

body.dark-mode .sticky-header .date-display {
    color: var(--dark-secondary-text);
}

.sticky-header.scrolled .dashboard-header {
    padding: 20px;
}

.sticky-header.scrolled .dashboard-header h1 {
    font-size: 1rem;
}

.sticky-header.scrolled .date-display {
    font-size: .5rem;
    margin-top: 5px;
}

/* Dashboard Header */
.dashboard-header {
    background: var(--light-card-bg);
    padding: 20px 20px;
}

body.dark-mode .dashboard-header {
    background: var(--dark-card-bg);
}

.dashboard-header h1 {
    font-size: 2rem;
    color: var(--light-text);
    font-weight: 1000;
}

body.dark-mode .dashboard-header h1 {
    color: var(--dark-text);
}

.section-header {
    background: var(--light-card-bg);
    padding: 24px;
    margin-bottom: 14px;
    color: var(--light-text);
    font-size: 1.5rem;
    font-weight: bold;
    text-align: center;
}

body.dark-mode .section-header {
    background: var(--dark-card-bg);
    color: var(--dark-text);
}

.date-display {
    color: var(--light-secondary-text);
    font-size: 1.25rem;
    margin-top: 10px;
}

body.dark-mode .date-display {
    color: var(--dark-secondary-text);
}

/* Cards Grid */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin: 20px;
    margin-bottom: 24px;
    width: calc(100% - 40px);
}

/* Base Card Styles */
.card {
    background: var(--light-card-bg);
    border-radius: 12px;
    box-shadow: var(--card-shadow);
    border: 1px solid var(--light-border);
    padding: 15px;
    font-size: clamp(var(--min-font-size), var(--preferred-font-size), var(--max-font-size));
    overflow-wrap: break-word;
    display: flex;
    flex-direction: column;
}

body.dark-mode .card {
    background: var(--dark-card-bg);
    border: 1px solid var(--dark-border);
}

.card.clickable {
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card.clickable:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.card-header {
    color: var(--light-secondary-text);
    font-size: clamp(var(--min-card-header-font-size), var(--preferred-card-header-font-size), var(--max-card-header-font-size));
    font-weight: 600;
    margin-bottom: 16px;
    overflow-wrap: break-word;
}

body.dark-mode .card-header {
    color: var(--dark-secondary-text);
}

.sidebar-spacer {
    flex-grow: 1;
}

#theme-toggle {
    margin-top: auto;
}

.card-value {
    font-size: 24px; /* Fixed size for consistency */
    font-weight: 700;
    color: var(--light-text);
    line-height: 1.3;
    overflow-wrap: break-word;
    flex-grow: 1;
    display: flex;
    align-items: center;
}

body.dark-mode .card-value {
    color: var(--dark-text);
}

/* Current Conditions Cards */
.current-conditions {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    justify-content: center;
    margin: 20px 0;
}

.condition-card {
    background: var(--light-card-bg);
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    min-width: 120px;
    flex: 1 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: var(--card-shadow);
    border: 1px solid var(--light-border);
}

body.dark-mode .condition-card {
    background: var(--dark-card-bg);
    border-color: var(--dark-border);
}

.condition-card i {
    font-size: 1.5rem;
    margin-bottom: 10px;
    color: var(--light-secondary-text);
}

body.dark-mode .condition-card i {
    color: var(--dark-secondary-text);
}

.condition-value {
    font-size: 1.5rem !important; /* Important to override any inline styles */
    font-weight: 600;
    color: var(--light-text);
    margin: 5px 0;
    line-height: 1.2;
}

body.dark-mode .condition-value {
    color: var(--dark-text);
}

.condition-label {
    font-size: 0.9rem;
    color: var(--light-secondary-text);
    margin-top: 5px;
}

body.dark-mode .condition-label {
    color: var(--dark-secondary-text);
}

/* Card Justification */
.cards-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 24px;
    padding-top: 20px;
    padding-bottom: 20px;
    padding-left: 10px;
    padding-right: 10px;
    justify-content: center;
}

.cards-grid .card:nth-child(1) {
    justify-self: auto;
}

.cards-grid .card:nth-child(2) {
    justify-self: auto;
}

.cards-grid .card:nth-child(3) {
    justify-self: auto;
}

/* Card Sizing */
.card {
    aspect-ratio: 1/1; /* Make cards square by default */
    min-height: 200px;
    max-height: 400px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

/* Small Cards */
.card.small-card {
    min-width: 200px;
    max-width: 300px;
    aspect-ratio: 1/1;
}

/* Medium Cards */
.card.medium-card {
    min-width: 300px;
    aspect-ratio: 16/9; /* Wider aspect ratio for medium cards */
}

/* Large Cards */
.card.large-card {
    grid-column: 1 / -1; /* Make large cards span full width */
    aspect-ratio: 16/9;
    min-height: 400px;
}

/* Windrose Container */
.wind-rose-container {
    position: relative;
    width: 100%;
    aspect-ratio: 1/1; /* Ensure windrose is always square */
    min-height: 200px;
    max-height: 400px;
    margin: 0 auto;
}

/* Chart Container */
.chart-container {
    background: var(--light-card-bg);
    border-radius: 12px;
    height: 400px;
    position: relative;
    width: 100%;
}

body.dark-mode .chart-container {
    background: var(--dark-card-bg);
}

.chart-container h2 {
    margin-bottom: 16px;
    font-size: 1.1rem;
    color: var(--light-secondary-text);
}

body.dark-mode .chart-container h2 {
    color: var(--dark-secondary-text);
}

.thermometer-container {
    position: relative;
    width: 15px;
    height: 50px;
    background-color: #ddd;
    border-radius: 25px;
    overflow: hidden;
    border: 2px solid black;
    margin: 10%;
}

body.dark-mode .thermometer-container {
    border: 2px solid white;
    margin: 10%;
    position: relative;
    width: 15px;
    height: 50px;
    background-color: #ddd;
    border-radius: 25px;
    overflow: hidden;
}

.thermometer-fill {
    position: absolute;
    bottom: 0;
    width: 100%;
    height: 0%;
    background-color: red;
    transition: height 2s ease-in-out;
}

.temperature-label {
    margin-top: 10px;
    font-size: 16px;
    text-align: center;
}

/* Landing Page Form */
.landing-form {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
    background: var(--light-card-bg);
    text-align: center;
}

body.dark-mode .landing-form {
    background: var(--dark-card-bg);
}

.landing-form h1 {
    margin-bottom: 24px;
    font-size: 1.75rem;
    color: var(--light-text);
}

body.dark-mode .landing-form h1 {
    color: var(--dark-text);
}

.landing-form input[type="text"] {
    width: 300px;
    padding: 12px;
    margin: 10px 0;
    border: 1px solid var(--light-border);
    border-radius: 8px;
    font-size: 1rem;
    background-color: var(--light-bg);
    color: var(--light-text);
}

body.dark-mode .landing-form input[type="text"] {
    border: 1px solid var(--dark-border);
    background-color: var(--dark-bg);
    color: var(--dark-text);
}

.landing-form input[type="submit"] {
    width: 300px;
    padding: 12px 24px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    transition: background 0.2s ease;
    margin-top: 10px;
}

.landing-form input[type="submit"]:hover {
    background: #1d4ed8;
}

/* New Error Form Styling */
.error-form {
    background-color: var(--error-bg);
    border-radius: 12px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

body.dark-mode .error-form {
    background-color: var(--dark-error-bg);
}

.error-form h1 {
    color: var(--error-text);
    margin-bottom: 20px;
}

body.dark-mode .error-form h1 {
    color: var(--dark-error-text);
}

.error-form p {
    margin-bottom: 20px;
    font-size: 16px;
    line-height: 1.5;
    color: var(--light-text);
}

body.dark-mode .error-form p {
    color: var(--dark-text);
}

.error-form strong {
    font-weight: bold;
    color: var(--error-text);
}

body.dark-mode .error-form strong {
    color: var(--dark-error-text);
}

.form-container {
    background: var(--light-card-bg);
    padding: 30px;
    border-radius: 12px;
    box-shadow: var(--card-shadow);
    text-align: center;
}

body.dark-mode .form-container {
    background: var(--dark-card-bg);
}

.landing-form input[type="text"]::placeholder {
    color: #aaa;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .sidebar {
        display: none;
        padding-top: 24px;
    }

    .main-content {
        margin-left: 0;
        width: 100%;
    }

    .bottom-navbar {
        display: flex;
    }

    .card.small-card {
        width: calc(50% - 10px);
    }

    .card.medium-card {
        width: 100%;
        min-width: auto;
        max-width: none;
        min-height: auto;
        max-height: none;
    }

    .card.large-card {
        min-height: auto;
        max-height: 400px;
        width: 100%;
    }

    .card-value {
        font-size: 24px !important; /* Fixed size for consistency */
    }

    .map-container,
    .forecast-carousel {
        height: 300px;
    }
}

/* Tablet and Desktop - Matching Small Card Behavior */
@media (min-width: 769px) {
    .card.medium-card {
        width: calc(50% - 10px);
    }
}

/* Bottom Navigation Bar */
.bottom-navbar {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: var(--bottom-navbar-height);
    background: var(--light-card-bg);
    border-top: 1px solid var(--light-border);
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    z-index: 1000;
}

body.dark-mode .bottom-navbar {
    background: var(--dark-card-bg);
    border-top: 1px solid var(--dark-border);
}

.bottom-navbar .nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 8px 0;
    color: var(--light-secondary-text);
    transition: color 0.2s ease;
}

body.dark-mode .bottom-navbar .nav-item {
    color: var(--dark-secondary-text);
}

.bottom-navbar .nav-item.active {
    color: var(--primary-color);
    position: relative;
}

.bottom-navbar .nav-item.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 32px;
    height: 3px;
    background-color: var(--primary-color);
    border-radius: 2px;
}

/* Map Container */
.map-container {
    width: 100%;
    height: 500px;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 24px;
}

/* Surface Map Card Styling */
.surface-map-card {
    border: 1px solid var(--light-border);
    background-color: var(--light-card-bg);
    border-radius: 12px;
    box-shadow: var(--card-shadow);
    overflow: hidden;
}

body.dark-mode .surface-map-card {
    border: 1px solid var(--dark-border);
    background-color: var(--dark-card-bg);
}

.surface-map-card .responsive-iframe {
    width: 100%;
    height: 100%;
    border: none;
}

/* Forecast Carousel */
.forecast-carousel {
    position: relative;
    width: 100%;
    height: 500px;
    overflow: hidden;
}

.forecast-carousel .map-slide {
    position: absolute;
    top: 0;
    left: 0;
}

.tab-content {
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
    width: 100%;
    height: 0;
    overflow: hidden;
}

.tab-content.active {
    display: block;
    opacity: 1;
    height: auto;
    overflow: visible;
    padding: 0;
}

/* Add bottom padding for mobile to account for bottom navbar */
@media (max-width: 768px) {
    .tab-content.active {
        padding-bottom: 80px;
        box-sizing: border-box;
    }
}

.forecast-carousel .map-slide.active {
    opacity: 1;
}

.forecast-carousel .navigation {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    justify-content: center;
    z-index: 10;
}

.forecast-carousel .navigation button {
    background-color: var(--primary-color);
    color: #fff;
    border: none;
    padding: 8px 16px;
    margin: 0 5px;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.3s ease;
}

.forecast-carousel .navigation button:hover {
    background-color: #1d4ed8;
}

/* Autocomplete Styling */
.autocomplete-wrapper {
    position: relative;
    width: 100%;
    margin-bottom: 15px;
}

#station-input {
    width: 100%;
    padding: 10px 40px 10px 10px; /* Add right padding to prevent text from being hidden behind the loading indicator */
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
    box-sizing: border-box; /* Ensure padding is included in the width */
}

.airport-results-dropdown {
    display: none;
    position: absolute;
    width: 100%;
    max-height: 300px;
    overflow-y: auto;
    background: white;
    border: 1px solid #ddd;
    border-top: none;
    border-radius: 0 0 4px 4px;
    z-index: 1000;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

body.dark-mode .airport-results-dropdown {
    background: var(--dark-card-bg);
    border: 1px solid var(--dark-border);
}

.airport-item {
    padding: 10px;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
}

.airport-item strong {
    color: #000; /* Black in light mode */
}

body.dark-mode .airport-item {
    border-bottom: 1px solid var(--dark-border);
}

body.dark-mode .airport-item strong {
    color: #fff; /* White in dark mode */
}

.airport-item:hover {
    background-color: #f7f7f7;
}

body.dark-mode .airport-item:hover {
    background-color: var(--dark-hover-bg);
}

.airport-location {
    display: block;
    font-size: 0.85em;
    color: #666;
    margin-top: 2px;
}

body.dark-mode .airport-location {
    color: var(--dark-secondary-text);
}

/* Text Annotation Popup Styles */
.text-annotation-popup {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    padding: 12px;
    max-width: 280px;
}

.text-annotation-popup p {
    margin-bottom: 10px;
    line-height: 1.4;
    color: var(--light-text);
}

.text-annotation-popup strong {
    color: var(--primary-color);
    font-weight: 600;
}

.text-annotation-popup .delete-text-btn {
    display: block;
    width: 100%;
    margin-top: 12px;
    padding: 6px 12px;
    background-color: #dc3545;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.2s ease;
}

.text-annotation-popup .delete-text-btn:hover {
    background-color: #c82333;
}

/* Dark mode styles for popup */
.dark-mode .text-annotation-popup {
    background-color: var(--dark-card-bg);
    color: var(--dark-text);
}

.dark-mode .text-annotation-popup p {
    color: var(--dark-text);
}

/* Responsive Breakpoints */
@media (min-width: 1025px) {
    .sidebar {
        display: block;
    }

    .bottom-navbar {
        display: none;
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    .sidebar {
        width: var(--sidebar-width-collapsed);
        padding-left: 0px;
        padding-top: 107px;
    }

    .sidebar-logo {
        justify-content: center;
        padding-left: 12px;
        display: none;
    }

    .sidebar .nav-item span {
        display: none;
    }

    .sidebar .nav-item {
        justify-content: center;
        margin: 0;
    }

    .sidebar .nav-item i {
        margin: 0;
    }

    .main-content {
        margin-left: var(--sidebar-width-collapsed);
        width: calc(100% - var(--sidebar-width-collapsed));
        justify-content: center;
    }

    .bottom-navbar {
        display: none;
    }

    /* Ensure the sidebar-logo is visible on the landing page for medium screens */
    .landing-form .sidebar-logo {
        display: flex;
    }
}

@media (max-width: 768px) {
    .sidebar {
        display: none;
    }
    .main-content {
        margin-left: 0;
        width: 100%;
        padding-bottom: calc(var(--bottom-navbar-height));
        justify-content: center;
    }

    .bottom-navbar,
    .bottom-navbar i {
        display: flex;
        justify-content: center;
        align-content: center;
        padding-left: 10px;
    }

    .map-container,
    .forecast-carousel {
        height: 300px;
    }
    .nav-item {
        padding: 0;
        margin: 0;
    }

    /* Reduce header size on mobile */
    .sticky-header .dashboard-header {
        padding: 10px 15px;
    }

    .sticky-header .dashboard-header h1 {
        font-size: 1.3rem;
        line-height: 1.2;
    }

    .sticky-header .date-display {
        font-size: 0.8rem;
        margin-top: 5px;
    }

    .sticky-header.scrolled .dashboard-header h1 {
        font-size: 0.9rem;
    }

    .sticky-header.scrolled .date-display {
        font-size: 0.7rem;
    }
}
