/* ==========================================================================
   KINDRED MÉTÉO — DESIGN SYSTEM MODERNE & RESPONSIVE
   Inspiré de Google Weather : Cartes arrondies, Glassmorphism & Clarté technique
   ========================================================================== */

/* --- 1. Variables & Systèmes de Couleurs (Dark / Light) --- */
:root {
    /* Typographie */
    --font-main: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;

    /* Rayons de courbure */
    --radius-sm: 10px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --radius-xl: 32px;
    --radius-full: 9999px;

    /* Transitions fluides */
    --trans-fast: 0.18s cubic-bezier(0.4, 0, 0.2, 1);
    --trans-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --trans-slow: 0.5s cubic-bezier(0.4, 0, 0.2, 1);

    /* Accents météo */
    --accent-temp: #f97316;
    --accent-temp-cold: #0284c7;
    --accent-rain: #0ea5e9;
    --accent-humidity: #14b8a6;
    --accent-uv: #8b5cf6;
    --accent-wind: #64748b;
    --accent-primary: #6366f1;
    --accent-glow: rgba(99, 102, 241, 0.25);
}

/* --- Thème Sombre (Par Défaut / Dark Mode) --- */
[data-theme="dark"] {
    --bg-page: #0b0f19;
    --bg-ambient-1: radial-gradient(circle at 15% 15%, rgba(99, 102, 241, 0.12) 0%, transparent 45%);
    --bg-ambient-2: radial-gradient(circle at 85% 75%, rgba(14, 165, 233, 0.1) 0%, transparent 45%);
    
    --card-bg: rgba(22, 29, 47, 0.72);
    --card-bg-solid: #161d2f;
    --card-bg-hover: rgba(30, 41, 67, 0.85);
    --card-border: rgba(255, 255, 255, 0.08);
    --card-border-focus: rgba(99, 102, 241, 0.5);
    --card-shadow: 0 16px 36px -10px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.04) inset;
    
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    
    --search-bg: rgba(255, 255, 255, 0.06);
    --search-border: rgba(255, 255, 255, 0.12);
    --search-focus-bg: rgba(255, 255, 255, 0.1);
    
    --pill-bg: rgba(255, 255, 255, 0.07);
    --pill-border: rgba(255, 255, 255, 0.1);
    
    --hud-bg: rgba(15, 23, 42, 0.9);
    --hud-border: rgba(99, 102, 241, 0.3);
    
    --dropdown-bg: #131b2e;
    --dropdown-hover: #1e293b;
    
    --temp-bar-bg: rgba(255, 255, 255, 0.08);
    --temp-bar-fill: linear-gradient(90deg, #38bdf8 0%, #fb923c 100%);
}

/* --- Thème Clair (Light Mode) --- */
[data-theme="light"] {
    --bg-page: #f8fafc;
    --bg-ambient-1: radial-gradient(circle at 15% 15%, rgba(224, 242, 254, 0.8) 0%, transparent 50%);
    --bg-ambient-2: radial-gradient(circle at 85% 75%, rgba(243, 232, 255, 0.7) 0%, transparent 50%);
    
    --card-bg: rgba(255, 255, 255, 0.88);
    --card-bg-solid: #ffffff;
    --card-bg-hover: rgba(255, 255, 255, 1);
    --card-border: rgba(0, 0, 0, 0.06);
    --card-border-focus: rgba(99, 102, 241, 0.4);
    --card-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05), 0 0 0 1px rgba(0, 0, 0, 0.03);
    
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    
    --search-bg: #ffffff;
    --search-border: rgba(0, 0, 0, 0.1);
    --search-focus-bg: #ffffff;
    
    --pill-bg: rgba(0, 0, 0, 0.04);
    --pill-border: rgba(0, 0, 0, 0.08);
    
    --hud-bg: rgba(255, 255, 255, 0.95);
    --hud-border: rgba(99, 102, 241, 0.2);
    
    --dropdown-bg: #ffffff;
    --dropdown-hover: #f1f5f9;
    
    --temp-bar-bg: rgba(0, 0, 0, 0.06);
    --temp-bar-fill: linear-gradient(90deg, #0284c7 0%, #ea580c 100%);
}

/* --- 2. Reset & Structure de Base --- */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-main);
    background-color: var(--bg-page);
    color: var(--text-primary);
    min-height: 100vh;
    min-height: 100dvh;
    position: relative;
    overflow-x: hidden;
    line-height: 1.5;
    transition: background-color var(--trans-normal), color var(--trans-normal);
}

/* Fond lumineux dynamique */
.ambient-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: var(--bg-ambient-1), var(--bg-ambient-2);
    pointer-events: none;
    z-index: 0;
}

/* Conteneur principal */
.app-container {
    position: relative;
    z-index: 1;
    max-width: 1200px;
    margin: 0 auto;
    padding: clamp(1rem, 3vw, 2.5rem) clamp(1rem, 3.5vw, 2rem);
    display: flex;
    flex-direction: column;
    gap: 1.75rem;
}

/* --- 3. Barre Supérieure & Navigation (Header) --- */
.app-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.brand-section {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.brand-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    color: var(--text-primary);
    font-weight: 800;
    font-size: 1.35rem;
    letter-spacing: -0.02em;
}

.brand-badge {
    background: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
    color: #ffffff;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.2rem 0.55rem;
    border-radius: var(--radius-full);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Actions rapides dans l'en-tête */
.header-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.55rem 0.95rem;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-full);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    transition: var(--trans-fast);
}

.action-btn:hover {
    background: var(--card-bg-hover);
    border-color: var(--card-border-focus);
    transform: translateY(-1px);
}

.action-btn:active {
    transform: translateY(0);
}

.action-btn.spin svg, .action-btn.spin span {
    animation: spinRotate 0.8s linear infinite;
}

@keyframes spinRotate {
    100% { transform: rotate(360deg); }
}

/* --- 4. Barre de Recherche Google Weather --- */
.search-container {
    position: relative;
    width: 100%;
    max-width: 680px;
    margin: 0 auto;
}

.search-bar-form {
    display: flex;
    align-items: center;
    background: var(--search-bg);
    border: 1.5px solid var(--search-border);
    border-radius: var(--radius-full);
    padding: 0.35rem 0.5rem 0.35rem 1.25rem;
    box-shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.08);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    transition: var(--trans-fast);
}

.search-bar-form:focus-within {
    border-color: var(--accent-primary);
    background: var(--search-focus-bg);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.search-icon-symbol {
    color: var(--text-muted);
    margin-right: 0.75rem;
    display: flex;
    align-items: center;
}

.search-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    font-family: inherit;
    font-size: 1rem;
    color: var(--text-primary);
    font-weight: 500;
}

.search-input::placeholder {
    color: var(--text-muted);
}

.search-actions {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.search-geo-btn {
    background: var(--pill-bg);
    border: 1px solid var(--pill-border);
    border-radius: var(--radius-full);
    color: var(--text-secondary);
    padding: 0.45rem 0.8rem;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    transition: var(--trans-fast);
}

.search-geo-btn:hover {
    color: var(--accent-primary);
    border-color: var(--accent-primary);
    background: rgba(99, 102, 241, 0.1);
}

/* Menu déroulant d'autocomplétion */
.search-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background: var(--dropdown-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-md);
    box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.35);
    max-height: 320px;
    overflow-y: auto;
    z-index: 100;
    display: none;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.search-dropdown.visible {
    display: block;
    animation: fadeInDown 0.2s ease-out;
}

@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-6px); }
    to { opacity: 1; transform: translateY(0); }
}

.dropdown-item {
    padding: 0.75rem 1.25rem;
    cursor: pointer;
    border-bottom: 1px solid var(--card-border);
    transition: var(--trans-fast);
}

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

.dropdown-item:hover {
    background: var(--dropdown-hover);
}

.dropdown-item strong {
    color: var(--text-primary);
    font-size: 0.95rem;
}

.postal-tag {
    background: var(--pill-bg);
    border: 1px solid var(--pill-border);
    border-radius: 4px;
    font-size: 0.75rem;
    padding: 0.1rem 0.4rem;
    margin-left: 0.4rem;
    color: var(--text-secondary);
}

.item-sub {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.2rem;
}

.dropdown-loader, .dropdown-empty, .dropdown-error {
    padding: 1.25rem;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* --- 5. Bandeau de Statut Comparateur --- */
.compare-status-bar {
    display: none;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(90deg, rgba(99, 102, 241, 0.15), rgba(168, 85, 247, 0.15));
    border: 1px solid rgba(99, 102, 241, 0.3);
    border-radius: var(--radius-md);
    padding: 0.75rem 1.25rem;
    font-size: 0.9rem;
    font-weight: 600;
    backdrop-filter: blur(10px);
}

.compare-status-bar.visible {
    display: flex;
}

.compare-city-tag-1 {
    color: #fb923c;
    margin: 0 0.25rem;
}

.compare-city-tag-2 {
    color: #c084fc;
    margin: 0 0.25rem;
}

.compare-close-btn {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--text-primary);
    padding: 0.3rem 0.75rem;
    border-radius: var(--radius-full);
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 600;
    transition: var(--trans-fast);
}

.compare-close-btn:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: #ef4444;
}

/* --- 6. Carte Principale "Google Weather" (Hero) --- */
.hero-weather-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-xl);
    box-shadow: var(--card-shadow);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: clamp(1.5rem, 4vw, 2.5rem);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
    flex-wrap: wrap;
    position: relative;
    overflow: hidden;
}

.hero-weather-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, #6366f1, #a855f7, #38bdf8);
}

.hero-main-info {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex: 1;
    min-width: 260px;
}

.hero-location-header {
    display: flex;
    align-items: baseline;
    gap: 0.6rem;
    flex-wrap: wrap;
}

.city-title {
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--text-primary);
}

.city-region-label {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.hero-temp-row {
    display: flex;
    align-items: baseline;
    gap: 1.25rem;
    margin: 0.5rem 0;
}

.current-temperature-value {
    font-size: clamp(3.75rem, 9vw, 5.75rem);
    font-weight: 800;
    line-height: 1;
    letter-spacing: -0.04em;
    color: var(--text-primary);
}

.hero-condition-summary {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.weather-condition-label {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
}

.feels-like-label {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.high-low-label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-muted);
}

.hero-visual-side {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
}

.weather-dynamic-icon {
    width: clamp(84px, 12vw, 120px);
    height: clamp(84px, 12vw, 120px);
    display: flex;
    align-items: center;
    justify-content: center;
    filter: drop-shadow(0 12px 24px rgba(0, 0, 0, 0.2));
    animation: gentleFloat 5s ease-in-out infinite alternate;
}

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

@keyframes gentleFloat {
    0% { transform: translateY(-4px); }
    100% { transform: translateY(4px); }
}

.last-updated-tag {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-muted);
    background: var(--pill-bg);
    border: 1px solid var(--pill-border);
    padding: 0.3rem 0.75rem;
    border-radius: var(--radius-full);
}

/* --- 7. Section des 3 Graphiques Synchronisés --- */
.charts-section-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-xl);
    box-shadow: var(--card-shadow);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: clamp(1.25rem, 3.5vw, 2rem);
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    position: relative;
    transition: var(--trans-normal);
}

/* Mode plein écran pour les graphiques */
.charts-section-card:fullscreen,
.charts-section-card.modal-fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    z-index: 9999;
    border-radius: 0;
    margin: 0;
    padding: 1.5rem 2rem;
    overflow-y: auto;
    background: var(--card-bg-solid);
}

.charts-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    border-bottom: 1px solid var(--card-border);
    padding-bottom: 1rem;
}

.charts-title-row {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    flex-wrap: wrap;
}

.charts-title {
    font-size: 1.25rem;
    font-weight: 800;
    letter-spacing: -0.01em;
}

/* Sélecteur rapide des 3 jours — Style moderne Segmented Pill */
.quick-day-selector {
    display: inline-flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: var(--radius-full);
    padding: 4px;
    gap: 4px;
    box-shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.25), inset 0 1px 1px rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

[data-theme="light"] .quick-day-selector {
    background: rgba(15, 23, 42, 0.06);
    border: 1px solid rgba(0, 0, 0, 0.1);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
}

.quick-day-btn {
    all: unset;
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.55rem 1.15rem;
    border-radius: var(--radius-full);
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    user-select: none;
    border: 1px solid transparent;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.quick-day-btn:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-1px);
}

[data-theme="light"] .quick-day-btn:hover {
    background: rgba(0, 0, 0, 0.06);
}

.quick-day-btn.active {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%) !important;
    color: #ffffff !important;
    font-weight: 700 !important;
    border: 1px solid rgba(255, 255, 255, 0.28) !important;
    box-shadow: 0 4px 16px rgba(99, 102, 241, 0.42), inset 0 1px 1px rgba(255, 255, 255, 0.3) !important;
    transform: translateY(-1px);
}

.day-btn-label {
    font-weight: 700;
    letter-spacing: -0.01em;
}

.day-btn-date {
    display: inline-block;
    background: rgba(255, 255, 255, 0.2);
    padding: 0.12rem 0.55rem;
    border-radius: var(--radius-full);
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

[data-theme="light"] .quick-day-btn:not(.active) .day-btn-date {
    background: rgba(0, 0, 0, 0.08);
    color: var(--text-secondary);
}

.charts-actions-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Bandeau HUD interactif synchronisé sur les 3 graphiques */
.sync-hud-bar {
    background: var(--hud-bg);
    border: 1.5px solid var(--hud-border);
    border-radius: var(--radius-md);
    padding: 0.85rem 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    box-shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.15);
    transition: var(--trans-fast);
}

.hud-item {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.hud-label {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}

.hud-value {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
}

.hud-value.temp-val { color: var(--accent-temp); }
.hud-value.precip-val { color: var(--accent-rain); }
.hud-value.humidity-val { color: var(--accent-humidity); }

/* Stack des 3 graphiques */
.charts-stack {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    width: 100%;
}

.chart-module {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    width: 100%;
}

.chart-module-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 0.5rem;
}

.chart-module-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.chart-canvas-wrapper {
    position: relative;
    width: 100%;
    height: 160px;
}

/* En mode plein écran, agrandir les canvas */
.charts-section-card:fullscreen .chart-canvas-wrapper,
.charts-section-card.modal-fullscreen .chart-canvas-wrapper {
    height: 220px;
}

/* --- 8. Grille des Métriques Complémentaires (8 Cartes Google Weather) --- */
.metrics-section {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.section-heading {
    font-size: 1.15rem;
    font-weight: 800;
    letter-spacing: -0.01em;
    color: var(--text-primary);
    padding: 0 0.25rem;
}

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1rem;
}

.metric-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--card-shadow);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 0.75rem;
    transition: var(--trans-fast);
}

.metric-card:hover {
    transform: translateY(-2px);
    border-color: var(--card-border-focus);
}

.metric-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.metric-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.metric-icon-small {
    font-size: 1.2rem;
}

.metric-main-value {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
}

.metric-number {
    font-size: 1.85rem;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.02em;
    line-height: 1.1;
}

.metric-extra-detail {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

/* Flèche de boussole pour le vent */
.wind-arrow {
    display: inline-block;
    transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
    font-size: 1rem;
}

/* Badge UV */
.uv-pill-badge {
    padding: 0.2rem 0.55rem;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 700;
}

/* Deux temps : lever et coucher de soleil */
.sun-times-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

.sun-col {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.sun-label {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.sun-hour {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
}

/* --- 9. Section Prévisions sur 7 Jours --- */
.forecast-section {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.forecast-days-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-xl);
    padding: 0.75rem;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.forecast-day-card {
    display: grid;
    grid-template-columns: 140px 180px 100px 1fr;
    align-items: center;
    padding: 0.85rem 1.25rem;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--trans-fast);
}

.forecast-day-card:hover {
    background: var(--dropdown-hover);
}

.forecast-day-card.active {
    background: rgba(99, 102, 241, 0.12);
    border: 1px solid rgba(99, 102, 241, 0.35);
}

.day-header {
    display: flex;
    flex-direction: column;
}

.day-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
}

.day-date {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.day-icon-weather {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.day-weather-desc {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.day-rain-prob {
    text-align: center;
}

.rain-pill {
    background: rgba(14, 165, 233, 0.15);
    color: #0284c7;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.2rem 0.55rem;
    border-radius: var(--radius-full);
}

[data-theme="dark"] .rain-pill {
    color: #38bdf8;
    background: rgba(56, 189, 248, 0.15);
}

.dry-pill {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Barre horizontale min-max Google Weather */
.day-temp-bar-container {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    justify-content: flex-end;
}

.temp-min {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-secondary);
    min-width: 28px;
    text-align: right;
}

.temp-max {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
    min-width: 28px;
}

.temp-bar-bg {
    position: relative;
    width: 100%;
    max-width: 180px;
    height: 6px;
    background: var(--temp-bar-bg);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.temp-bar-fill {
    position: absolute;
    top: 0;
    height: 100%;
    background: var(--temp-bar-fill);
    border-radius: var(--radius-full);
}

/* --- 10. Modale de Comparaison de Villes --- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    opacity: 0;
    pointer-events: none;
    transition: var(--trans-normal);
}

.modal-overlay.visible {
    opacity: 1;
    pointer-events: auto;
}

.modal-card {
    background: var(--card-bg-solid);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 480px;
    padding: 2rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    position: relative;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-title {
    font-size: 1.25rem;
    font-weight: 800;
}

.modal-close-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.25rem;
    cursor: pointer;
}

.modal-close-btn:hover {
    color: var(--text-primary);
}

/* --- 11. Toast de Notification & Loader Global --- */
.toast-notification {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: var(--card-bg-solid);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-full);
    padding: 0.65rem 1.25rem;
    box-shadow: 0 15px 35px -5px rgba(0, 0, 0, 0.35);
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.88rem;
    font-weight: 600;
    z-index: 10000;
    opacity: 0;
    transform: translateY(12px);
    pointer-events: none;
    transition: var(--trans-normal);
}

.toast-notification.visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

/* Loader d'application subtil */
.global-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, #6366f1, #38bdf8, #a855f7);
    background-size: 200% 100%;
    z-index: 10001;
    animation: loaderShimmer 1.5s infinite linear;
    display: none;
}

.global-loader.visible {
    display: block;
}

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

/* --- 12. Pied de Page (Footer) --- */
.app-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
    padding: 1.5rem 0 1rem 0;
    border-top: 1px solid var(--card-border);
    font-size: 0.85rem;
    color: var(--text-muted);
}

.footer-links {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.footer-link {
    color: var(--text-secondary);
    text-decoration: none;
    transition: var(--trans-fast);
}

.footer-link:hover {
    color: var(--accent-primary);
}

/* Focus visible pour navigation au clavier & accessibilité */
.action-btn:focus-visible,
.search-input:focus-visible,
.search-geo-btn:focus-visible,
.quick-day-btn:focus-visible,
.forecast-day-card:focus-visible,
.modal-close-btn:focus-visible,
.compare-close-btn:focus-visible,
.footer-link:focus-visible {
    outline: 2px solid var(--accent-primary);
    outline-offset: 2px;
}

/* --- 13. Adaptabilité Mobile & Responsive Design --- */
@media (max-width: 768px) {
    .app-container {
        padding: 1rem;
        gap: 1.25rem;
    }

    .hero-weather-card {
        padding: 1.5rem;
        flex-direction: column;
        align-items: flex-start;
        gap: 1.25rem;
    }

    .hero-visual-side {
        width: 100%;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }

    .weather-dynamic-icon {
        width: 72px;
        height: 72px;
    }

    .charts-title-row {
        width: 100%;
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .quick-day-selector {
        width: 100%;
        display: flex;
    }

    .quick-day-btn {
        flex: 1;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 0.2rem;
        padding: 0.5rem 0.25rem;
        font-size: 0.78rem;
    }

    .quick-day-btn .day-btn-label {
        font-size: 0.8rem;
        line-height: 1.1;
    }

    .quick-day-btn .day-btn-date {
        font-size: 0.68rem;
        padding: 0.1rem 0.4rem;
        line-height: 1.1;
    }

    .sync-hud-bar {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
        padding: 1rem;
    }

    .forecast-day-card {
        grid-template-columns: 90px 1fr auto;
        gap: 0.5rem;
        padding: 0.75rem;
    }

    .day-weather-desc {
        display: none; /* Masquer la description textuelle sur smartphone pour aérer */
    }

    .day-temp-bar-container {
        gap: 0.4rem;
    }

    .temp-bar-bg {
        max-width: 90px;
    }

    .chart-canvas-wrapper {
        height: 135px;
    }

    .toast-notification {
        left: 1rem;
        right: 1rem;
        bottom: 1rem;
        justify-content: center;
    }
}

/* Adaptation pour très petits écrans (320px - 380px) */
@media (max-width: 380px) {
    .app-container {
        padding: 0.75rem;
        gap: 1rem;
    }

    .app-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .header-actions {
        width: 100%;
        justify-content: space-between;
    }

    .header-actions .action-btn {
        flex: 1;
        padding: 0.45rem 0.6rem;
        font-size: 0.78rem;
    }

    .search-geo-btn span:last-child {
        display: none; /* N'afficher que l'icône GPS sur très petits écrans */
    }

    .current-temperature-value {
        font-size: 3.25rem;
    }

    .forecast-day-card {
        grid-template-columns: 80px 1fr auto;
        padding: 0.6rem 0.4rem;
        font-size: 0.85rem;
    }

    .temp-bar-bg {
        max-width: 60px;
    }

    .sync-hud-bar {
        grid-template-columns: 1fr;
    }
}
