/* 
 * FLO Airport Weather Widget Styles
 * Version: 2.0.5
 * WCAG 2.1 AA Compliant
 * FLO Brand Colors Applied
 */

/* Base Widget Styles - Header Design */
.flo-airport-weather-widget {
    display: flex !important;
    align-items: center !important;
    font-family: 'Brandon Grotesque', -apple-system, BlinkMacSystemFont, sans-serif;
    font-weight: 500;
    padding: 8px 12px;
    margin: 0;
    background-color: transparent !important; /* Always transparent - controlled by Elementor */
    background: transparent !important; /* Double ensure no background */
    color: #ffffff; /* White text */
    cursor: pointer;
    position: relative !important;
    border-radius: 4px;
    transition: opacity 0.2s ease;
}

/* Hover state - subtle indication */
.flo-airport-weather-widget:hover {
    background-color: rgba(255, 255, 255, 0.08) !important; /* Very subtle white overlay */
    opacity: 0.95;
}

/* Active state - NO background change */
.flo-airport-weather-widget.active,
.flo-airport-weather-widget[aria-expanded="true"] {
    background-color: transparent !important;
    background: transparent !important;
    z-index: 100001;
}

/* Focus states for accessibility - outline only, no background */
.flo-airport-weather-widget:focus,
.flo-airport-weather-widget:focus-visible,
.flo-airport-weather-widget:focus-within {
    outline: 2px solid rgba(255, 255, 255, 0.8) !important;
    outline-offset: 2px;
    background-color: transparent !important;
    background: transparent !important;
    box-shadow: none !important; /* Remove any box shadow */
}

.flo-airport-weather-widget .flo-airport-weather-icon {
    display: flex;
    align-items: center !important;
    margin-right: 8px;
}

.flo-airport-weather-widget .flo-airport-weather-icon img {
    width: 24px;
    height: 24px;
    object-fit: contain;
    filter: brightness(1);
    transform-origin: center center;
    transition: transform 0.2s ease;
    background-color: transparent;
    min-width: 24px;
    min-height: 24px;
    display: block;
}

.flo-airport-weather-widget .flo-airport-weather-temp {
    font-size: 18px !important;
    font-weight: 500 !important;
    display: flex !important;
    align-items: center !important;
    line-height: 1 !important;
    color: #ffffff; /* White text */
}

.flo-airport-weather-widget .flo-airport-weather-temp span {
    font-weight: 500 !important;
    color: #ffffff; /* White text */
}

.flo-airport-weather-widget .temp-value {
    font-weight: 500 !important;
    color: #ffffff; /* White text */
}

.flo-airport-weather-widget .temp-unit {
    font-size: 16px !important;
    margin-top: -2px !important;
    font-weight: 500 !important;
    color: #ffffff; /* White text */
}

/* Error state */
.flo-airport-weather-widget.flo-airport-weather-error {
    color: #ffffff;
    font-size: 14px;
    font-weight: 500;
    cursor: default;
    background-color: transparent !important;
}

/* Image error handling and fallback styles */
.flo-airport-weather-widget img.icon-error-fallback,
.flo-airport-weather-popup img.icon-error-fallback {
    background-color: transparent;
    border: none;
    border-radius: 4px;
    position: relative;
}

/* Loading state for refreshing */
.flo-airport-weather-widget.is-refreshing {
    opacity: 0.7;
    pointer-events: none;
    background-color: transparent !important;
}

/* Weather Popup Styles */
.flo-airport-weather-popup {
    display: none;
    position: fixed;
    z-index: 100000;
    background: #fff;
    border-radius: 8px; /* Rounded corners for popup */
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    font-family: 'Brandon Grotesque', -apple-system, BlinkMacSystemFont, sans-serif;
    overflow: hidden;
    font-size: 14px;
    color: #000000; /* Black text */
    line-height: 1.5;
    max-width: 400px;
    width: 400px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease;
}

/* Show the popup when it has the is-visible class */
.flo-airport-weather-popup.is-visible {
    display: block;
    opacity: 1;
    visibility: visible;
}

/* Overlay for modal-like behavior */
.flo-airport-weather-overlay {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1;
    animation: flo_airport_fadeIn 0.2s ease;
}

/* Body class to prevent scrolling when popup is open */
body.flo-airport-weather-open {
    overflow: hidden;
}

/* Popup Header */
.flo-airport-weather-popup-header {
    position: relative;
    background: #004EA8; /* FLO Main Blue */
    color: white;
    padding: 12px 15px;
}

.flo-airport-weather-popup-header h3 {
    margin: 0;
    padding: 0;
    font-size: 1.5rem;
    font-weight: 600;
}

/* Close button */
.flo-airport-weather-popup-close {
    position: absolute !important;
    top: 6px !important;
    right: 8px !important;
    width: 42px !important;
    height: 42px !important;
    border-radius: 4px !important;
    border: 2px solid transparent !important;
    background: transparent !important;
    color: white !important;
    font-size: 40px!important;
    line-height: 1!important;
    text-align: center!important;
    cursor: pointer!important;
    transition: all 0.2s ease!important;
    display: flex!important;
    align-items: center!important;
    justify-content: center!important;
    padding: 0!important;
    z-index: 100010!important;
}

.flo-airport-weather-popup-close:hover,
.flo-airport-weather-popup-close:focus {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
    outline: none;
}

/* Current Weather Display */
.flo-airport-weather-popup-current {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    background-color: #F2F2F2; /* FLO Light Gray */
    border-bottom: 1px solid #C8D9EB; /* FLO Light Blue */
}

/* Group icon and temp together */
.flo-airport-weather-popup-main-group {
    display: flex;
    align-items: center;
}

.flo-airport-weather-popup-icon {
    margin-right: 12px;
}

.flo-airport-weather-popup-icon img {
    width: 48px;
    height: 48px;
    object-fit: contain;
    min-width: 48px;
    min-height: 48px;
    background-color: transparent;
    display: block;
}

.flo-airport-weather-popup-temp {
    font-size: 32px;
    font-weight: 600;
    line-height: 1;
    color: #000000; /* Black text */
}

.flo-airport-weather-popup-temp span {
    font-size: 18px;
    vertical-align: top;
    margin-left: 2px;
}

/* Group description and feels like together */
.flo-airport-weather-popup-desc-group {
    text-align: right;
    max-width: 45%;
}

.flo-airport-weather-popup-desc {
    font-size: 16px;
    margin-bottom: 4px;
    color: #000000; /* Black text */
    font-weight: 500;
}

.flo-airport-weather-feels-like {
    font-size: 14px;
    color: #555;
}

/* Weather Info Grid */
.flo-airport-weather-info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-gap: 10px;
    padding: 15px 20px;
    background-color: #FFFFFF;
    border-bottom: 1px solid #C8D9EB; /* FLO Light Blue */
}

.flo-airport-weather-info-item {
    font-size: 13px;
    color: #000000; /* Black text */
}

.flo-airport-weather-info-item span {
    font-weight: 600;
    color: #004EA8; /* FLO Main Blue for labels */
    margin-right: 5px;
}

/* Hourly Forecast Header */
.flo-airport-weather-hourly-header {
    background: #004EA8; /* FLO Main Blue */
    color: white;
    padding: 12px 15px;
}

.flo-airport-weather-hourly-header h3 {
    margin: 0;
    padding: 0;
    font-size: 1.25rem;
    font-weight: 600;
}

/* Hourly Timeline */
.flo-airport-weather-hourly-timeline {
    display: flex;
    justify-content: space-between;
    padding: 15px 20px;
    background-color: #FFFFFF;
    border-bottom: 1px solid #C8D9EB; /* FLO Light Blue */
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    position: relative;
    scrollbar-width: thin;
    scrollbar-color: #004EA8 #F2F2F2;
    scroll-behavior: smooth;
}

.flo-airport-weather-hourly-timeline::-webkit-scrollbar {
    height: 6px;
}

.flo-airport-weather-hourly-timeline::-webkit-scrollbar-track {
    background: #F2F2F2; /* FLO Light Gray */
}

.flo-airport-weather-hourly-timeline::-webkit-scrollbar-thumb {
    background-color: #004EA8; /* FLO Main Blue */
    border-radius: 3px;
}

/* Hour slots */
.flo-airport-weather-hour-slot {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 60px;
    text-align: center;
    padding: 8px 4px;
}

.flo-airport-weather-hour-time {
    font-size: 13px;
    margin-bottom: 8px;
    font-weight: 500;
    color: #000000; /* Black text */
}

.flo-airport-weather-hour-icon {
    margin-bottom: 8px;
}

/* Hour and day icons */
.flo-airport-weather-hour-icon img,
.flo-airport-weather-day-icon img {
    width: 24px;
    height: 24px;
    object-fit: contain;
    min-width: 24px;
    min-height: 24px;
    background-color: transparent;
    display: inline-block;
    transition: opacity 0.2s ease;
}

/* Fallback for broken images */
.flo-airport-weather-hour-icon img:not([src]),
.flo-airport-weather-hour-icon img[src=""],
.flo-airport-weather-hour-icon img[src*="undefined"],
.flo-airport-weather-hour-icon img[src*="null"],
.flo-airport-weather-day-icon img:not([src]),
.flo-airport-weather-day-icon img[src=""],
.flo-airport-weather-day-icon img[src*="undefined"],
.flo-airport-weather-day-icon img[src*="null"] {
    background-color: transparent;
    border: none;
    border-radius: 4px;
    position: relative;
}

/* Style for fallback icons - transparent background to avoid gray box */
.flo-airport-weather-hour-icon img.icon-error-fallback,
.flo-airport-weather-day-icon img.icon-error-fallback {
    background-color: transparent; /* No background for fallback icons */
    border: none; /* Remove border */
    border-radius: 4px;
    opacity: 1; /* Full opacity for visibility */
}

/* Loading animation for images */
.flo-airport-weather-hour-icon img[src=""],
.flo-airport-weather-day-icon img[src=""],
.flo-airport-weather-popup-icon img[src=""] {
    background: linear-gradient(90deg, #F2F2F2 25%, #CCCCCC 50%, #F2F2F2 75%);
    background-size: 200% 100%;
    animation: loading-shimmer 1.5s infinite;
}

@keyframes loading-shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

.flo-airport-weather-hour-temp {
    font-size: 16px;
    font-weight: 600;
    color: #000000; /* Black text */
}

/* 3-Day Forecast Header */
.flo-airport-weather-forecast-header {
    background: #004EA8; /* FLO Main Blue */
    color: white;
    padding: 12px 15px;
}

.flo-airport-weather-forecast-header h3 {
    margin: 0;
    padding: 0;
    font-size: 1.25rem;
    font-weight: 600;
}

/* 3-Day Forecast Layout */
.flo-airport-weather-forecast-days {
    display: flex;
    justify-content: space-around;
    padding: 20px;
    background-color: #FFFFFF;
}

.flo-airport-weather-day {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    text-align: center;
    position: relative;
    padding: 8px 4px;
}

.flo-airport-weather-day:not(:last-child):after {
    content: '';
    position: absolute;
    right: 0;
    top: 10%;
    height: 80%;
    width: 1px;
    background-color: #C8D9EB; /* FLO Light Blue */
}

.flo-airport-weather-day-name {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 10px;
    color: #000000; /* Black text */
}

.flo-airport-weather-day-icon {
    margin-bottom: 10px;
}

.flo-airport-weather-day-icon img {
    width: 32px;
    height: 32px;
    min-width: 32px;
    min-height: 32px;
}

.flo-airport-weather-day-temp {
    font-size: 14px;
    color: #000000; /* Black text */
}

/* Animation keyframes */
@keyframes flo_airport_fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Icon Animations - Only for popup icons */
.flo-airport-weather-popup-icon img.flo-airport-weather-sun-icon,
.flo-airport-weather-hour-icon img.flo-airport-weather-sun-icon,
.flo-airport-weather-day-icon img.flo-airport-weather-sun-icon {
    animation: flo_airport_sun_pulse 3s infinite ease-in-out;
}

.flo-airport-weather-popup-icon img.flo-airport-weather-moon-icon,
.flo-airport-weather-hour-icon img.flo-airport-weather-moon-icon,
.flo-airport-weather-day-icon img.flo-airport-weather-moon-icon {
    animation: flo_airport_moon_glow 4s infinite ease-in-out;
}

.flo-airport-weather-popup-icon img.flo-airport-weather-cloud-icon,
.flo-airport-weather-hour-icon img.flo-airport-weather-cloud-icon,
.flo-airport-weather-day-icon img.flo-airport-weather-cloud-icon {
    animation: flo_airport_cloud_float 5s infinite ease-in-out;
}

.flo-airport-weather-popup-icon img.flo-airport-weather-rain-icon,
.flo-airport-weather-hour-icon img.flo-airport-weather-rain-icon,
.flo-airport-weather-day-icon img.flo-airport-weather-rain-icon {
    animation: flo_airport_rain_fall 2s infinite ease-in-out;
}

.flo-airport-weather-popup-icon img.flo-airport-weather-snow-icon,
.flo-airport-weather-hour-icon img.flo-airport-weather-snow-icon,
.flo-airport-weather-day-icon img.flo-airport-weather-snow-icon {
    animation: flo_airport_snow_fall 3s infinite ease-in-out;
}

.flo-airport-weather-popup-icon img.flo-airport-weather-storm-icon,
.flo-airport-weather-hour-icon img.flo-airport-weather-storm-icon,
.flo-airport-weather-day-icon img.flo-airport-weather-storm-icon {
    animation: flo_airport_storm_flash 5s infinite ease-in-out;
}

/* Reduced animation intensity for accessibility */
@keyframes flo_airport_sun_pulse {
    0%, 100% { transform: scale(1); filter: brightness(1); }
    50% { transform: scale(1.05); filter: brightness(1.05); }
}

@keyframes flo_airport_moon_glow {
    0%, 100% { opacity: 0.95; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.03); filter: drop-shadow(0 0 2px rgba(0, 78, 168, 0.3)); }
}

@keyframes flo_airport_cloud_float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-1px); }
}

@keyframes flo_airport_rain_fall {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(1px); filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.2)); }
}

@keyframes flo_airport_snow_fall {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(1px) rotate(2deg); }
}

@keyframes flo_airport_storm_flash {
    0%, 15%, 25%, 35%, 100% { opacity: 1; filter: brightness(1); }
    20%, 30% { opacity: 0.9; filter: brightness(1.2); }
}

/* Reduced motion media query for accessibility */
@media (prefers-reduced-motion: reduce) {
    .flo-airport-weather-popup-icon img,
    .flo-airport-weather-hour-icon img,
    .flo-airport-weather-day-icon img {
        animation: none !important;
    }
    
    .flo-airport-weather-hour-icon img[src=""],
    .flo-airport-weather-day-icon img[src=""],
    .flo-airport-weather-popup-icon img[src=""] {
        animation: none !important;
        background: #F2F2F2;
    }
}

/* High contrast mode support */
@media (forced-colors: active) {
    .flo-airport-weather-widget,
    .flo-airport-weather-popup-close {
        border: 1px solid currentColor;
    }
    
    .flo-airport-weather-hour-slot,
    .flo-airport-weather-day {
        border: 1px solid currentColor;
    }
}

/* IE11 support */
@media all and (-ms-high-contrast: none), (-ms-high-contrast: active) {
    .flo-airport-weather-hour-icon img,
    .flo-airport-weather-day-icon img,
    .flo-airport-weather-popup-icon img {
        width: auto;
        height: auto;
        max-width: 24px;
        max-height: 24px;
    }
    
    .flo-airport-weather-popup-icon img {
        max-width: 48px;
        max-height: 48px;
    }
    
    .flo-airport-weather-day-icon img {
        max-width: 32px;
        max-height: 32px;
    }
}

/* Responsive adjustments */
@media (max-width: 480px) {
    .flo-airport-weather-popup {
        position: fixed;
        top: auto;
        bottom: 0;
        right: 0;
        left: 0;
        max-width: 100%;
        width: 100%;
        box-shadow: 0 -4px 15px rgba(0, 0, 0, 0.2);
        border-radius: 8px 8px 0 0;
        max-height: 80vh;
        overflow-y: auto;
        transform: none !important;
    }
    
    /* Hourly timeline scrolling on mobile */
    .flo-airport-weather-hourly-timeline {
        padding: 15px 15px;
        justify-content: flex-start;
    }
    
    .flo-airport-weather-hour-slot {
        min-width: 70px;
        margin-right: 8px;
        padding: 10px 5px;
    }
    
    /* Adjust forecast day sizing on mobile */
    .flo-airport-weather-day {
        padding: 10px 5px;
    }
    
    .flo-airport-weather-day-name {
        font-size: 13px;
    }
    
    .flo-airport-weather-day-temp {
        font-size: 13px;
    }
    
    /* Better layout of current weather section on mobile */
    .flo-airport-weather-popup-current {
        flex-wrap: wrap;
        padding: 15px;
    }
    
    .flo-airport-weather-popup-desc-group {
        width: 100%;
        text-align: left;
        margin-top: 10px;
        display: flex;
        justify-content: space-between;
        max-width: 100%;
    }
    
    /* Improve touch target size for close button on mobile */
    .flo-airport-weather-popup-close {
        width: 44px;
        height: 44px;
        top: 8px;
        right: 8px;
    }
    
    /* Adjust header text on mobile */
    .flo-airport-weather-popup-header h3 {
        font-size: 1.25rem;
        padding-right: 40px;
    }
    
    .flo-airport-weather-hourly-header h3,
    .flo-airport-weather-forecast-header h3 {
        font-size: 1.125rem;
    }
}

/* Error states and connectivity indicators */
.flo-airport-weather-widget.network-error {
    opacity: 0.6;
}

.flo-airport-weather-widget.network-error::after {
    content: '⚠';
    position: absolute;
    top: -5px;
    right: -5px;
    background: #ff4444;
    color: white;
    border-radius: 50%;
    width: 16px;
    height: 16px;
    font-size: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Smooth transitions for dynamic content updates */
.flo-airport-weather-popup-temp,
.flo-airport-weather-feels-like,
.flo-airport-weather-popup-desc,
.flo-airport-weather-info-item {
    transition: all 0.3s ease;
}

/* Loading state styles */
.flo-airport-weather-widget.is-refreshing .flo-airport-weather-icon img {
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}