/* weather-styles.css - Version 2.1 */
:root {
    --primary-color: #004990;
    --secondary-color: #666;
    --background-color: #fff;
    --border-color: #e0e0e0;
    --alert-bg: #fff3cd;
    --alert-color: #856404;
    --error-color: #dc3545;
    --warning-color: #ffa500;
    --button-primary-color: #FFD504;
    --button-hover-color: #FFC300;
    --stale-data-color: #767676;
    --disabled-color: #999;
}

/* Main container */
.gsp-weather-full {
    background: var(--background-color);
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    padding: 20px;
    max-width: 800px;
    margin: 0 auto;
    color: #333;
    min-height: 200px;
}

/* Disabled state */
.gsp-weather-disabled,
.weather-disabled {
    text-align: center;
    padding: 40px;
    color: var(--disabled-color);
    font-style: italic;
}

/* Search */
.airport-search {
    margin-bottom: 20px;
    display: flex;
    gap: 10px;
}

.airport-search input {
    padding: 8px 12px;
    border: 2px solid var(--border-color);
    border-radius: 4px;
    font-size: 16px;
    flex: 1;
    min-width: 0;
}

.airport-search input:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 1px;
}

.search-button {
    background: var(--button-primary-color);
    color: black;
    border: 1px solid var(--button-primary-color);
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
    transition: background-color 0.2s;
}

.search-button:hover {
    background-color: var(--button-hover-color);
}

.search-button:focus {
    outline: 2px solid black;
    outline-offset: 2px;
}

/* Current weather */
.current-weather {
    margin-bottom: 20px;
}

.current-temp {
    font-size: 48px;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 10px;
}

.current-temp .wi {
    font-size: 42px;
}

.weather-details {
    font-size: 18px;
    color: var(--secondary-color);
    margin-bottom: 20px;
}

.feels-like {
    margin-bottom: 5px;
}

.description {
    font-weight: 500;
}

/* Conditions grid */
.conditions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.condition-item {
    background: #f5f5f5;
    padding: 15px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.condition-item .wi {
    font-size: 24px;
    color: var(--primary-color);
}

/* Alerts and notices */
.weather-alerts {
    margin-bottom: 20px;
}

.weather-error {
    color: var(--error-color);
    text-align: center;
    padding: 15px;
    margin: 20px 0;
    border-radius: 4px;
    background-color: rgba(220, 53, 69, 0.1);
}

.weather-notice {
    color: var(--warning-color);
    background-color: rgba(255, 165, 0, 0.1);
    padding: 10px;
    border-radius: 4px;
    margin: 10px 0;
}

.stale-data-notice {
    background-color: rgba(255, 165, 0, 0.1);
    color: var(--warning-color);
    padding: 10px;
    border-radius: 4px;
    margin: 10px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.cache-notice {
    font-size: 12px;
    color: var(--secondary-color);
    text-align: right;
    margin-top: 5px;
}

.refresh-button {
    background: var(--button-primary-color);
    color: black;
    border: none;
    padding: 4px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    margin-left: auto;
}

.refresh-button:hover {
    background-color: var(--button-hover-color);
}

/* Stale data styling */
.stale-data {
    opacity: 0.85;
}

.stale-data-notice .wi {
    color: var(--warning-color);
}

/* Forecast */
.forecast-container {
    margin-top: 30px;
}

.forecast-container h3 {
    margin-bottom: 20px;
    color: var(--primary-color);
}

/* 5-day forecast grid */
.forecast-days {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 15px;
}

.forecast-day {
    text-align: center;
    padding: 15px 10px;
    background: #f9f9f9;
    border-radius: 6px;
    transition: background-color 0.2s;
}

.forecast-day:hover {
    background: #f0f0f0;
}

/* Today highlight */
.forecast-today {
    background: #e3f2fd;
    border: 2px solid var(--primary-color);
}

.forecast-today:hover {
    background: #bbdefb;
}

/* Date styling */
.forecast-date {
    margin-bottom: 10px;
}

.forecast-day-name {
    font-weight: 600;
    color: var(--primary-color);
    font-size: 16px;
}

.forecast-day-date {
    font-size: 12px;
    color: var(--secondary-color);
    margin-top: 2px;
}

.forecast-icon {
    font-size: 32px;
    margin-bottom: 10px;
    color: var(--primary-color);
}

.forecast-temps {
    margin-bottom: 5px;
}

.forecast-temps .high {
    font-weight: 600;
    margin-right: 5px;
}

.forecast-temps .low {
    color: var(--secondary-color);
}

.forecast-precip {
    font-size: 14px;
    color: var(--secondary-color);
}

.forecast-precip .wi {
    font-size: 12px;
}

/* Mini widget */
.gsp-weather-mini {
    background: transparent;
    color: white;
    padding: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
    height: 42px;
    min-width: 100px;
}

.gsp-weather-mini .current-temp {
    font-size: 20px;
    color: white;
    margin: 0;
}

.gsp-weather-mini .wi {
    font-size: 32px;
    color: white;
}

.gsp-weather-mini .stale-icon {
    font-size: 16px;
    opacity: 0.8;
    margin-left: 5px;
}

/* Loading state */
.weather-loading {
    text-align: center;
    padding: 40px;
    color: var(--secondary-color);
}

.weather-loading-icon {
    font-size: 2em;
    display: inline-block;
    animation: pulse 2s infinite ease-in-out;
}

.gsp-weather-mini .weather-loading-icon {
    font-size: 24px;
    animation: fade 2s infinite ease-in-out;
}

@keyframes fade {
    0%, 100% { opacity: 0.4; }
    50% { opacity: 0.8; }
}

@keyframes pulse {
    0%, 100% { 
        opacity: 0.6; 
        transform: scale(0.95); 
    }
    50% { 
        opacity: 1; 
        transform: scale(1.05); 
    }
}

/* Accessibility */
.screen-reader-text {
    border: 0;
    clip: rect(1px, 1px, 1px, 1px);
    clip-path: inset(50%);
    height: 1px;
    margin: -1px;
    overflow: hidden;
    padding: 0;
    position: absolute;
    width: 1px;
    word-wrap: normal !important;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .gsp-weather-full {
        padding: 15px;
        margin: 10px;
    }

    .airport-search {
        flex-direction: column;
    }

    .current-temp {
        font-size: 36px;
    }

    .current-temp .wi {
        font-size: 32px;
    }

    .conditions {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    /* Mobile forecast - horizontal scroll */
    .forecast-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        margin: 0 -15px;
        padding: 0 15px;
    }
    
    .forecast-days {
        display: flex;
        gap: 10px;
        padding-bottom: 10px;
        min-width: min-content;
    }
    
    .forecast-day {
        flex: 0 0 85px;
        padding: 10px 5px;
    }
    
    .forecast-icon {
        font-size: 24px;
    }
    
    .forecast-day-name {
        font-size: 14px;
    }
    
    .forecast-day-date {
        font-size: 11px;
    }
}

/* Tablet adjustments */
@media (min-width: 481px) and (max-width: 768px) {
    .forecast-days {
        grid-template-columns: repeat(5, 1fr);
        gap: 10px;
    }
    
    .forecast-day {
        flex: unset;
    }
}

/* High contrast mode */
@media (prefers-contrast: more) {
    :root {
        --primary-color: #003366;
        --secondary-color: #000000;
        --border-color: #000000;
        --alert-bg: #ffebcd;
        --alert-color: #000000;
    }
    
    .condition-item {
        background: #ffffff;
        border: 2px solid #000000;
    }
    
    .forecast-day {
        background: #ffffff;
        border: 2px solid #000000;
    }
    
    .forecast-today {
        background: #ffffff;
        border: 3px solid #000000;
    }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .weather-loading-icon {
        animation: none;
    }
    
    .forecast-day {
        transition: none;
    }
}