/**
 * WbMeteo Module Styles
 * Copyright (C) 2025 Nicolas AZHAR. All rights reserved.
 * License GPL v2.0 or later
 */

/* Icônes météo */
.wb-icon-sun::before { content: '☀️'; }
.wb-icon-sun-cloud::before { content: '🌤️'; }
.wb-icon-cloud-sun::before { content: '⛅'; }
.wb-icon-cloud::before { content: '☁️'; }
.wb-icon-fog::before { content: '🌫️'; }
.wb-icon-drizzle::before { content: '🌦️'; }
.wb-icon-rain::before { content: '🌧️'; }
.wb-icon-rain-heavy::before { content: '⛈️'; }
.wb-icon-snow::before { content: '🌨️'; }
.wb-icon-snow-heavy::before { content: '❄️'; }
.wb-icon-shower::before { content: '🌦️'; }
.wb-icon-shower-heavy::before { content: '⛈️'; }
.wb-icon-thunderstorm::before { content: '⛈️'; }
.wb-icon-thunderstorm-hail::before { content: '🌩️'; }
.wb-icon-unknown::before { content: '❓'; }

[class*="wb-icon-"] {
    font-size: 24px;
    display: inline-block;
    line-height: 1;
}

/* Container principal */
.wbmeteo-container {
    position: relative;
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    
    /* Variable CSS pour la vitesse d'animation (défaut 300ms) */
    --animation-speed: 300ms;
}

/* Utilisation de la variable dans les transitions */
.wbmeteo-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    padding: 20px;
    box-sizing: border-box;
    opacity: 0;
    transform: translateX(100%);
    transition: all var(--animation-speed) cubic-bezier(0.4, 0, 0.2, 1);
}

.wbmeteo-nav-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 20px;
    padding: 8px 16px;
    margin: 0 5px;
    color: #333;
    cursor: pointer;
    transition: all var(--animation-speed) ease;
    font-size: 12px;
    font-weight: 500;
}

/* Slides */
.wbmeteo-slides {
    position: relative;
    width: 100%;
    height: 300px;
    overflow: hidden;
}

.wbmeteo-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    padding: 20px;
    box-sizing: border-box;
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.wbmeteo-slide.active {
    opacity: 1;
    transform: translateX(0);
}

.wbmeteo-slide.prev {
    transform: translateX(-100%);
}

/* Navigation */
.wbmeteo-navigation {
    display: flex;
    justify-content: center;
    padding: 15px;
    background: rgba(0, 0, 0, 0.05);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.wbmeteo-nav-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
}

.wbmeteo-nav-btn.active {
    background: rgba(74, 144, 226, 0.8);
    color: white;
}

/* Météo actuelle */
.wbmeteo-current {
    text-align: center;
}

.wbmeteo-city {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 10px;
    color: #2c3e50;
}

.wbmeteo-temp-main {
    font-size: 48px;
    font-weight: 300;
    margin: 15px 0;
    color: #2980b9;
}

.wbmeteo-icon {
    margin: 15px 0;
}

.wbmeteo-icon [class*="wb-icon-"] {
    font-size: 48px;
}

.wbmeteo-condition {
    font-size: 16px;
    margin-bottom: 20px;
    color: #7f8c8d;
    text-transform: capitalize;
}

.wbmeteo-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-top: 20px;
}

.wbmeteo-detail {
    text-align: center;
    padding: 10px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
}

.wbmeteo-detail-label {
    font-size: 12px;
    color: #7f8c8d;
    margin-bottom: 5px;
}

.wbmeteo-detail-value {
    font-size: 16px;
    font-weight: 600;
    color: #2c3e50;
}

/* Prévisions 7 jours */
.wbmeteo-forecast {
    padding: 10px 0;
}

.wbmeteo-forecast-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 15px;
    text-align: center;
    color: #2c3e50;
}

/* Prévisions horaires */
.wbmeteo-hourly {
    padding: 10px 0;
}

.wbmeteo-hourly-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 15px;
    text-align: center;
    color: #2c3e50;
}

.wbmeteo-hourly-scroll {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    padding: 10px 0;
    justify-content: center;
}

.wbmeteo-hourly-item {
    flex: 0 0 auto;
    text-align: center;
    padding: 10px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    min-width: 70px;
}

.wbmeteo-hourly-time {
    font-size: 12px;
    color: #7f8c8d;
    margin-bottom: 5px;
}

.wbmeteo-hourly-icon {
    margin: 5px 0;
}

.wbmeteo-hourly-icon [class*="wb-icon-"] {
    font-size: 20px;
}

.wbmeteo-hourly-temp {
    font-size: 16px;
    font-weight: 600;
    color: #2980b9;
    margin: 5px 0;
}

.wbmeteo-hourly-condition {
    font-size: 10px;
    color: #7f8c8d;
    text-transform: capitalize;
}

.wbmeteo-forecast-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.wbmeteo-forecast-item:last-child {
    border-bottom: none;
}

.wbmeteo-forecast-day {
    font-size: 14px;
    font-weight: 500;
    color: #2c3e50;
    min-width: 60px;
}

.wbmeteo-forecast-icon {
    margin: 0 10px;
}

.wbmeteo-forecast-icon [class*="wb-icon-"] {
    font-size: 18px;
}

.wbmeteo-forecast-condition {
    flex: 1;
    font-size: 12px;
    color: #7f8c8d;
    text-align: center;
    text-transform: capitalize;
}

.wbmeteo-forecast-temps {
    display: flex;
    gap: 8px;
    font-size: 14px;
}

.wbmeteo-temp-max {
    font-weight: 600;
    color: #e74c3c;
}

.wbmeteo-temp-min {
    color: #3498db;
}

/* Thèmes */
.wbmeteo-theme-modern {
    background: linear-gradient(135deg, rgba(74, 144, 226, 0.3), rgba(80, 227, 194, 0.3));
}

.wbmeteo-theme-minimal {
    background: rgba(255, 255, 255, 0.95);
    color: #333;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.wbmeteo-theme-classic {
    background: linear-gradient(135deg, rgba(52, 152, 219, 0.4), rgba(155, 89, 182, 0.4));
}

/* Responsive */
@media (max-width: 768px) {
    .wbmeteo-container {
        max-width: 100%;
        margin: 0;
        border-radius: 0;
    }
    
    .wbmeteo-temp-main {
        font-size: 40px;
    }
    
    .wbmeteo-details {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .wbmeteo-nav-btn {
        padding: 6px 12px;
        font-size: 11px;
    }
}

@media (max-width: 480px) {
    .wbmeteo-slide {
        padding: 15px;
    }
    
    .wbmeteo-slides {
        height: 280px;
    }
    
    .wbmeteo-temp-main {
        font-size: 36px;
    }
    
    .wbmeteo-forecast-item {
        flex-direction: column;
        text-align: center;
        gap: 5px;
    }
    
    .wbmeteo-forecast-temps {
        justify-content: center;
    }
}

/* Animations et effets */
.wbmeteo-loading {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 200px;
    color: #7f8c8d;
}

.wbmeteo-error {
    text-align: center;
    padding: 20px;
    color: #e74c3c;
    background: rgba(231, 76, 60, 0.1);
    border-radius: 8px;
    margin: 10px;
}

/* Touch feedback */
.wbmeteo-container {
    -webkit-tap-highlight-color: transparent;
}

.wbmeteo-nav-btn:active {
    transform: scale(0.95);
}

/* Accessibilité */
.wbmeteo-nav-btn:focus {
    outline: 2px solid #4a90e2;
    outline-offset: 2px;
}

/* Animation de glissement */
@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideInLeft {
    from {
        transform: translateX(-100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.wbmeteo-slide.slide-in-right {
    animation: slideInRight 0.3s ease-out;
}

.wbmeteo-slide.slide-in-left {
    animation: slideInLeft 0.3s ease-out;
}

/* Nouveaux éléments pour le vent */
.wbmeteo-hourly-wind,
.wbmeteo-forecast-wind {
    font-size: 11px;
    color: #7f8c8d;
    margin-top: 4px;
}

/* Navigation améliorée */
.wbmeteo-navigation {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 15px;
    padding: 0 10px;
}

.wbmeteo-nav-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 8px 12px;
    border: none;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.2);
    color: #34495e;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 60px;
    font-size: 12px;
}

.wbmeteo-nav-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
}

.wbmeteo-nav-btn.active {
    background: rgba(74, 144, 226, 0.8);
    color: white;
}

.wbmeteo-nav-icon {
    font-size: 16px;
}

.wbmeteo-nav-label {
    font-size: 10px;
    text-align: center;
    line-height: 1.2;
}

/* Responsive pour la navigation */
@media (max-width: 768px) {
    .wbmeteo-navigation {
        gap: 4px;
    }
    
    .wbmeteo-nav-btn {
        padding: 6px 8px;
        min-width: 50px;
    }
    
    .wbmeteo-nav-label {
        font-size: 9px;
    }
}

/* ========================================
   THÈME PERSONNALISÉ (CUSTOM)
   ======================================== */

/* Container principal pour thème custom */
.wbmeteo-theme-custom.wbmeteo-container {
    background: var(--custom-bg, rgba(255, 255, 255, 0.1));
    background-size: var(--custom-bg-size, auto);
    background-position: var(--custom-bg-position, center);
    background-repeat: no-repeat;
    opacity: var(--custom-opacity, 1);
    
    border: var(--custom-border-width, 1px) var(--custom-border-style, solid) var(--custom-border-color, #dddddd);
    border-radius: var(--custom-border-radius, 16px);
    
    box-shadow: var(--custom-box-shadow, 0 8px 32px rgba(0, 0, 0, 0.1));
    backdrop-filter: var(--custom-backdrop-filter, blur(10px));
}

/* Boutons de navigation pour thème custom */
.wbmeteo-theme-custom .wbmeteo-nav-button {
    background: var(--custom-btn-bg, #ffffff);
    border: var(--custom-btn-border-width, 1px) solid var(--custom-btn-border-color, #cccccc);
    border-radius: var(--custom-btn-border-radius, 8px);
    color: var(--custom-btn-text-color, #333333);
    transition: all 0.2s ease;
}

.wbmeteo-theme-custom .wbmeteo-nav-button:hover {
    background: var(--custom-btn-bg-hover, #f0f0f0);
    transform: translateY(-1px);
}

.wbmeteo-theme-custom .wbmeteo-nav-button:active {
    transform: translateY(0);
}

.wbmeteo-theme-custom .wbmeteo-nav-button.active {
    background: var(--custom-btn-bg-hover, #f0f0f0);
    border-color: var(--custom-btn-text-color, #333333);
}

/* Icônes des boutons pour thème custom */
.wbmeteo-theme-custom .wbmeteo-nav-button svg {
    color: var(--custom-btn-text-color, #333333);
}

/* Labels des boutons pour thème custom */
.wbmeteo-theme-custom .wbmeteo-nav-label {
    color: var(--custom-btn-text-color, #333333);
}

/* Adaptation responsive pour thème custom */
@media (max-width: 768px) {
    .wbmeteo-theme-custom .wbmeteo-nav-button {
        min-width: 45px;
        padding: 8px;
    }
    
    .wbmeteo-theme-custom .wbmeteo-nav-label {
        font-size: 9px;
    }
}