/*
 * Météo App - Styles personnalisés
 * Application météo régionale France
 */

/* ==========================================
   1. Variables personnalisées
   ========================================== */
:root {
    /* Couleurs principales */
    --meteo-primary: #3bafda;
    --meteo-primary-dark: #2d9bc7;
    --meteo-primary-rgb: 59, 175, 218;
    --meteo-secondary: #6658dd;
    --meteo-warning: #f7b731;
    --meteo-danger: #ee324d;
    --meteo-success: #1abc9c;
    --meteo-dark: #323a46;
    --meteo-light: #f8f9fa;
    
    /* Thème clair (défaut) */
    --bg-body: #ffffff;
    --bg-card: #ffffff;
    --bg-section: #f8f9fa;
    --bg-input: #ffffff;
    --text-primary: #323a46;
    --text-secondary: #7a7d84;
    --text-muted: #98a6ad;
    --border-color: #dee2e6;
    --shadow-color: rgba(154, 161, 171, 0.1);
    --navbar-bg: #ffffff;
    --footer-bg: #323a46;
}

/* Thème sombre */
[data-theme="dark"] {
    --bg-body: #1a1d21;
    --bg-card: #252930;
    --bg-section: #1e2227;
    --bg-input: #2d323a;
    --text-primary: #e4e6eb;
    --text-secondary: #b0b3b8;
    --text-muted: #8a8d91;
    --border-color: #3e4451;
    --shadow-color: rgba(0, 0, 0, 0.3);
    --navbar-bg: #252930;
    --footer-bg: #1a1d21;
}

/* Couleurs d'accent */
[data-color="blue"] {
    --meteo-primary: #3bafda;
    --meteo-primary-dark: #2d9bc7;
    --meteo-primary-rgb: 59, 175, 218;
}

[data-color="purple"] {
    --meteo-primary: #6658dd;
    --meteo-primary-dark: #5548c8;
    --meteo-primary-rgb: 102, 88, 221;
}

[data-color="green"] {
    --meteo-primary: #1abc9c;
    --meteo-primary-dark: #16a085;
    --meteo-primary-rgb: 26, 188, 156;
}

[data-color="orange"] {
    --meteo-primary: #f7b731;
    --meteo-primary-dark: #e5a72a;
    --meteo-primary-rgb: 247, 183, 49;
}

[data-color="red"] {
    --meteo-primary: #ee324d;
    --meteo-primary-dark: #d62b43;
    --meteo-primary-rgb: 238, 50, 77;
}

[data-color="pink"] {
    --meteo-primary: #e83e8c;
    --meteo-primary-dark: #d63384;
    --meteo-primary-rgb: 232, 62, 140;
}

[data-color="royal"] {
    --meteo-primary: #2454af;
    --meteo-primary-dark: #1e4691;
    --meteo-primary-rgb: 36, 84, 175;
}

[data-color="teal"] {
    --meteo-primary: #00bcd4;
    --meteo-primary-dark: #00a5bb;
    --meteo-primary-rgb: 0, 188, 212;
}

[data-color="indigo"] {
    --meteo-primary: #3f51b5;
    --meteo-primary-dark: #36459c;
    --meteo-primary-rgb: 63, 81, 181;
}

[data-color="amber"] {
    --meteo-primary: #ffb300;
    --meteo-primary-dark: #e6a200;
    --meteo-primary-rgb: 255, 179, 0;
}

[data-color="coral"] {
    --meteo-primary: #ff7043;
    --meteo-primary-dark: #e65c32;
    --meteo-primary-rgb: 255, 112, 67;
}

[data-color="cyan"] {
    --meteo-primary: #00acc1;
    --meteo-primary-dark: #0097a7;
    --meteo-primary-rgb: 0, 172, 193;
}

/* ==========================================
   1.1 Application du thème
   ========================================== */
body {
    background-color: var(--bg-body);
    color: var(--text-primary);
    transition: background-color 0.3s ease, color 0.3s ease;
}

.card {
    background-color: var(--bg-card);
    color: var(--text-primary);
}

.bg-light {
    background-color: var(--bg-section) !important;
}

.text-muted {
    color: var(--text-muted) !important;
}

.form-control {
    background-color: var(--bg-input);
    border-color: var(--border-color);
    color: var(--text-primary);
}

.form-control:focus {
    background-color: var(--bg-input);
    color: var(--text-primary);
}

/* Navbar adaptative au thème */
[data-theme="dark"] .navbar-custom {
    background-color: var(--navbar-bg) !important;
}

[data-theme="dark"] .navbar-custom .nav-link {
    color: var(--text-secondary) !important;
}

[data-theme="dark"] .navbar-custom .nav-link:hover {
    color: var(--meteo-primary) !important;
}

[data-theme="dark"] .footer {
    background-color: var(--footer-bg) !important;
}

/* ==========================================
   1.2 Panneau de personnalisation
   ========================================== */
.theme-panel {
    position: fixed;
    top: 50%;
    right: 0;
    transform: translateY(-50%);
    z-index: 1050;
}

.theme-panel-toggle {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 45px;
    height: 45px;
    background: var(--meteo-primary);
    border: none;
    border-radius: 8px 0 0 8px;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    box-shadow: -3px 0 10px var(--shadow-color);
    transition: all 0.3s ease;
}

.theme-panel-toggle:hover {
    background: var(--meteo-primary-dark);
    width: 50px;
}

.theme-panel-content {
    position: absolute;
    right: -280px;
    top: 50%;
    transform: translateY(-50%);
    width: 260px;
    background: var(--bg-card);
    border-radius: 8px 0 0 8px;
    box-shadow: -5px 0 25px var(--shadow-color);
    padding: 20px;
    transition: right 0.3s ease;
}

.theme-panel.open .theme-panel-content {
    right: 0;
}

.theme-panel.open .theme-panel-toggle {
    right: 260px;
}

.theme-panel-title {
    color: var(--text-primary);
    font-weight: 600;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
}

.theme-option-label {
    display: block;
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.color-options {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.color-option {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 3px solid transparent;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.color-option:hover {
    transform: scale(1.1);
}

.color-option.active {
    border-color: var(--text-primary);
}

.color-option.active::after {
    content: '\F012C';
    font-family: 'Material Design Icons';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 14px;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

.theme-mode-btn.active {
    background-color: var(--meteo-primary) !important;
    border-color: var(--meteo-primary) !important;
    color: white !important;
}

/* Bouton toggle rapide dans la navbar */
.theme-toggle-btn {
    background: transparent;
    border: 2px solid var(--border-color);
    color: var(--text-primary);
    border-radius: 50%;
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.theme-toggle-btn:hover {
    background: var(--meteo-primary);
    border-color: var(--meteo-primary);
    color: white;
}

[data-theme="dark"] .theme-toggle-btn {
    border-color: var(--border-color);
    color: var(--text-secondary);
}

[data-theme="dark"] #theme-icon::before {
    content: '\F0594'; /* mdi-weather-night */
}

/* ==========================================
   2. Hero Section Météo
   ========================================== */
.bg-home {
    min-height: 500px;
    padding-top: 120px;
    padding-bottom: 80px;
}

.search-box {
    max-width: 700px;
    margin: 0 auto;
}

.search-box .form-control:focus {
    border-color: var(--meteo-primary);
    box-shadow: 0 0 0 0.2rem rgba(59, 175, 218, 0.25);
}

.quick-city {
    margin: 2px;
}

.quick-city:hover {
    background-color: var(--meteo-primary);
    color: white;
    border-color: var(--meteo-primary);
}

/* ==========================================
   3. Cartes météo
   ========================================== */
.card {
    border: none;
    border-radius: 10px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.1) !important;
}

.temperature-display h1 {
    font-weight: 300;
    line-height: 1;
}

/* ==========================================
   4. Icônes météo
   ========================================== */
.weather-icon-sunny {
    color: #f7b731 !important;
}

.weather-icon-cloudy {
    color: #7a7d84 !important;
}

.weather-icon-rainy {
    color: #3bafda !important;
}

.weather-icon-snowy {
    color: #a5b1c2 !important;
}

.weather-icon-stormy {
    color: #6658dd !important;
}

/* ==========================================
   5. Région cards
   ========================================== */
.region-card {
    cursor: pointer;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
}

.region-card:hover {
    background: linear-gradient(135deg, var(--meteo-primary) 0%, var(--meteo-secondary) 100%);
}

.region-card:hover h5,
.region-card:hover small,
.region-card:hover i {
    color: white !important;
}

/* ==========================================
   6. Prévisions
   ========================================== */
.forecast-card {
    text-align: center;
    padding: 20px;
    background: white;
    border-radius: 10px;
    margin-bottom: 15px;
}

.forecast-card .day-name {
    font-weight: 600;
    color: var(--meteo-dark);
    margin-bottom: 10px;
}

.forecast-card .forecast-icon {
    font-size: 2.5rem;
    margin-bottom: 10px;
}

.forecast-card .temp-high {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--meteo-primary);
}

.forecast-card .temp-low {
    font-size: 1rem;
    color: #7a7d84;
}

.forecast-card .precipitation {
    font-size: 0.85rem;
    color: var(--meteo-primary);
    margin-top: 5px;
}

/* ==========================================
   7. Loading et états
   ========================================== */
#loading {
    padding: 60px 0;
}

#error-message {
    max-width: 600px;
    margin: 20px auto;
}

#initial-message {
    padding: 60px 0;
}

#initial-message i {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.7;
        transform: scale(1.1);
    }
}

/* ==========================================
   8. Animations
   ========================================== */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==========================================
   9. Responsive
   ========================================== */
@media (max-width: 768px) {
    .bg-home {
        min-height: auto;
        padding-top: 100px;
        padding-bottom: 60px;
    }
    
    .home-title {
        font-size: 1.8rem;
    }
    
    .temperature-display h1 {
        font-size: 4rem;
    }
    
    .quick-city {
        font-size: 0.75rem;
        padding: 3px 8px;
    }
}

@media (max-width: 576px) {
    .search-box {
        padding: 15px !important;
    }
    
    .temperature-display h1 {
        font-size: 3rem;
    }
    
    #weather-icon i {
        font-size: 4rem !important;
    }
}

/* ==========================================
   10. Améliorations UI
   ========================================== */
.btn-primary {
    background-color: var(--meteo-primary);
    border-color: var(--meteo-primary);
}

.btn-primary:hover {
    background-color: #2d9bc7;
    border-color: #2d9bc7;
}

.text-primary {
    color: var(--meteo-primary) !important;
}

.bg-primary {
    background-color: var(--meteo-primary) !important;
}

/* Scroll smooth */
html {
    scroll-behavior: smooth;
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: var(--meteo-primary);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #2d9bc7;
}

/* ==========================================
   11. reCAPTCHA Badge
   ========================================== */
/* Rendre le badge reCAPTCHA visible */
.grecaptcha-badge {
    visibility: visible !important;
    opacity: 1 !important;
    z-index: 9999 !important;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2) !important;
}

/* Indicateur visuel que reCAPTCHA est actif (optionnel) */
.recaptcha-protected::before {
    content: "\F0C10"; /* mdi-shield-check */
    font-family: "Material Design Icons";
    color: var(--meteo-primary);
    margin-right: 5px;
}

/* Notice reCAPTCHA dans le footer */
.recaptcha-notice {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 10px;
}

.recaptcha-notice a {
    color: var(--meteo-primary);
    text-decoration: none;
}

.recaptcha-notice a:hover {
    text-decoration: underline;
}
