/* ========================================
   VARIABLES CSS (Mode clair/sombre)
   ======================================== */
:root {
    /* Mode clair (par défaut) */
    --bg-color: #0f0c29;
    --bg-overlay: rgba(0, 0, 0, 0.35);
    --text-color: rgb(255, 255, 255);
    --glass-bg: rgba(255, 255, 255, 0.1);
    --glass-border: rgba(255, 255, 255, 0.15);
    --glass-hover-bg: rgba(255, 255, 255, 0.15);
    --shadow-color: rgba(0, 0, 0, 0.2);
    --input-placeholder: rgba(255, 255, 255, 0.6);
    --accent-color: #ffce54;
    --error-color: #ff6b6b;
}

[data-theme="dark"] {
    --bg-color: #1a1a2e;
    --bg-overlay: rgba(0, 0, 0, 0.5);
    --text-color: rgb(230, 230, 230);
    --glass-bg: rgba(20, 20, 40, 0.6);
    --glass-border: rgba(255, 255, 255, 0.1);
    --glass-hover-bg: rgba(40, 40, 60, 0.7);
    --shadow-color: rgba(0, 0, 0, 0.5);
    --input-placeholder: rgba(200, 200, 200, 0.5);
    --accent-color: #ffd93d;
    --error-color: #ff5252;
}

/* ========================================
   RESET & BASE
   ======================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    overflow-x: hidden;
    max-width: 100vw;
}

body {
    font-family: 'Inter', sans-serif;
    color: var(--text-color);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    overflow-x: hidden;
    background-color: var(--bg-color);
    transition: background-color 0.3s ease, color 0.3s ease;
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 0;
    padding-bottom: 40px;
    position: relative;
}

/* ========================================
   ACCESSIBILITÉ
   ======================================== */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

*:focus-visible {
    outline: 2px solid var(--accent-color);
    outline-offset: 2px;
    border-radius: 4px;
}

/* ========================================
   ARRIÈRE-PLAN
   ======================================== */
.background-globes {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background-color: var(--bg-color);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    transition: opacity 1.75s cubic-bezier(0.4, 0, 0.2, 1),
        transform 1.75s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: opacity, transform;
}

.background-globes::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-overlay);
    pointer-events: none;
    transition: background 0.3s ease;
}

/* ========================================
   CRÉDIT PHOTOGRAPHE PEXELS
   ======================================== */
.photo-credit {
    position: fixed;
    bottom: 10px;
    right: 12px;
    z-index: 100;
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.55);
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(4px);
    padding: 4px 10px;
    border-radius: 12px;
    transition: opacity 0.3s ease;
    pointer-events: auto;
}

.photo-credit:hover {
    color: rgba(255, 255, 255, 0.9);
    background: rgba(0, 0, 0, 0.5);
}

.photo-credit a {
    color: inherit;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.photo-credit a:hover {
    color: var(--accent-color);
}

/* ========================================
   CRÉDIT AUTEUR / CONTACT
   ======================================== */
.author-credit {
    position: fixed;
    bottom: 10px;
    left: 12px;
    z-index: 100;
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.55);
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(4px);
    padding: 4px 10px;
    border-radius: 12px;
    transition: opacity 0.3s ease, color 0.3s ease, background 0.3s ease;
    pointer-events: auto;
}

.author-credit:hover {
    color: rgba(255, 255, 255, 0.9);
    background: rgba(0, 0, 0, 0.5);
}

.author-credit a {
    color: inherit;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
}

.author-credit a:hover {
    color: var(--accent-color);
}

/* --- Lien mentions legales --- */
.legal-link {
    position: fixed;
    bottom: 40px;
    left: 22px;
    z-index: 99;
    font-size: 0.6rem;
}

.legal-link a {
    color: rgba(255, 255, 255, 0.35);
    text-decoration: none;
    transition: color 0.3s ease;
}

.legal-link a:hover {
    color: rgba(255, 255, 255, 0.7);
}

/* --- Modal de contact --- */
.contact-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease-out;
}

.contact-modal {
    position: relative;
    background: rgba(30, 30, 50, 0.9);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 30px;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.3s ease-out;
}

.contact-close {
    position: absolute;
    top: 12px;
    right: 16px;
    background: none;
    border: none;
    color: var(--text-color);
    font-size: 1.5rem;
    cursor: pointer;
    opacity: 0.6;
    transition: opacity 0.2s ease, transform 0.2s ease;
    line-height: 1;
}

.contact-close:hover {
    opacity: 1;
    transform: scale(1.2);
}

.contact-title {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 20px;
    color: var(--text-color);
    text-align: center;
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.contact-label {
    font-size: 0.8rem;
    font-weight: 500;
    opacity: 0.8;
    color: var(--text-color);
}

.contact-input,
.contact-textarea {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    padding: 10px 12px;
    color: var(--text-color);
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    outline: none;
    transition: border-color 0.3s ease, background 0.3s ease;
    resize: vertical;
}

.contact-input:focus,
.contact-textarea:focus {
    border-color: var(--accent-color);
    background: rgba(255, 255, 255, 0.12);
}

.contact-input::placeholder,
.contact-textarea::placeholder {
    color: var(--input-placeholder);
}

.contact-textarea {
    min-height: 80px;
    max-height: 200px;
}

.contact-submit {
    background: var(--accent-color);
    color: #000;
    border: none;
    border-radius: 10px;
    padding: 10px 20px;
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-top: 5px;
}

.contact-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(255, 206, 84, 0.4);
}

.contact-submit:active {
    transform: translateY(0);
}

/* ========================================
   CONTRÔLES EN HAUT (Unités + Dark Mode)
   ======================================== */
.top-controls {
    position: fixed;
    top: 20px;
    left: 20px;
    display: flex;
    gap: 10px;
    z-index: 1000;
    max-width: calc(100vw - 40px);
}

/* Sélecteur d'unités */
.unit-selector {
    display: flex;
    background: var(--glass-bg);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    padding: 4px;
    box-shadow: 0 4px 10px var(--shadow-color);
}

.unit-btn {
    background: transparent;
    border: none;
    color: var(--text-color);
    padding: 8px 16px;
    font-size: 0.9rem;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    opacity: 0.6;
}

.unit-btn:hover {
    opacity: 0.9;
}

.unit-btn.active {
    background: var(--accent-color);
    color: #000;
    opacity: 1;
}

/* Sélecteur de langue */
.lang-selector {
    display: flex;
    background: var(--glass-bg);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    padding: 4px;
    box-shadow: 0 4px 10px var(--shadow-color);
}

.lang-btn {
    background: transparent;
    border: none;
    color: var(--text-color);
    padding: 6px 10px;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    opacity: 0.6;
    font-family: 'Inter', sans-serif;
}

.lang-btn:hover {
    opacity: 0.9;
    background: rgba(255, 255, 255, 0.1);
}

.lang-btn.active {
    background: var(--accent-color);
    color: #000;
    opacity: 1;
}

/* Toggle mode sombre */
.dark-mode-toggle {
    background: var(--glass-bg);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 10px var(--shadow-color);
    color: var(--text-color);
}

.dark-mode-toggle:hover {
    background: var(--glass-hover-bg);
    transform: scale(1.05);
}

.dark-mode-toggle svg {
    transition: opacity 0.2s ease;
}

/* Bouton Buy Me a Coffee */
.bmc-button {
    background: var(--glass-bg);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid var(--accent-color);
    /* Bordure jaune style site */
    border-radius: 10px;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 10px var(--shadow-color);
    color: var(--accent-color);
    /* Icône jaune par défaut */
    text-decoration: none;
}

.bmc-button:hover {
    background: var(--glass-hover-bg);
    transform: scale(1.05);
    background-color: var(--accent-color);
    color: #000;
    /* Inversion au survol pour lisibilité */
}

/* ========================================
   CONTAINER PRINCIPAL
   ======================================== */
.container {
    width: 100%;
    max-width: 1400px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 30px;
    z-index: 1;
    margin: 0 auto;
}

/* ========================================
   EN-TÊTE
   ======================================== */
.app-header {
    text-align: center;
    display: flex;
    justify-content: center;
    align-items: center;
}

.app-header h1 {
    text-align: center;
    font-weight: 700;
    font-size: 2.5rem;
    background: linear-gradient(to right, var(--text-color), var(--accent-color));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 4px 10px var(--shadow-color);
    letter-spacing: -1px;
}

.app-logo {
    height: 100px;
    width: auto;
    filter: drop-shadow(0 4px 10px var(--shadow-color));
    transition: transform 0.3s ease;
}

.app-logo:hover {
    transform: scale(1.05);
}

/* ========================================
   RECHERCHE
   ======================================== */
.search-section {
    display: flex;
    flex-direction: column;
    gap: 10px;
    position: relative;
    z-index: 100;
    width: 100%;
    max-width: 100%;
}

.search-box {
    position: relative;
    display: flex;
    align-items: center;
    background: var(--glass-bg);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 5px 15px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px var(--shadow-color);
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.search-box:focus-within {
    background: var(--glass-hover-bg);
    border-color: var(--accent-color);
    transform: translateY(-2px);
    box-shadow: 0 8px 15px var(--shadow-color);
}

#city-input {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-color);
    font-size: 1.1rem;
    padding: 12px 10px;
    outline: none;
    font-weight: 500;
}

#city-input::placeholder {
    color: var(--input-placeholder);
}

#geoloc-btn {
    background: transparent;
    border: none;
    color: var(--text-color);
    cursor: pointer;
    padding: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.5;
    transition: opacity 0.2s, transform 0.2s;
    border-radius: 8px;
}

#geoloc-btn:hover {
    opacity: 1;
    transform: scale(1.1);
}

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

#search-btn {
    background: transparent;
    border: none;
    color: var(--text-color);
    cursor: pointer;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.8;
    transition: opacity 0.2s, transform 0.2s;
    border-radius: 8px;
}

#search-btn:hover:not(:disabled) {
    opacity: 1;
    transform: scale(1.1);
}

.spinner {
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: var(--accent-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.error-msg {
    color: var(--error-color);
    font-size: 0.9rem;
    text-align: center;
    margin-top: 5px;
    padding: 8px;
    background: rgba(255, 107, 107, 0.1);
    border-radius: 8px;
    animation: shake 0.4s ease-in-out;
}

@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-5px);
    }

    75% {
        transform: translateX(5px);
    }
}

.hidden {
    display: none !important;
}

/* ========================================
   SUGGESTIONS AUTOCOMPLETE
   ======================================== */
.suggestions-container {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: rgba(40, 40, 60, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--accent-color);
    border-radius: 12px;
    margin-top: 5px;
    max-height: 300px;
    overflow-y: auto;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    z-index: 1000;
}

.suggestion-item {
    padding: 12px 15px;
    cursor: pointer;
    border-bottom: 1px solid var(--glass-border);
    transition: background 0.2s;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.suggestion-item:last-child {
    border-bottom: none;
}

.suggestion-item:hover,
.suggestion-item.active {
    background: var(--glass-hover-bg);
}

.suggestion-city {
    font-weight: 600;
    font-size: 0.95rem;
    color: #0f0c29;
}

.suggestion-details {
    font-size: 0.8rem;
    opacity: 0.7;
    color: #0f0c29;
}

/* Mode sombre - suggestions avec texte clair */
[data-theme="dark"] .suggestion-city {
    color: rgb(230, 230, 230);
}

[data-theme="dark"] .suggestion-details {
    color: rgb(230, 230, 230);
}

/* ========================================
   PANNEAUX (Cards)
   ======================================== */
.grid-2col {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.panel,
.current-weather-panel,
.hourly-panel,
.weekly-panel,
.map-panel,
.chart-panel,
.nasa-panel,
.alerts-panel,
.aqi-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(0px);
    -webkit-backdrop-filter: blur(0px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 25px;
    box-shadow: 0 8px 20px var(--shadow-color);
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
    animation: fadeIn 0.6s ease-out;
}

.panel:hover,
.current-weather-panel:hover,
.hourly-panel:hover,
.weekly-panel:hover,
.map-panel:hover,
.chart-panel:hover,
.nasa-panel:hover,
.alerts-panel:hover,
.aqi-panel:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 30px var(--shadow-color);
    border-color: rgba(255, 255, 255, 0.2);
}

.card-glass {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    height: 100%;
    width: 100%;
    gap: 4px;
}

.weather-card > .card-glass {
    position: relative;
    z-index: 2;
}

.card-title {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 20px;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: var(--text-color);
}

.panel-title {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 15px;
    text-align: center;
    color: var(--text-color);
    width: 100%;
    word-wrap: break-word;
}

/* ========================================
   RAFRAÎCHISSEMENT
   ======================================== */
.refresh-container {
    display: flex;
    justify-content: center;
    margin-top: 20px;
}

#refresh-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--glass-bg);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 10px 20px;
    color: var(--text-color);
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 10px var(--shadow-color);
}

#refresh-btn:hover:not(:disabled) {
    background: var(--glass-hover-bg);
    transform: translateY(-2px);
    box-shadow: 0 6px 15px var(--shadow-color);
}

#refresh-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

#refresh-btn svg {
    width: 18px;
    height: 18px;
}

#refresh-btn.spinning svg {
    animation: spin 1s linear infinite;
}

/* ========================================
   CARTE
   ======================================== */
.map-panel {
    overflow: hidden;
}

.city-map {
    position: relative;
    width: 100%;
    max-width: 100%;
    height: 300px;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 10px var(--shadow-color);
}

/* Fix pour Leaflet responsive */
.city-map .leaflet-container {
    width: 100%;
    height: 100%;
}

/* Thème de la carte : moins lumineux / plus doux */
.city-map .leaflet-tile-pane {
    filter: brightness(0.9) saturate(0.8) contrast(0.9);
    transition: filter 0.5s ease;
}

/* Thème sombre pour la carte (inversion des couleurs) */
[data-theme="dark"] .city-map .leaflet-tile-pane {
    filter: invert(1) hue-rotate(180deg) brightness(1.2) contrast(0.9) saturate(0.4);
}

/* Attribution Leaflet discrète */
.city-map .leaflet-control-attribution {
    font-size: 9px;
    background: rgba(255, 255, 255, 0.4);
    padding: 1px 5px;
    opacity: 0.5;
    transition: opacity 0.3s ease;
}

.city-map .leaflet-control-attribution:hover {
    opacity: 1;
}

[data-theme="dark"] .city-map .leaflet-control-attribution {
    background: rgba(0, 0, 0, 0.3);
    color: rgba(255, 255, 255, 0.6);
}

[data-theme="dark"] .city-map .leaflet-control-attribution a {
    color: rgba(255, 255, 255, 0.7);
}

/* Overlay "Tap to activate" pour la carte */
.map-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
    cursor: pointer;
    transition: opacity 0.3s ease;
}

.map-overlay-hidden {
    opacity: 0;
    pointer-events: none;
}

.map-overlay-text {
    position: absolute;
    bottom: 6px;
    left: 6px;
    background: rgba(0, 0, 0, 0.45);
    color: rgba(255, 255, 255, 0.8);
    padding: 4px 10px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 400;
    backdrop-filter: blur(4px);
    pointer-events: none;
    user-select: none;
}

/* ========================================
   HISTORIQUE DE RECHERCHE
   ======================================== */
.search-history {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 8px;
    padding: 0 5px;
    font-size: 0.9rem;
    color: var(--text-color);
    animation: fadeIn 0.4s ease-out;
}

.history-label {
    opacity: 0.7;
    font-style: italic;
    font-size: 0.85rem;
}

.history-items {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.history-chip {
    background: rgba(255, 255, 255, 0.15);
    padding: 4px 10px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid transparent;
    font-size: 0.85rem;
}

.history-chip:hover {
    background: var(--accent-color);
    color: #000;
    transform: translateY(-1px);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

[data-theme="dark"] .history-chip {
    background: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .history-chip:hover {
    background: var(--accent-color);
    color: #000;
}


/* ========================================
   MÉTÉO ACTUELLE
   ======================================== */
.weather-card {
    width: 100%;
    position: relative;
    overflow: hidden;
    border-radius: 20px;
}

/* ---- Effets météo dynamiques ---- */
.weather-fx {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 1;
    overflow: hidden;
    border-radius: 20px;
}

/* -- Pluie -- */
.fx-drop {
    position: absolute;
    top: -10px;
    width: 2px;
    background: linear-gradient(to bottom, transparent, rgba(108, 198, 255, 0.6));
    border-radius: 0 0 2px 2px;
    animation: fxRainFall linear infinite;
}

@keyframes fxRainFall {
    0% {
        transform: translateY(-10px);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    100% {
        transform: translateY(500px);
        opacity: 0.3;
    }
}

/* -- Neige -- */
.fx-flake {
    position: absolute;
    top: -8px;
    width: 6px;
    height: 6px;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 50%;
    filter: blur(1px);
    animation: fxSnowFall linear infinite;
}

@keyframes fxSnowFall {
    0% {
        transform: translateY(-10px) translateX(0) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    100% {
        transform: translateY(500px) translateX(30px) rotate(360deg);
        opacity: 0.2;
    }
}

/* -- Orage (flash) -- */
.fx-flash {
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0);
    border-radius: 20px;
    animation: fxLightningFlash 4s ease-in-out infinite;
}

@keyframes fxLightningFlash {
    0%, 100% {
        background: rgba(255, 255, 255, 0);
    }
    92% {
        background: rgba(255, 255, 255, 0);
    }
    93% {
        background: rgba(255, 255, 255, 0.15);
    }
    94% {
        background: rgba(255, 255, 255, 0);
    }
    96% {
        background: rgba(255, 255, 255, 0.25);
    }
    97% {
        background: rgba(255, 255, 255, 0);
    }
}

/* -- Brouillard -- */
.fx-mist {
    position: absolute;
    width: 200%;
    height: 40%;
    background: linear-gradient(90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.06) 20%,
        rgba(255, 255, 255, 0.12) 50%,
        rgba(255, 255, 255, 0.06) 80%,
        transparent 100%);
    border-radius: 50%;
    filter: blur(8px);
    animation: fxMistDrift linear infinite;
}

@keyframes fxMistDrift {
    0% {
        transform: translateX(-50%);
    }
    100% {
        transform: translateX(10%);
    }
}

/* -- Soleil (particules dorées) -- */
.fx-sunmote {
    position: absolute;
    width: 4px;
    height: 4px;
    background: rgba(255, 206, 84, 0.5);
    border-radius: 50%;
    filter: blur(1px);
    animation: fxSunFloat ease-in-out infinite;
}

@keyframes fxSunFloat {
    0%, 100% {
        transform: translateY(0) scale(1);
        opacity: 0.3;
    }
    50% {
        transform: translateY(-20px) scale(1.3);
        opacity: 0.7;
    }
}

/* -- Nuit (étoiles) -- */
.fx-star {
    position: absolute;
    width: 3px;
    height: 3px;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 50%;
    animation: fxStarTwinkle ease-in-out infinite;
}

@keyframes fxStarTwinkle {
    0%, 100% {
        opacity: 0.2;
        transform: scale(0.8);
    }
    50% {
        opacity: 0.9;
        transform: scale(1.2);
    }
}

/* Respect prefers-reduced-motion */
@media (prefers-reduced-motion: reduce) {
    .weather-fx * {
        animation: none !important;
        opacity: 0.3 !important;
    }
}

.weather-header,
.weather-body,
.weather-details {
    width: 100%;
    max-width: 100%;
}

.current-weather-panel .card-glass {
    gap: 10px;
}

.city-name-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 5px;
}

.city-name {
    font-size: 2.2rem;
    font-weight: 600;
    color: var(--text-color);
}

#city-name {
    max-width: 100%;
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
}

.country-flag {
    font-size: 2.5rem;
}

.current-time {
    font-size: 1.1rem;
    opacity: 0.7;
    margin-bottom: 15px;
    color: var(--text-color);
}

.weather-display {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    margin: 10px 0;
}

.weather-body {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
}

.weather-icon-main {
    width: 130px;
    height: 130px;
    display: flex;
    justify-content: center;
    align-items: center;
    filter: drop-shadow(0 0 15px rgba(255, 255, 255, 0.3));
}

.weather-icon-main svg {
    width: 100%;
    height: 100%;
}

.temp-wrapper {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    line-height: 1;
}

.temp-value {
    font-size: 6rem;
    font-weight: 700;
    letter-spacing: -2px;
    color: var(--text-color);
}

.temp-unit {
    font-size: 3rem;
    font-weight: 400;
    margin-top: 10px;
    opacity: 0.8;
    color: var(--text-color);
}

.weather-desc {
    font-size: 1.4rem;
    font-weight: 500;
    opacity: 0.9;
    text-transform: capitalize;
    background: rgba(0, 0, 0, 0.2);
    padding: 8px 20px;
    border-radius: 20px;
    margin-top: 10px;
    color: var(--text-color);
}

.country-saying {
    font-style: italic;
    font-size: 1.3rem;
    opacity: 0.85;
    margin-top: 25px;
    padding: 10px;
    border-top: 1px solid var(--glass-border);
    max-width: 80%;
    line-height: 1.4;
    color: var(--accent-color);
}

.weather-details {
    display: flex;
    justify-content: space-around;
    align-items: center;
    width: 100%;
    margin-top: 10px;
}

.detail-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.detail-label {
    font-size: 1rem;
    opacity: 0.7;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.detail-value {
    font-size: 1.3rem;
    font-weight: 600;
}

.detail-divider {
    width: 1px;
    height: 50px;
    background: var(--glass-border);
}

/* ========================================
   PRÉVISIONS HORAIRES
   ======================================== */
.hourly-panel {
    overflow: hidden;
}

.hourly-scroll-container {
    display: flex;
    gap: 15px;
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 10px;
    scrollbar-width: thin;
    scrollbar-color: var(--glass-border) transparent;
    cursor: grab;
    user-select: none;
    -webkit-overflow-scrolling: touch;
}

.hourly-scroll-container.grabbing {
    cursor: grabbing;
}

.hourly-scroll-container::-webkit-scrollbar {
    height: 6px;
}

.hourly-scroll-container::-webkit-scrollbar-thumb {
    background: var(--glass-border);
    border-radius: 10px;
}

.hourly-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    min-width: 70px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 14px;
    transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
    border: 1px solid transparent;
}

.hourly-item:hover {
    transform: translateY(-3px);
    background: var(--glass-hover-bg);
    border-color: rgba(255, 255, 255, 0.08);
}

.hourly-time {
    font-size: 0.85rem;
    font-weight: 500;
}

.hourly-icon {
    width: 32px;
    height: 32px;
}

.hourly-temp {
    font-size: 1.1rem;
    font-weight: 700;
}

/* ========================================
   SÉPARATEUR TENDANCE (entre liste et graphique)
   ======================================== */
.trend-separator {
    display: flex;
    align-items: center;
    gap: 16px;
    width: 100%;
    margin: 20px 0 16px;
    padding: 0 4px;
}

.trend-line {
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--glass-border), transparent);
}

.trend-label {
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--accent-color);
    white-space: nowrap;
    opacity: 0.9;
}

/* ========================================
   GRAPHIQUE TEMPÉRATURE
   ======================================== */
.temperature-chart-container {
    width: 100%;
    max-width: 700px;
    height: 200px;
    position: relative;
    margin: 0 auto;
}

#temperature-chart {
    width: 100% !important;
    max-width: 100%;
    max-height: 200px;
    height: auto !important;
}

/* ========================================
   PRÉVISIONS HEBDOMADAIRES
   ======================================== */
/* Sélecteur de période (7j / 14j) */
.forecast-days-selector {
    display: flex;
    justify-content: center;
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    padding: 3px;
    margin-bottom: 16px;
    width: fit-content;
    align-self: center;
}

.forecast-days-btn {
    background: transparent;
    border: none;
    color: var(--text-color);
    padding: 6px 18px;
    font-size: 0.85rem;
    font-weight: 600;
    border-radius: 7px;
    cursor: pointer;
    transition: all 0.2s ease;
    opacity: 0.6;
    font-family: 'Inter', sans-serif;
    white-space: nowrap;
}

.forecast-days-btn:hover {
    opacity: 0.9;
    background: rgba(255, 255, 255, 0.1);
}

.forecast-days-btn.active {
    background: var(--accent-color);
    color: #000;
    opacity: 1;
}

.weekly-panel {
    overflow: hidden;
}

.weekly-panel .card-glass {
    align-items: center;
    width: 100%;
}

.weekly-list {
    width: 100%;
    max-width: 700px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 0 auto;
}

.weekly-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 11px 16px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    transition: background 0.2s ease, transform 0.2s ease;
    border: 1px solid transparent;
}

.weekly-item:hover {
    background: var(--glass-hover-bg);
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.08);
}

.weekly-day {
    flex: 1;
    font-weight: 500;
    font-size: 0.95rem;
}

.weekly-icon-wrapper {
    flex: 1;
    display: flex;
    justify-content: center;
}

.weekly-icon {
    width: 28px;
    height: 28px;
}

.weekly-temp-range {
    flex: 1;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    font-size: 0.95rem;
}

.temp-max {
    font-weight: 700;
}

.temp-min {
    opacity: 0.6;
}

/* ========================================
   HORLOGE MONDIALE
   ======================================== */
.clock-widget {
    position: relative;
    margin: 30px auto 20px;
    width: fit-content;
    background: var(--glass-bg);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 12px 18px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    z-index: 1000;
    box-shadow: 0 4px 10px var(--shadow-color);
    animation: fadeIn 1s ease-out;
}

.date-display {
    text-align: center;
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 6px;
    opacity: 0.9;
    border-bottom: 1px solid var(--glass-border);
    padding-bottom: 6px;
}

.time-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    font-size: 0.9rem;
}

.time-label {
    font-weight: 400;
    opacity: 0.7;
    font-size: 0.8rem;
    text-transform: uppercase;
    min-width: 45px;
}

#time-utc,
#time-local {
    font-weight: 600;
    font-family: 'Inter', monospace;
    min-width: 50px;
    text-align: right;
}

/* ========================================
   MESSAGE DE BIENVENUE
   ======================================== */
.welcome-message {
    text-align: center;
    padding: 40px 30px;
    background: var(--glass-bg);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    margin-top: 20px;
    animation: fadeIn 0.8s ease-out;
    box-shadow: 0 8px 20px var(--shadow-color);
}

.welcome-message h2 {
    font-size: 2rem;
    margin-bottom: 10px;
    font-weight: 300;
}

.welcome-message p {
    font-size: 1rem;
    opacity: 0.8;
}

/* ========================================
   ANIMATIONS
   ======================================== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========================================
   DASHBOARD MÉTÉO - Disposition responsive
   ======================================== */
.weather-dashboard {
    display: grid;
    grid-template-columns: 1fr;
    gap: 18px;
    width: 100%;
}

/* Styles de base pour toutes les sections du dashboard */
.weather-card,
.map-panel,
.forecast-panel,
#weather-result,
#map-panel,
#hourly-forecast,
#weekly-forecast {
    width: 100%;
    max-width: 100%;
    overflow: hidden;
}

/* ========================================
   RESPONSIVE - GRANDS ÉCRANS (min-width: 1400px)
   ======================================== */
@media (min-width: 1400px) {
    .container {
        max-width: 1400px;
        padding: 30px;
        gap: 30px;
    }

    .weather-dashboard {
        grid-template-columns: repeat(2, 1fr);
        gap: 24px;
    }

    #weather-result {
        grid-column: 1;
        grid-row: 1 / 3;
    }

    #map-panel {
        grid-column: 2;
        grid-row: 1;
    }

    #hourly-forecast {
        grid-column: 2;
        grid-row: 2;
    }

    #weekly-forecast {
        grid-column: 1 / -1;
        grid-row: 3;
    }

    .app-logo {
        height: 110px;
    }

    .temp-value {
        font-size: 6rem;
    }

    .temp-unit {
        font-size: 3rem;
    }

    .city-name {
        font-size: 2.3rem;
    }

    .weather-icon-main {
        width: 140px;
        height: 140px;
    }

    .weather-desc {
        font-size: 1.4rem;
    }

    .detail-label {
        font-size: 1rem;
    }

    .detail-value {
        font-size: 1.4rem;
    }

    .country-saying {
        font-size: 1.3rem;
    }

    .panel,
    .current-weather-panel,
    .hourly-panel,
    .weekly-panel,
    .map-panel,
    .chart-panel,
    .nasa-panel,
    .alerts-panel,
    .aqi-panel {
        padding: 28px;
    }

    .city-map {
        height: 300px;
    }

    .temperature-chart-container {
        height: 220px;
    }

    .card-title,
    .panel-title {
        font-size: 1.4rem;
    }



    .aqi-panel:not(.hidden) {
        grid-column: 1 / -1;
    }

    .nasa-panel {
        grid-column: 1 / -1;
    }
}

/* ========================================
   RESPONSIVE - ÉCRANS MOYENS (1024px - 1400px)
   ======================================== */
@media (min-width: 1024px) and (max-width: 1399px) {
    .container {
        max-width: 1100px;
    }

    .weather-dashboard {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }

    #weather-result {
        grid-column: 1;
        grid-row: 1 / 3;
    }

    #map-panel {
        grid-column: 2;
        grid-row: 1;
    }

    #hourly-forecast {
        grid-column: 2;
        grid-row: 2;
    }

    #weekly-forecast {
        grid-column: 1 / -1;
        grid-row: 3;
    }



    .aqi-panel:not(.hidden) {
        grid-column: 1 / -1;
    }

    .nasa-panel {
        grid-column: 1 / -1;
    }
}

/* ========================================
   RESPONSIVE - TABLETTES (768px - 1024px)
   ======================================== */
@media (max-width: 1024px) and (min-width: 769px) {
    .container {
        max-width: 900px;
        padding: 15px;
        gap: 20px;
    }

    .weather-dashboard {
        grid-template-columns: repeat(2, 1fr);
        gap: 18px;
    }

    #weather-result {
        grid-column: 1 / -1;
    }

    #map-panel {
        grid-column: 1;
    }

    #hourly-forecast {
        grid-column: 2;
    }

    #weekly-forecast {
        grid-column: 1 / -1;
    }

    /* Secondary panels full width on tablet */
    .aqi-panel:not(.hidden) {
        grid-column: 1 / -1;
    }

    .nasa-panel {
        grid-column: 1 / -1;
    }

    .nasa-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .app-header h1 {
        font-size: 2.2rem;
    }

    .app-logo {
        height: 80px;
    }

    .temp-value {
        font-size: 4.5rem;
    }

    .temp-unit {
        font-size: 2.2rem;
    }

    .city-name {
        font-size: 1.6rem;
    }

    .weather-icon-main {
        width: 90px;
        height: 90px;
    }

    .grid-2col {
        gap: 15px;
    }

    .clock-widget {
        margin: 20px auto;
        padding: 10px 15px;
    }

    .top-controls {
        top: 15px;
        left: 15px;
    }

    .panel,
    .current-weather-panel,
    .hourly-panel,
    .weekly-panel,
    .map-panel,
    .chart-panel,
    .nasa-panel,
    .alerts-panel,
    .aqi-panel {
        padding: 22px;
    }
}

/* ========================================
   RESPONSIVE - TABLETTES PETITES / MOBILE (max-width: 768px)
   ======================================== */
@media (max-width: 768px) {
    body {
        align-items: flex-start;
        padding-top: 80px;
        overflow-x: hidden;
    }

    .container {
        padding: 12px;
        gap: 16px;
        max-width: 100vw;
        overflow-x: hidden;
    }

    /* Fix background scroll jank on mobile */
    .background-globes {
        will-change: auto;
        transition: opacity 1.75s ease;
        height: 100lvh;
        transform: translateZ(0);
        -webkit-backface-visibility: hidden;
        backface-visibility: hidden;
    }

    /* Dashboard single column */
    .weather-dashboard {
        grid-template-columns: 1fr;
        gap: 14px;
        width: 100%;
        max-width: 100%;
        overflow-x: hidden;
    }

    #weather-result,
    #map-panel,
    #hourly-forecast,
    #weekly-forecast,
    .nasa-panel,
    .alerts-panel,
    .aqi-panel {
        grid-column: 1;
        grid-row: auto;
        width: 100%;
        max-width: 100%;
    }

    /* Tableau meteo en premier sur mobile */
    #weather-result {
        order: -1;
    }

    /* Prevent overflow */
    .panel,
    .current-weather-panel,
    .hourly-panel,
    .weekly-panel,
    .map-panel,
    .chart-panel,
    .nasa-panel,
    .alerts-panel,
    .aqi-panel {
        max-width: 100%;
        overflow-x: hidden;
        box-sizing: border-box;
        padding: 18px;
        border-radius: 16px;
    }

    .card-glass {
        width: 100%;
        max-width: 100%;
        overflow-x: hidden;
    }

    .weather-header,
    .weather-body {
        max-width: 100%;
        overflow-x: hidden;
    }

    .app-header h1 {
        font-size: 1.8rem;
    }

    .app-logo {
        height: 70px;
    }

    .grid-2col {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    /* Top controls */
    .top-controls {
        flex-direction: row;
        flex-wrap: wrap;
        top: 10px;
        left: 10px;
        right: 10px;
        justify-content: space-between;
        max-width: none;
    }

    .unit-selector {
        flex: 1;
        min-width: 150px;
    }

    .unit-btn {
        padding: 6px 12px;
        font-size: 0.85rem;
    }

    .dark-mode-toggle {
        width: 40px;
        height: 40px;
    }

    /* Clock */
    .clock-widget {
        position: relative;
        margin: 20px auto;
        bottom: auto;
        left: auto;
        transform: none;
        max-width: 280px;
    }

    /* Search */
    #city-input {
        font-size: 1rem;
        padding: 10px 8px;
    }

    .search-box {
        padding: 4px 12px;
    }

    /* Current weather */
    .temp-value {
        font-size: 4rem;
    }

    .temp-unit {
        font-size: 2rem;
    }

    .city-name {
        font-size: 1.5rem;
    }

    .weather-icon-main {
        width: 80px;
        height: 80px;
    }

    .weather-desc {
        font-size: 1rem;
    }

    .country-saying {
        font-size: 1rem;
        max-width: 90%;
    }

    /* Weather details as row */
    .weather-details {
        flex-wrap: wrap;
        gap: 15px;
    }

    .detail-divider {
        display: none;
    }

    .detail-item {
        min-width: 30%;
    }

    /* Map */
    .city-map {
        height: 220px;
    }

    /* Chart */
    .temperature-chart-container {
        height: 170px;
    }

    /* Trend separator */
    .trend-separator {
        margin: 16px 0 12px;
    }

    .trend-label {
        font-size: 0.75rem;
        letter-spacing: 1px;
    }

    /* Hourly */
    .hourly-item {
        min-width: 65px;
        padding: 10px;
        gap: 6px;
    }

    .hourly-time {
        font-size: 0.8rem;
    }

    .hourly-icon {
        width: 28px;
        height: 28px;
    }

    .hourly-temp {
        font-size: 1rem;
    }

    /* Weekly */
    .weekly-item {
        padding: 10px 14px;
    }

    .weekly-day {
        font-size: 0.9rem;
    }

    .weekly-temp-range {
        font-size: 0.9rem;
    }

    /* NASA grid stacks */
    .nasa-grid {
        grid-template-columns: 1fr;
        max-width: 100%;
    }

    .card-title,
    .panel-title {
        font-size: 1.15rem;
    }

    #refresh-btn {
        padding: 8px 16px;
        font-size: 0.9rem;
    }

    /* Credits footer : gauche = mentions + auteur, droite = photo */
    .author-credit {
        font-size: 0.55rem;
    }

    .photo-credit {
        right: 12px;
        left: auto;
        bottom: 10px;
        font-size: 0.55rem;
    }

    .legal-link {
        bottom: 40px;
        font-size: 0.5rem;
    }
}

/* ========================================
   RESPONSIVE - MOBILE (max-width: 480px)
   ======================================== */
@media (max-width: 480px) {
    body {
        padding-top: 90px;
        overflow-x: hidden;
        max-width: 100vw;
    }

    .container {
        padding: 8px;
        gap: 12px;
        max-width: 100vw;
        overflow-x: hidden;
    }

    .weather-dashboard {
        max-width: 100%;
        overflow-x: hidden;
        gap: 12px;
    }

    .app-header h1 {
        font-size: 1.6rem;
        letter-spacing: -0.5px;
    }

    .app-logo {
        height: 56px;
    }

    /* Controls */
    .top-controls {
        flex-direction: row;
        flex-wrap: nowrap;
        gap: 6px;
        top: 8px;
        left: 8px;
        right: 8px;
        justify-content: space-between;
        align-items: center;
        max-width: none;
    }

    .unit-selector {
        flex: 0 0 auto;
        min-width: auto;
    }

    .unit-btn {
        padding: 6px 12px;
        font-size: 0.8rem;
    }

    .dark-mode-toggle {
        width: 38px;
        height: 38px;
        flex-shrink: 0;
    }

    /* Clock */
    .clock-widget {
        padding: 8px 12px;
        font-size: 0.85rem;
        max-width: 260px;
    }

    .date-display {
        font-size: 0.82rem;
    }

    .time-row {
        gap: 10px;
        font-size: 0.82rem;
    }

    .time-label {
        font-size: 0.72rem;
        min-width: 40px;
    }

    /* Search */
    .search-box {
        border-radius: 12px;
        padding: 3px 10px;
    }

    #city-input {
        font-size: 0.95rem;
        padding: 10px 8px;
    }

    #search-btn {
        padding: 6px;
    }

    .suggestions-container {
        max-height: 250px;
    }

    .suggestion-item {
        padding: 10px 12px;
    }

    .suggestion-city {
        font-size: 0.9rem;
    }

    .suggestion-details {
        font-size: 0.75rem;
    }

    /* Current weather */
    .temp-value {
        font-size: 3.5rem;
    }

    .temp-unit {
        font-size: 1.8rem;
        margin-top: 8px;
    }

    .city-name {
        font-size: 1.3rem;
    }

    .country-flag {
        font-size: 1.5rem;
    }

    .current-time {
        font-size: 0.85rem;
    }

    .weather-icon-main {
        width: 70px;
        height: 70px;
    }

    .weather-desc {
        font-size: 0.95rem;
        padding: 5px 12px;
    }

    .country-saying {
        font-size: 0.9rem;
        max-width: 95%;
        margin-top: 16px;
    }

    /* Weather details - compact row */
    .weather-details {
        flex-direction: row;
        flex-wrap: nowrap;
        gap: 0;
        margin-top: 12px;
        background: rgba(255, 255, 255, 0.04);
        border-radius: 12px;
        padding: 12px 8px;
    }

    .detail-item {
        flex: 1;
        flex-direction: column;
        align-items: center;
        gap: 4px;
        padding: 0;
        border-bottom: none;
    }

    .detail-item:not(:last-child) {
        border-right: 1px solid var(--glass-border);
    }

    .detail-label {
        font-size: 0.7rem;
        text-align: center;
    }

    .detail-value {
        font-size: 0.95rem;
    }

    /* Panels */
    .panel,
    .current-weather-panel,
    .hourly-panel,
    .weekly-panel,
    .map-panel,
    .chart-panel,
    .nasa-panel,
    .alerts-panel,
    .aqi-panel {
        padding: 14px;
        border-radius: 14px;
    }

    .panel-title {
        font-size: 1.05rem;
        margin-bottom: 12px;
    }

    .card-title {
        font-size: 1.05rem;
        margin-bottom: 12px;
    }

    /* Forecast days selector */
    .forecast-days-selector {
        margin-bottom: 12px;
    }

    .forecast-days-btn {
        padding: 5px 14px;
        font-size: 0.8rem;
    }

    /* Map */
    .city-map {
        height: 180px;
    }

    /* Chart */
    .temperature-chart-container {
        height: 150px;
    }

    #temperature-chart {
        max-height: 150px;
    }

    /* Trend separator */
    .trend-separator {
        margin: 14px 0 10px;
        gap: 12px;
    }

    .trend-label {
        font-size: 0.7rem;
        letter-spacing: 1px;
    }

    /* Hourly */
    .hourly-scroll-container {
        gap: 8px;
    }

    .hourly-item {
        min-width: 58px;
        padding: 8px 6px;
        gap: 5px;
        border-radius: 12px;
    }

    .hourly-time {
        font-size: 0.72rem;
    }

    .hourly-icon {
        width: 24px;
        height: 24px;
    }

    .hourly-temp {
        font-size: 0.9rem;
    }

    /* Weekly */
    .weekly-list {
        gap: 8px;
    }

    .weekly-item {
        padding: 10px 12px;
        border-radius: 10px;
    }

    .weekly-day {
        font-size: 0.85rem;
        font-weight: 600;
    }

    .weekly-icon {
        width: 24px;
        height: 24px;
    }

    .weekly-temp-range {
        font-size: 0.85rem;
        gap: 10px;
    }

    /* NASA grid stacks on mobile */
    .nasa-grid {
        grid-template-columns: 1fr;
        max-width: 100%;
    }

    /* Refresh */
    .refresh-container {
        margin-top: 12px;
    }

    #refresh-btn {
        padding: 8px 14px;
        font-size: 0.85rem;
    }

    #refresh-btn svg {
        width: 16px;
        height: 16px;
    }

    /* Welcome */
    .welcome-message {
        padding: 28px 18px;
        border-radius: 14px;
    }

    .welcome-message h2 {
        font-size: 1.5rem;
    }

    .welcome-message p {
        font-size: 0.9rem;
    }

}

/* ========================================
   RESPONSIVE - TRÈS PETITS MOBILES (max-width: 360px)
   ======================================== */
@media (max-width: 360px) {
    body {
        padding-top: 80px;
    }

    .top-controls {
        gap: 4px;
        left: 6px;
        right: 6px;
        top: 6px;
        max-width: none;
        justify-content: space-between;
    }

    .unit-selector {
        flex: 0 0 auto;
    }

    .unit-btn {
        padding: 5px 10px;
        font-size: 0.75rem;
    }

    .dark-mode-toggle {
        width: 34px;
        height: 34px;
    }

    .dark-mode-toggle svg {
        width: 15px;
        height: 15px;
    }

    .container {
        padding: 6px;
        gap: 10px;
    }

    .weather-dashboard {
        gap: 10px;
    }

    .temp-value {
        font-size: 3rem;
    }

    .temp-unit {
        font-size: 1.5rem;
    }

    .city-name {
        font-size: 1.2rem;
    }

    .app-header h1 {
        font-size: 1.4rem;
    }

    .app-logo {
        height: 48px;
    }

    .weather-icon-main {
        width: 56px;
        height: 56px;
    }

    .hourly-item {
        min-width: 52px;
        padding: 6px 4px;
    }

    .city-map {
        height: 160px;
    }

    .temperature-chart-container {
        height: 130px;
    }

    .panel,
    .current-weather-panel,
    .hourly-panel,
    .weekly-panel,
    .map-panel,
    .chart-panel,
    .nasa-panel,
    .alerts-panel,
    .aqi-panel {
        padding: 12px;
        border-radius: 12px;
    }

    .panel-title {
        font-size: 0.95rem;
    }

    .weekly-item {
        padding: 8px 10px;
        border-radius: 8px;
    }

    .clock-widget {
        max-width: 220px;
        padding: 6px 10px;
    }
}

/* ========================================
   RESPONSIVE - PAYSAGE TABLETTE & GRANDS TELEPHONES
   ======================================== */
@media (min-width: 600px) and (max-width: 1023px) and (orientation: landscape) {
    .container {
        padding: 100px 20px 60px;
        gap: 14px;
        max-width: 100%;
    }

    .app-header {
        margin-bottom: 0;
    }

    .app-logo {
        height: 50px;
    }

    .weather-dashboard {
        grid-template-columns: repeat(2, 1fr);
        gap: 14px;
    }

    #weather-result {
        grid-column: 1;
        grid-row: 1 / 3;
    }

    #map-panel {
        grid-column: 2;
        grid-row: 1;
    }

    .city-map {
        height: 180px;
    }

    #hourly-forecast {
        grid-column: 2;
        grid-row: 2;
    }

    #weekly-forecast {
        grid-column: 1 / -1;
        grid-row: auto;
    }

    .nasa-panel,
    .aqi-panel {
        grid-column: 1 / -1;
    }

    .nasa-panel {
        grid-column: 1 / -1;
    }

    .nasa-grid {
        grid-template-columns: repeat(3, 1fr);
        max-width: 100%;
    }

    .temperature-chart-container {
        height: 140px;
    }

    .trend-separator {
        margin: 12px 0 8px;
    }

    .top-controls {
        position: fixed;
        top: 10px;
        left: 10px;
        right: auto;
        flex-direction: row;
        flex-wrap: nowrap;
        justify-content: flex-start;
        gap: 6px;
    }

    .unit-selector {
        flex: 0 0 auto;
        min-width: auto;
    }

    .unit-btn {
        padding: 4px 10px;
    }

    .bmc-button {
        width: 36px;
        height: 36px;
    }

    .unit-selector {
        flex: 0 0 auto;
        min-width: auto;
    }

    .unit-btn {
        padding: 4px 10px;
    }

    .clock-widget {
        position: fixed;
        bottom: 10px;
        left: 50%;
        transform: translateX(-50%);
        right: auto;
        top: auto;
        margin: 0;
        padding: 4px 12px;
        flex-direction: row;
        align-items: center;
        gap: 12px;
        font-size: 0.75rem;
    }

    .clock-widget .date-display {
        border-bottom: none;
        padding-bottom: 0;
        margin-bottom: 0;
        font-size: 0.75rem;
    }

    .clock-widget .time-row {
        font-size: 0.75rem;
        gap: 6px;
    }

    .panel,
    .current-weather-panel,
    .hourly-panel,
    .weekly-panel,
    .map-panel,
    .chart-panel,
    .nasa-panel,
    .alerts-panel,
    .aqi-panel {
        padding: 14px;
    }

    .temp-value {
        font-size: 3.5rem;
    }

    .temp-unit {
        font-size: 1.5rem;
    }

    .weather-icon-main {
        width: 60px;
        height: 60px;
    }

    .weather-desc {
        font-size: 0.9rem;
        padding: 4px 12px;
    }

    .country-saying {
        font-size: 0.85rem;
        margin-top: 10px;
    }

    .author-credit {
        font-size: 0.55rem;
    }

    .photo-credit {
        right: 12px;
        left: auto;
        bottom: 10px;
        font-size: 0.55rem;
    }

    .legal-link {
        bottom: 40px;
        font-size: 0.5rem;
    }
}

/* ========================================
   RESPONSIVE - PAYSAGE MOBILE (hauteur faible)
   ======================================== */
@media (max-height: 500px) and (orientation: landscape) {
    body {
        padding: 100px 10px 60px 10px;
        align-items: center;
        min-height: 100vh;
    }

    .container {
        padding: 5px 10px 60px;
        gap: 10px;
        width: 100%;
        max-width: 900px;
    }

    .app-header {
        display: none;
    }

    .top-controls {
        position: fixed;
        top: 10px;
        left: 10px;
        right: auto;
        flex-direction: row;
        flex-wrap: nowrap;
        justify-content: flex-start;
        gap: 6px;
    }

    .unit-selector {
        flex: 0 0 auto;
        min-width: auto;
    }

    .unit-btn {
        padding: 4px 10px;
    }

    .bmc-button {
        width: 36px;
        height: 36px;
    }

    /* Credits : gauche = mentions + auteur, droite = photo */
    .author-credit {
        max-width: 45%;
        font-size: 0.55rem;
    }

    .photo-credit {
        right: 12px;
        left: auto;
        bottom: 10px;
        max-width: 45%;
        font-size: 0.55rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .legal-link {
        bottom: 40px;
        max-width: 45%;
        font-size: 0.5rem;
    }

    /* Horloge : a droite, compacte, limitee a 45% de largeur */
    .clock-widget {
        position: fixed;
        bottom: 10px;
        left: 50%;
        transform: translateX(-50%);
        right: auto;
        top: auto;
        margin: 0;
        padding: 4px 10px;
        flex-direction: row;
        align-items: center;
        gap: 8px;
        font-size: 0.65rem;
        max-width: 50%;
    }

    .clock-widget .date-display {
        border-bottom: none;
        padding-bottom: 0;
        margin-bottom: 0;
        font-size: 0.65rem;
    }

    .clock-widget .time-row {
        font-size: 0.65rem;
        gap: 4px;
    }

    .clock-widget .time-label {
        font-size: 0.55rem;
        min-width: 25px;
    }

    .welcome-message {
        padding: 12px;
        margin-top: 5px;
    }

    .welcome-message h2 {
        font-size: 1.1rem;
    }

    .weather-dashboard {
        display: grid;
        grid-template-columns: 1fr 1fr;
        align-items: start;
        gap: 12px;
    }

    #weather-result {
        grid-column: 1;
        grid-row: 1 / 3;
    }

    #map-panel {
        grid-column: 2;
        grid-row: 1;
    }

    #hourly-forecast {
        grid-column: 2;
        grid-row: 2;
    }

    #weekly-forecast {
        grid-column: 1 / -1;
        grid-row: 3;
    }

    .nasa-panel,
    .aqi-panel {
        grid-column: 1 / -1;
    }

    .nasa-panel {
        grid-column: 1 / -1;
    }

    .nasa-grid {
        grid-template-columns: repeat(3, 1fr);
        max-width: 100%;
    }

    .temp-value {
        font-size: 3rem;
    }

    .temp-unit {
        font-size: 1.3rem;
    }

    .weather-icon-main {
        width: 50px;
        height: 50px;
    }

    .city-name {
        font-size: 1.1rem;
    }

    .weather-desc {
        font-size: 0.85rem;
        padding: 3px 10px;
    }

    .country-saying {
        font-size: 0.8rem;
        margin-top: 8px;
    }

    .forecast-days-btn {
        padding: 4px 12px;
        font-size: 0.75rem;
    }

    .city-map {
        height: 130px;
    }

    .temperature-chart-container {
        height: 110px;
    }

    .trend-separator {
        margin: 8px 0 6px;
    }

    .panel,
    .current-weather-panel,
    .hourly-panel,
    .weekly-panel,
    .map-panel,
    .chart-panel,
    .nasa-panel,
    .alerts-panel,
    .aqi-panel {
        padding: 10px 12px;
        border-radius: 12px;
    }

    .panel-title {
        font-size: 0.95rem;
        margin-bottom: 8px;
    }

    .weather-details {
        margin-top: 5px;
        gap: 0;
        flex-wrap: nowrap;
    }

    .detail-item {
        padding: 2px 0;
        border: none;
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .detail-label,
    .detail-value {
        font-size: 0.75rem;
    }

    .hourly-scroll-container {
        padding-bottom: 4px;
    }

    .hourly-item {
        min-width: 50px;
        padding: 5px 4px;
    }

    .weekly-item {
        padding: 6px 10px;
    }

    .weekly-day {
        font-size: 0.8rem;
    }

    .weekly-temp-range {
        font-size: 0.8rem;
    }
}

/* ========================================
   PANNEAUX SECONDAIRES (NASA, Alertes, AQI)
   Style harmonisé et centré
   ======================================== */
.nasa-panel,
.alerts-panel,
.aqi-panel {
    width: 100%;
    grid-column: 1 / -1;
}

/* ========================================
   NASA POWER SECTION
   ======================================== */

.nasa-loading {
    text-align: center;
    padding: 30px;
    font-size: 1rem;
    opacity: 0.8;
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 0.6;
    }

    50% {
        opacity: 1;
    }
}

.nasa-data-container {
    width: 100%;
}

.nasa-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-bottom: 15px;
    width: 100%;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.nasa-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    transition: all 0.3s ease;
    border: 1px solid transparent;
}

.nasa-item:hover {
    background: var(--glass-hover-bg);
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.15);
}

.nasa-icon {
    font-size: 2rem;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    flex-shrink: 0;
}

.nasa-icon.solar {
    background: linear-gradient(135deg, #ffd93d 0%, #ff8c42 100%);
    box-shadow: 0 4px 15px rgba(255, 217, 61, 0.3);
}

.nasa-icon.precip {
    background: linear-gradient(135deg, #74c0fc 0%, #4dabf7 100%);
    box-shadow: 0 4px 15px rgba(116, 192, 252, 0.3);
}

.nasa-icon.pressure {
    background: linear-gradient(135deg, #b197fc 0%, #9775fa 100%);
    box-shadow: 0 4px 15px rgba(177, 151, 252, 0.3);
}

.nasa-info {
    display: flex;
    flex-direction: column;
    gap: 5px;
    flex: 1;
}

.nasa-label {
    font-size: 0.85rem;
    opacity: 0.8;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 500;
}

.nasa-value {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-color);
}

.nasa-footer {
    text-align: center;
    padding: 15px 10px 0;
    border-top: 1px solid var(--glass-border);
    opacity: 0.7;
}

.nasa-footer small {
    font-size: 0.75rem;
    font-style: italic;
}

/* Responsive pour NASA */
@media (max-width: 768px) {
    .nasa-grid {
        grid-template-columns: 1fr;
        gap: 10px;
        max-width: 100%;
    }

    .nasa-item {
        padding: 12px;
    }

    .nasa-icon {
        width: 42px;
        height: 42px;
        font-size: 1.4rem;
    }

    .nasa-label {
        font-size: 0.78rem;
    }

    .nasa-value {
        font-size: 1.05rem;
    }
}

@media (max-width: 480px) {
    .nasa-icon {
        width: 38px;
        height: 38px;
        font-size: 1.2rem;
    }

    .nasa-label {
        font-size: 0.72rem;
    }

    .nasa-value {
        font-size: 0.95rem;
    }

    .nasa-item {
        padding: 10px;
        gap: 12px;
    }

    .nasa-footer {
        padding: 10px 8px 0;
    }

    .nasa-footer small {
        font-size: 0.7rem;
    }
}

/* ========================================
   WEATHER ALERTS (NWS) SECTION
   ======================================== */

.alerts-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
}

.alert-item {
    padding: 15px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    border-left: 4px solid #ff7e00;
    border-top: 1px solid transparent;
    border-right: 1px solid transparent;
    border-bottom: 1px solid transparent;
    text-align: left;
    transition: all 0.3s ease;
}

.alert-item:hover {
    background: var(--glass-hover-bg);
    transform: translateY(-2px);
    border-top-color: rgba(255, 255, 255, 0.08);
    border-right-color: rgba(255, 255, 255, 0.08);
    border-bottom-color: rgba(255, 255, 255, 0.08);
}

.alert-severity {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.alert-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-color);
}

.alert-description {
    font-size: 0.85rem;
    opacity: 0.8;
    line-height: 1.5;
}

.alert-none {
    text-align: center;
    padding: 20px;
    opacity: 0.7;
    font-style: italic;
}

/* Responsive Alerts */
@media (max-width: 768px) {
    .alert-item {
        padding: 12px;
    }

    .alert-title {
        font-size: 0.95rem;
    }

    .alert-description {
        font-size: 0.8rem;
    }
}

@media (max-width: 480px) {
    .alert-item {
        padding: 10px;
    }

    .alert-severity {
        font-size: 0.7rem;
    }

    .alert-title {
        font-size: 0.9rem;
    }
}

/* ========================================
   AIR QUALITY (AQICN) SECTION
   ======================================== */

.aqi-panel .card-glass {
    max-width: 500px;
    margin: 0 auto;
}

.aqi-index-display {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    margin-bottom: 15px;
    padding: 10px 0;
}

.aqi-badge {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    font-weight: 800;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    transition: background 0.3s ease;
}

.aqi-level {
    font-size: 1.1rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.nasa-icon.aqi-pm25 {
    background: linear-gradient(135deg, #ff9a9e 0%, #fecfef 100%);
    box-shadow: 0 4px 15px rgba(255, 154, 158, 0.3);
}

.nasa-icon.aqi-pm10 {
    background: linear-gradient(135deg, #a18cd1 0%, #fbc2eb 100%);
    box-shadow: 0 4px 15px rgba(161, 140, 209, 0.3);
}

/* Responsive AQI */
@media (max-width: 768px) {
    .aqi-badge {
        width: 65px;
        height: 65px;
        font-size: 1.5rem;
    }

    .aqi-level {
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .aqi-badge {
        width: 55px;
        height: 55px;
        font-size: 1.3rem;
    }

    .aqi-level {
        font-size: 0.9rem;
    }
}

/* ========================================
   TOUCH DEVICES : désactiver les hover transforms
   ======================================== */
@media (hover: none) {

    .panel:hover,
    .current-weather-panel:hover,
    .hourly-panel:hover,
    .weekly-panel:hover,
    .map-panel:hover,
    .chart-panel:hover,
    .nasa-panel:hover,
    .alerts-panel:hover,
    .aqi-panel:hover,
    .weekly-item:hover,
    .hourly-item:hover,
    .nasa-item:hover,
    .alert-item:hover {
        transform: none;
    }
}

/* ========================================
   PRÉFÉRENCES UTILISATEUR : MOUVEMENT RÉDUIT
   ======================================== */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}