﻿.nws-weather-widget {
    background: linear-gradient(135deg, var(--brand-blue) 0%, var(--brand-blue-dark) 100%);
    border-radius: 12px;
    padding: 20px;
    color: var(--brand-white);
    box-shadow: 0 4px 15px rgba(27, 156, 217, 0.15);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    max-width: 100%;
    margin: 0 auto;
    border: 1px solid var(--brand-blue-light);
    position: relative;
}

/* New vertical layout - current weather on top, forecast below */
.weather-section .nws-weather-widget {
    display: block;
}

.weather-section .weather-content {
    display: block;
}

.weather-section .weather-current {
    margin-bottom: 25px;
}

.weather-section .weather-forecast {
    margin-top: 0;
}

.weather-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--brand-blue-light);
    padding-bottom: 10px;
}

.weather-title {
    font-size: 1.3rem;
    font-weight: 600;
    margin: 0;
    color: var(--brand-white);
}

.weather-location {
    font-size: 0.9rem;
    opacity: 0.9;
    color: var(--brand-blue-light);
}

.weather-current {
    margin-bottom: 10px;
}

.weather-temp-main {
    text-align: center;
    margin-bottom: 0px;
}

.current-temperature {
    display: block;
    font-size: 1.5rem;
    font-weight: 300;
    line-height: 1;
    margin-bottom: 8px;
    color: var(--brand-white);
}

.current-condition {
    font-size: 1.0rem;
    opacity: 0.9;
    text-transform: capitalize;
    color: var(--brand-blue-light);
}

.weather-details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 12px;
}

.weather-detail {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    background: linear-gradient(135deg, var(--brand-white) 0%, var(--brand-background) 100%);
    border-radius: 6px;
    border: 1px solid var(--brand-blue-light);
    box-shadow: 0 2px 8px rgba(27, 156, 217, 0.1);
    backdrop-filter: blur(10px);
    min-height: 56px;
}

.detail-label {
    font-size: 0.85rem;
    color: var(--brand-navy);
    font-weight: 500;
}

.detail-value {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--brand-blue-dark);
}

/* UV Index Color Coding */
.detail-value.uv-low {
    color: var(--brand-green);
}

.detail-value.uv-moderate {
    color: var(--brand-orange);
}

.detail-value.uv-high {
    color: #FF8C00; /* Dark orange */
}

.detail-value.uv-very-high {
    color: #FF4500; /* Red orange */
}

.detail-value.uv-extreme {
    color: var(--brand-danger);
    font-weight: 700;
}

/* UV Index weather detail special styling */
.weather-detail:has(.uv-low) {
    border-color: var(--brand-green);
}

.weather-detail:has(.uv-moderate) {
    border-color: var(--brand-orange);
}

.weather-detail:has(.uv-high) {
    border-color: #FF8C00;
}

.weather-detail:has(.uv-very-high) {
    border-color: #FF4500;
}

.weather-detail:has(.uv-extreme) {
    border-color: var(--brand-danger);
    background: linear-gradient(135deg, #fde8e8 0%, var(--brand-background) 100%);
}

.weather-forecast {
    margin-top: 5px;
}

.forecast-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 15px;
    color: var(--brand-white);
    border-bottom: 1px solid var(--brand-blue-light);
    padding-bottom: 8px;
}

/* Always horizontal forecast layout */
.forecast-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px;
    max-height: none;
    overflow-y: visible;
}

/* Combined forecast item container */
.forecast-item-combined {
    display: flex;
    flex-direction: column;
    padding: 12px;
    background: linear-gradient(135deg, var(--brand-white) 0%, var(--brand-background) 100%);
    border-radius: 8px;
    border: 1px solid var(--brand-blue-light);
}

/* Day name header at the top */
.forecast-day-name {
    font-weight: 700;
    color: var(--brand-navy);
    font-size: 0.95rem;
    margin-bottom: 10px;
    text-align: center;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--brand-blue-light);
}

/* Individual forecast item (day or night) */
.forecast-item {
    display: flex;
    flex-direction: column;
    text-align: center;
    padding: 8px 4px;
}

.forecast-day {
    font-weight: 600;
    color: var(--brand-gray);
    margin-bottom: 6px;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.forecast-temp {
    font-weight: 600;
    color: var(--brand-blue-dark);
    margin-bottom: 6px;
    font-size: 1rem;
}

.forecast-desc {
    color: var(--brand-gray);
    font-size: 0.75rem;
    line-height: 1.3;
}

/* Soft divider between day and night */
.forecast-divider {
    height: 1px;
    background: linear-gradient(
        to right,
        transparent 0%,
        var(--brand-gray-light) 20%,
        var(--brand-gray-light) 80%,
        transparent 100%
    );
    margin: 8px 0;
    opacity: 0.4;
}

.forecast-loading {
    text-align: center;
    padding: 20px;
    color: var(--brand-blue-light);
    font-size: 0.9rem;
    grid-column: 1 / -1;
}

.weather-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 20px;
    border-top: 1px solid var(--brand-blue-light);
    padding-top: 15px;
    font-size: 0.75rem;
}

.weather-source {
    font-weight: 500;
    color: var(--brand-blue-light);
}

.weather-updated {
    text-align: right;
    color: var(--brand-blue-light);
    opacity: 0.9;
}

.weather-error {
    background: linear-gradient(135deg, var(--brand-danger) 0%, #c82333 100%);
    border-color: var(--brand-danger);
}

.weather-error-message {
    text-align: center;
    margin: 20px 0;
    font-size: 0.9rem;
    color: var(--brand-white);
}

/* Custom scrollbar for forecast - Brand styled */
.forecast-list::-webkit-scrollbar {
    width: 6px;
}       

.forecast-list::-webkit-scrollbar-track {
    background: var(--brand-blue-light);
    border-radius: 3px;
}

.forecast-list::-webkit-scrollbar-thumb {
    background: var(--brand-blue);
    border-radius: 3px;
    transition: background 0.3s ease;
}

.forecast-list::-webkit-scrollbar-thumb:hover {
    background: var(--brand-blue-dark);
}

/* Responsive adjustments following brand guidelines */
@media (max-width: 768px) {
    .nws-weather-widget {
        max-width: 100%;
        margin: 0 10px;
        padding: 15px;
        border-radius: 8px;
    }

    .weather-details-grid {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .current-temperature {
        font-size: 2.5rem;
    }

    .forecast-list {
        grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
        gap: 10px;
    }

    .forecast-item-combined {
        padding: 10px;
    }

    .forecast-day-name {
        font-size: 0.85rem;
        margin-bottom: 8px;
        padding-bottom: 6px;
    }

    .forecast-item {
        padding: 6px 3px;
    }

    .forecast-day {
        font-size: 0.7rem;
    }

    .forecast-temp {
        font-size: 0.9rem;
    }

    .forecast-desc {
        font-size: 0.7rem;
    }

    .forecast-divider {
        margin: 6px 0;
    }

    .weather-header {
        margin-bottom: 15px;
    }

    .weather-title {
        font-size: 1.1rem;
    }

    .weather-location {
        font-size: 0.8rem;
    }
}

/* Focus states for accessibility following brand guidelines */
.forecast-item-combined:focus,
.weather-detail:focus {
    outline: 2px solid var(--brand-blue);
    outline-offset: 2px;
    border-color: var(--brand-blue-dark);
}

/* Loading state styling */
.forecast-loading {
    background: linear-gradient(135deg, var(--brand-blue-light) 0%, var(--brand-blue-hover) 100%);
    border-radius: 6px;
    border: 1px solid var(--brand-blue);
    color: var(--brand-blue-dark);
    font-weight: 500;
}

/* Success state for data loaded */
.weather-data-loaded .weather-title::after {
    content: '✓';
    margin-left: 8px;
    color: var(--brand-green);
    font-size: 0.9rem;
    opacity: 0;
    animation: fadeInSuccess 0.5s ease-in-out 1s forwards;
}

@keyframes fadeInSuccess {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}