:root {    
    --sky-clear-top: #e6f7ff;
    --sky-clear-bottom: #a8d0f0;
    --sky-cloudy-top: #cacaca;
    --sky-cloudy-bottom: #70a0c7;
    --sky-rainy-top: #7a7f8d;
    --sky-rainy-bottom: #cacaca;
    --sky-storm-top: #c9d6e2;
    --sky-storm-bottom: #7b8a9a;
    --sky-snow-top: #f0f5fb;
    --sky-snow-bottom: #d8dfe6;
}

body.dark-mode {
    --sky-clear-top: #0a1020;
    --sky-clear-bottom: #441a45;
    --sky-cloudy-top: #262729;
    --sky-cloudy-bottom: #142236;
    --sky-rainy-top: #2a3040;
    --sky-rainy-bottom: #262729;
    --sky-storm-top: #080e18;
    --sky-storm-bottom: #292b2e;
    --sky-snow-top: #3e3e3b;
    --sky-snow-bottom: #706e6b;
}

/* Sat Weather Switch Elements */
.weather-switch-container {
    display: flex;
    justify-content: flex-start;
    margin: 20px 0;
}

.weather-switch {
    display: flex;
    background-color: var(--button-bg);
    border-radius: var(--button-radius);
    padding: 4px;
    gap: 4px;
    position: relative;
    width: 100%;
    max-width: 420px;
}

.weather-switch button {
    flex: 1;
    padding: 16px 24px;
    border: none;
    border-radius: calc(var(--button-radius) - 4px);
    background: transparent;
    color: var(--text-color);
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    font-size: 16pt;
    font-weight: 600;
    position: relative;
    z-index: 1;
    transition: color 0.3s ease;
}

.weather-switch button.active {
    color: var(--button-text);
}

.weather-switch::after {
    content: '';
    position: absolute;
    top: 4px;
    left: 4px;
    bottom: 4px;
    width: calc((100% - 8px) / 3);
    background-color: var(--weather-switch-slider);
    border-radius: calc(var(--button-radius) - 4px);
    transform: translateX(calc(var(--slider-position) * 100%));
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.weather-image {
    width: 100%;
    max-width: 1250px;
    opacity: 0;
    display: none;
    border-radius: var(--button-radius);
    transition: opacity 0.3s ease;
}

.weather-image.active {
    display: block;
    opacity: 1;
}

/* Weather Forecast */
.forecast-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 11px;
    margin: 1px 0;
    max-width: 1100px;
}

/* Loading skeleton for forecast panels */
@keyframes forecastLoading {
    0% { background-position: -200px 0; }
    100% { background-position: calc(200px + 100%) 0; }
}

.forecast-container.loading .forecast-day {
    background: #e0e0e0;
    background-image: linear-gradient(90deg, #e0e0e0 0, #f5f5f5 40px, #e0e0e0 80px);
    background-size: 200px 100%;
    animation: forecastLoading 1.5s infinite linear;
}

.forecast-container.loading .forecast-date,
.forecast-container.loading .forecast-temp,
.forecast-container.loading .forecast-desc {
    color: #999;
}

.forecast-container.loading .forecast-icon {
    filter: grayscale(100%);
    opacity: 0.3;
}

.forecast-container.loading .forecast-alert {
    display: none;
}

.forecast-day {
    border-radius: var(--button-radius);
    padding-top: 7px;
    padding-bottom: 11px;
    text-align: center;
    position: relative;
    min-width: 85px;
    max-width: 175px;
    overflow: hidden;
}

.hourly-segments {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    pointer-events: none;
    z-index: 0;
}

.hourly-segment {
    flex: 1;
    height: 100%;
    opacity: 0.75;
}

.hourly-segment:first-child {
    margin-left: 0;
}

/* Ensure forecast content is above the hourly segments */
.forecast-date,
.forecast-icon,
.forecast-temp,
.forecast-desc,
.forecast-alert {
    position: relative;
    z-index: 1;
}

/* Weather condition gradients - shared by all forecast elements */
.forecast-day.clear,
.hourly-item.clear,
.hourly-segment.clear {
    background: linear-gradient(to bottom, var(--sky-clear-top), var(--sky-clear-bottom));
}

.forecast-day.clouds,
.hourly-item.clouds,
.hourly-segment.clouds {
    background: linear-gradient(to bottom, var(--sky-cloudy-top), var(--sky-cloudy-bottom));
}

.forecast-day.rain,
.hourly-item.rain,
.hourly-segment.rain {
    background: linear-gradient(to bottom, var(--sky-rainy-top), var(--sky-rainy-bottom));
}

.forecast-day.storm,
.forecast-day.thunderstorm,
.hourly-item.storm,
.hourly-item.thunderstorm,
.hourly-segment.storm,
.hourly-segment.thunderstorm {
    background: linear-gradient(to bottom, var(--sky-storm-top), var(--sky-storm-bottom));
}

.forecast-day.snow,
.hourly-item.snow,
.hourly-segment.snow {
    background: linear-gradient(to bottom, var(--sky-snow-top), var(--sky-snow-bottom));
}

.hourly-avail {
    cursor: pointer;
}

#minutely-precip-container {
    max-width: 1100px;
}

#minutely-precip-chart {
    display: flex;
    justify-content: center;
    max-height: 320px;
    margin: 0 11pt;
}

/* Icon filters for dark mode */
body.dark-mode .forecast-day.snow img.forecast-icon,
body.dark-mode .forecast-day.clear img.forecast-icon,
body.dark-mode .forecast-day.rain img.forecast-icon {
    filter: invert(1) grayscale(1);
}

.forecast-alert {
    position: absolute;
    top: 5px;
    left: 7px;
}

.forecast-date {
    font-size: 10pt;
    font-weight: 650;
    /* margin-bottom: 8px; */
    /* text-transform: uppercase; */
    color: var(--button-text);
    text-shadow: 0 0 8px rgba(255, 255, 255, 0.8), 0 0 16px rgba(255, 255, 255, 0.6);
}

body.dark-mode .forecast-date {
    text-shadow: 0 0 8px rgba(0, 0, 0, 0.8), 0 0 16px rgba(0, 0, 0, 0.6);
}

.forecast-icon {
    width: 64px;
    height: 64px;
    margin: 9px;
}

.forecast-temp {
    font-size: 14pt;
    font-weight: 750;
    /* margin: 8px 0; */
    color: var(--button-text);
    text-shadow: 0 0 8px rgba(255, 255, 255, 0.8), 0 0 16px rgba(255, 255, 255, 0.6);
}

body.dark-mode .forecast-temp {
    text-shadow: 0 0 8px rgba(0, 0, 0, 0.8), 0 0 16px rgba(0, 0, 0, 0.6);
}

.forecast-desc {
    font-family: "Inter", sans-serif;
    font-size: 13pt;
    font-style: italic;
    font-weight: 500;
    color: var(--button-text);
    text-shadow: 0 0 8px rgba(255, 255, 255, 0.8), 0 0 16px rgba(255, 255, 255, 0.6);
}

body.dark-mode .forecast-desc {
    text-shadow: 0 0 8px rgba(0, 0, 0, 0.8), 0 0 16px rgba(0, 0, 0, 0.6);
}

.forecast-popup {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: var(--active-section-bg);
    border-radius: var(--button-radius);
    padding: 20px;
    z-index: 1000;
    max-width: 90%;
    width: 90%;
    max-width: 1200px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 5px 5px 15px rgba(0, 0, 0, 0.5);
}

.forecast-popup.show {
    display: block;
}

.forecast-popup-close {
    position: absolute;
    right: 10px;
    top: 10px;
    background: rgba(205, 205, 205, 0.75);
    border: none;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    justify-content: center;
    font-size: 24px;
    font-weight: 600;
    line-height: 1;
    transition: all 0.2s ease;
}

.forecast-popup-close:hover {
    background: rgba(0, 0, 0, 0.2);
    color: #333;
}

.hourly-forecast {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
    gap: 6px;
    margin-top: 15px;
    max-width: 1140px;
    margin-left: auto;
    margin-right: auto;
}

.hourly-item {
    padding: 6px;
    border-radius: var(--button-radius);
    text-align: center;
    transition: background 0.3s ease;
}

.hourly-time {
    font-weight: 500;
    font-size: 11pt;
    color: var(--button-text);
    margin-bottom: 2px;
}

.hourly-icon {
    width: 32px;
    height: 32px;
}

.hourly-temp {
    color: var(--button-text);
    font-size: 11pt;
    font-weight: 750;
    margin: 2px 0;
}

.hourly-desc {
    color: var(--button-text);
    font-size: 10pt;
    font-style: italic;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.station-name {
    font-size: 11pt;
    text-transform: uppercase;
    margin-left: 10px;
    color: var(--text-color);
}

/* Moon phase icon */
.moon-phase-icon {
    display: inline-block;
    width: 18px;
    height: 18px;
    margin-left: 8px;
    vertical-align: baseline;
    background-color: #ccc;
    border-radius: 50%;
    position: relative;
    overflow: hidden;
}

body.dark-mode .moon-phase-icon {
    background-color: #555;
}

/* Notification styles */
/* .notification {
    display: flex;
    align-items: center;
    padding: 15px;
    margin-bottom: 10px;
    border-radius: 10px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
    opacity: 0;
    transition: opacity 0.3s ease;
    background-color: rgba(255, 255, 255, 0.85);
    color: #cc6600;
}

body.dark-mode .notification {
    background-color: rgba(33, 33, 33, 0.9);
    color: #ff7700;
}

.notification.show {
    opacity: 0.95;
}

.notification.hide {
    opacity: 0;
}

.notification-message {
    font-size: 18px;
    font-weight: 700;
} */

/* Cloud icon styles */
.rain-status img,
.notification-icon img {
    filter: invert(50%) sepia(68%) saturate(3233%) hue-rotate(360deg) brightness(103%) contrast(103%);
}

body.dark-mode .rain-status img,
body.dark-mode .notification-icon img {
    filter: invert(74%) sepia(69%) saturate(5422%) hue-rotate(359deg) brightness(101%) contrast(107%);
}

/* Additional section-specific styling */
#satellite {
    padding-top: 30px;
}

/* Mobile Landscape Mode */
@media only screen and (max-width: 900px) {
    .weather-switch-container {
        margin: 10px 0;
    }
    
    .weather-switch {
        width: 100%;
        max-width: 320px;
    }
    
    .weather-switch button {
        padding: 10px 16px;
        font-size: 11pt;
    }
    
    .weather-image {
        max-width: 100%;
    }
    
    .forecast-container {
        gap: 10px;
        margin: 12px 0;
        max-width: 95%;
    }
    
    .forecast-day {
        padding: 10px;
        min-width: 70px;
        max-width: 125px;
    }
    
    .forecast-date {
        font-size: 10pt;
        margin-bottom: 5px;
    }
    
    .forecast-icon {
        width: 48px;
        height: 48px;
        margin: 5px;
    }
    
    .forecast-temp {
        font-size: 13pt;
        margin: 5px 0;
    }
    
    .forecast-desc {
        font-size: 12pt;
    }
    
    .forecast-popup {
        width: 90%;
        max-height: 70vh;
    }
    
    .hourly-forecast {
        grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
        gap: 5px;
    }
    
    .hourly-item {
        padding: 5px;
    }
    
    .hourly-time {
        font-size: 10pt;
    }
    
    .hourly-icon {
        width: 28px;
        height: 28px;
    }
    
    .hourly-temp {
        font-size: 10pt;
        margin: 1px 0;
    }
    
    .hourly-desc {
        font-size: 9pt;
    }
    
    .moon-phase-icon {
        width: 14px;
        height: 14px;
    }

    .weather-switch {
        max-width: 100%;
    }

    .weather-switch button {
        padding: 8px 12px;
        font-size: 11pt;
    }

    #prem-forecast-container .forecast-day:nth-of-type(7) {
        display: none;
    }
}
