/**
 * Weather Forecast Banner Styles
 *
 * Styling for the forecast banner below the map
 */

/* Weather Banner Container - background set inline to match overlay menu */
.rfcc-weather-banner {
    /* background set via inline style from PHP */
    border-radius: 8px;
    margin: 10px 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;

    /* CSS variables for dynamic text colors - defaults for light backgrounds */
    --text-primary: #333;
    --text-secondary: #666;
    --text-tertiary: #999;
    --icon-color: #0073aa;
    --border-color: rgba(0, 0, 0, 0.1);
}

/* Dark background variant - set via data attribute when textColorType is 'light' */
.rfcc-weather-banner[data-text-type="light"] {
    --text-primary: #ecf0f1;
    --text-secondary: #bdc3c7;
    --text-tertiary: #95a5a6;
    --icon-color: #3498db;
    --border-color: rgba(255, 255, 255, 0.1);
}

/* Banner Toggle Button - 30% less tall */
.banner-toggle {
    width: 100%;
    /* background and color set via inline style from PHP */
    border: none;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    padding: 8px 20px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    text-align: left;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.2s ease;
}

.banner-toggle:hover {
    background: rgba(0, 115, 170, 0.05);
}

.banner-toggle i {
    /* color set via inline style from PHP */
    transition: transform 0.2s ease;
}

.banner-toggle .banner-title {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
}

.banner-toggle .city-name {
    /* color set via inline style from PHP */
    font-weight: 400;
    font-size: 13px;
}

/* Banner Content */
.banner-content {
    display: none;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 15px;
    /* background set via inline style from PHP */
    scroll-behavior: smooth;
    /* Snap scrolling for better UX */
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
}

/* Forecast Items Grid */
.banner-content {
    display: none;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 12px;
    padding: 15px;
    background: #f9f9f9;
}

/* When displayed, use flex for horizontal scrolling */
.banner-content[style*="display: block"],
.banner-content[style*="display: grid"] {
    display: flex !important;
    flex-wrap: nowrap;
}

/* Individual Forecast Item - Shorter with reduced padding */
.forecast-item {
    min-width: 130px;
    background: rgba(255, 255, 255, 0.5);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 4px 6px;
    text-align: center;
    transition: all 0.3s ease;
    scroll-snap-align: start;
    flex-shrink: 0;
    cursor: pointer;
}

/* Forecast items in dark mode */
.rfcc-weather-banner[data-text-type="light"] .forecast-item {
    background: rgba(44, 62, 80, 0.6);
    border-color: var(--border-color);
}

.forecast-item:hover {
    border-color: #0073aa;
    box-shadow: 0 4px 12px rgba(0, 115, 170, 0.15);
    transform: translateY(-2px);
}

.forecast-item.active {
    border-color: #0073aa;
    background: linear-gradient(135deg, #f0f8ff 0%, #e6f3ff 100%);
    box-shadow: 0 4px 16px rgba(0, 115, 170, 0.25);
}

/* Forecast Time */
.forecast-time {
    font-size: 10px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 2px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.forecast-item.active .forecast-time {
    color: #0073aa;
}

/* Weather Icon */
.weather-icon {
    width: 35px;
    height: 35px;
    margin: 0 auto;
    display: block;
}

/* Temperature */
.forecast-temp {
    margin-bottom: 1px;
}

.temp-value {
    display: block;
    font-size: 15px;
    font-weight: bold;
    color: var(--text-primary);
    margin-bottom: 0;
}

.temp-feels {
    display: block;
    font-size: 9px;
    color: var(--text-tertiary);
    line-height: 1.1;
}

/* Wind Information */
.forecast-wind {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    font-size: 10px;
    color: var(--text-secondary);
    margin-bottom: 0;
    line-height: 1.1;
}

.forecast-wind i {
    color: var(--icon-color);
    font-size: 9px;
}

/* Precipitation */
.forecast-precip {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    font-size: 10px;
    color: var(--text-secondary);
    line-height: 1.1;
    margin-bottom: 2px;
}

.forecast-precip i {
    color: var(--icon-color);
    font-size: 9px;
}

/* Riding Conditions in Forecast Items */
.forecast-conditions {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 9px;
    line-height: 1.2;
    margin-top: 2px;
    padding-top: 3px;
    border-top: 1px solid var(--border-color);
}

.forecast-conditions .conditions-label {
    font-weight: 600;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.forecast-conditions .conditions-score {
    font-size: 8px;
    color: var(--text-tertiary);
    margin-top: 1px;
}

/* Scrollbar Styling */
.banner-content::-webkit-scrollbar {
    height: 8px;
}

.banner-content::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.banner-content::-webkit-scrollbar-thumb {
    background: #0073aa;
    border-radius: 4px;
}

.banner-content::-webkit-scrollbar-thumb:hover {
    background: #005a87;
}

/* Responsive Design */
@media (max-width: 768px) {
    .banner-toggle {
        padding: 10px 15px;
        font-size: 13px;
    }

    .banner-content {
        padding: 12px;
        gap: 10px;
    }

    .forecast-item {
        min-width: 130px;
        padding: 10px;
    }

    .weather-icon {
        width: 40px;
        height: 40px;
    }

    .temp-value {
        font-size: 18px;
    }

    .forecast-wind,
    .forecast-precip {
        font-size: 11px;
    }
}

@media (max-width: 480px) {
    .banner-toggle {
        padding: 8px 12px;
        font-size: 12px;
    }

    .banner-content {
        padding: 10px;
        gap: 8px;
    }

    .forecast-item {
        min-width: 120px;
        padding: 8px;
    }

    .forecast-time {
        font-size: 10px;
    }

    .weather-icon {
        width: 35px;
        height: 35px;
    }

    .temp-value {
        font-size: 16px;
    }

    .temp-feels {
        font-size: 10px;
    }

    .forecast-wind,
    .forecast-precip {
        font-size: 10px;
        gap: 3px;
    }
}

/* Dark Mode Support (will be enhanced in dark mode CSS) */
@media (prefers-color-scheme: dark) {
    .rfcc-weather-banner {
        background: #2c3e50;
        border-color: rgba(255, 255, 255, 0.1);
    }

    .banner-toggle {
        background: rgba(44, 62, 80, 0.95);
        color: #ecf0f1;
        border-bottom-color: rgba(255, 255, 255, 0.1);
    }

    .banner-toggle:hover {
        background: rgba(0, 115, 170, 0.15);
    }

    .banner-content {
        background: #34495e;
    }

    .forecast-item {
        background: #2c3e50;
        border-color: rgba(255, 255, 255, 0.1);
    }

    .forecast-item.active {
        background: linear-gradient(135deg, #1a252f 0%, #2c3e50 100%);
        border-color: #3498db;
    }

    .forecast-time {
        color: #bdc3c7;
    }

    .forecast-item.active .forecast-time {
        color: #3498db;
    }

    .temp-value {
        color: #ecf0f1;
    }

    .temp-feels,
    .forecast-wind,
    .forecast-precip {
        color: #95a5a6;
    }

    .banner-content::-webkit-scrollbar-track {
        background: #2c3e50;
    }

    .banner-content::-webkit-scrollbar-thumb {
        background: #3498db;
    }

    .banner-content::-webkit-scrollbar-thumb:hover {
        background: #2980b9;
    }
}
