:root {
    --sky-color-day-clear-top: #87CEEB; --sky-color-day-clear-bottom: #4682B4;
    --sky-color-day-cloudy-top: #B0C4DE; --sky-color-day-cloudy-bottom: #778899;
    --sky-color-rain-top: #708090; --sky-color-rain-bottom: #465869;
    --sky-color-storm-top: #2c3e50; --sky-color-storm-bottom: #1a2531;
    --sky-color-snow-top: #E6E6FA; --sky-color-snow-bottom: #B0E0E6;
    --sky-color-fog-top: #D3D3D3; --sky-color-fog-bottom: #A9A9A9;
    --sky-color-night-top: #0F2027; --sky-color-night-middle: #203A43; --sky-color-night-bottom: #2C5364;
    --sun-color: gold; --moon-color: #f0e68c; --cloud-color-light: #f2f9fe; --cloud-color-dark: #d6dfe6;
    --rain-color: #A9C2D7; --snow-color: #ffffff; --lightning-color: #FFD700;
}
body { font-family: 'Inter', sans-serif; background: linear-gradient(135deg, var(--sky-color-day-cloudy-top) 0%, var(--sky-color-day-cloudy-bottom) 100%); transition: background 1.5s ease-in-out; overflow-x: hidden; color: #E0E0E0; }

body.loaded {
    opacity: 1;
}

.weather-card {
	background-color: rgba(0, 0, 0, 0.25);
	-webkit-backdrop-filter: blur(18px) saturate(180%); /* Pour Safari et autres WebKit */
	backdrop-filter: blur(18px) saturate(180%);
	border: 1px solid rgba(255, 255, 255, 0.12);
	border-radius: 28px;
	box-shadow: 0 18px 40px rgba(0, 0, 0, 0.25), 0 8px 18px rgba(0,0,0,0.18);
	transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275),
				box-shadow 0.4s ease,
				border-color 0.4s ease;
}

.weather-card.safari-backdrop-fix {
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
    background-color: rgba(0, 0, 0, 0.25) !important;
}

.weather-card:hover {
    box-shadow: 0 10px 30px rgba(0,0,0,0.15),
                0 0 25px rgba(230, 230, 255, 0.25),
                inset 0 0 12px rgba(230, 230, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.4);
}
#weather-animation-container { position: absolute; top: 0; left: 0; width: 100%; height: 100%; overflow: hidden; z-index: -1; pointer-events: none; }
.celestial-body { position: absolute; width: 100px; height: 100px; opacity: 0; transition: opacity 1.5s ease-in-out, transform 1.5s ease-in-out; animation-duration: 60s; animation-iteration-count: infinite; animation-timing-function: linear; }
#sun { top: 10%; right: 10%; fill: var(--sun-color); filter: drop-shadow(0 0 20px var(--sun-color)); animation-name: slowDrift; }
#moon { top: 10%; right: 10%; fill: var(--moon-color); filter: drop-shadow(0 0 15px var(--moon-color)); animation-name: slowDrift; }
@keyframes slowDrift { 0% { transform: translate(0,0) rotate(0deg); } 25% { transform: translate(-5px, 5px) rotate(5deg); } 50% { transform: translate(0px, 10px) rotate(0deg); } 75% { transform: translate(5px, 5px) rotate(-5deg); } 100% { transform: translate(0,0) rotate(0deg); } }
.cloud-group { position: absolute; width:100%; height:100%; top:0; left:0; }
.cloud-svg { position: absolute; opacity: 0.7; animation-duration: 60s; animation-iteration-count: infinite; animation-timing-function: linear; animation-name: moveCloud; transition: opacity 1.5s ease, fill 1.5s ease; }
.cloud-svg.fast { animation-duration: 30s !important; } .cloud-svg.slow { animation-duration: 90s !important; }
@keyframes moveCloud { from { transform: translateX(-100%); } to { transform: translateX(100vw); } }
.precipitation { position: absolute; top:0; left:0; width:100%; height:100%; }
.particle { position: absolute; background-color: var(--rain-color); border-radius: 50%; animation-name: fall; animation-iteration-count: infinite; animation-timing-function: linear; opacity: 0; }
.particle.rain-drop { width: 2px; height: 15px; border-radius: 0 0 5px 5px; background-color: var(--rain-color); }
.particle.snow-flake { width: 8px; height: 8px; background-color: var(--snow-color); border-radius: 50%; }
@keyframes fall { 0% { transform: translateY(-10vh) translateX(0); opacity: 0; } 10% { opacity: 1; } 90% { opacity: 1; } 100% { transform: translateY(110vh) translateX(20px); opacity: 0; } }
@keyframes fall-snow { 0% { transform: translateY(-10vh) translateX(0px); opacity: 0; } 10% { opacity: 0.8; } 100% { transform: translateY(110vh) translateX(100px) rotate(360deg); opacity: 0; } }
#lightning { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background-color: var(--lightning-color); opacity: 0; z-index: 10; }
@keyframes flash { 0%, 100% { opacity: 0; } 50% { opacity: 0.3; } }
.loader-container { display: flex; flex-direction: column; align-items: center; justify-content: center; }
.loader { border: 5px solid rgba(255,255,255,0.2); border-top: 5px solid #FFF; border-radius: 50%; width: 60px; height: 60px; animation: spin 1.2s linear infinite; margin-bottom: 10px; }
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }
.message-box { position: fixed; top: 20px; left: 50%; transform: translateX(-50%); background-color: rgba(0,0,0,0.7); color: white; padding: 1rem 1.5rem; border-radius: 12px; box-shadow: 0 5px 20px rgba(0,0,0,0.3); z-index: 1000; opacity: 0; visibility: hidden; transition: opacity 0.5s, visibility 0.5s, transform 0.5s; font-size: 1rem; border-left: 5px solid red; }
.message-box.success { border-left-color: #4CAF50; } .message-box.warning { border-left-color: #FFC107; }
.message-box.show { opacity: 1; visibility: visible; transform: translateX(-50%) translateY(10px); }
.data-section { background-color: rgba(255, 255, 255, 0.07); border-radius: 16px; padding: 1rem; margin-bottom: 1rem; border: 1px solid rgba(255, 255, 255, 0.1); transition: background-color 0.3s ease; }
.data-section-header { display: flex; justify-content: space-between; align-items: center; cursor: pointer; padding: 0.25rem 0; }
.data-section-header:hover:not([aria-disabled="true"]) { background-color: rgba(255, 255, 255, 0.05); }
.data-section h3 { font-size: 1.125rem; font-weight: 600; color: rgba(255,255,255,0.95); margin: 0; }
.data-section p { color: rgba(255,255,255,0.85); } .data-section strong { color: rgba(255,255,255,1); }
.expand-arrow { width: 20px; height: 20px; transition: transform 0.3s ease; fill: rgba(255,255,255,0.7); }
.expanded .expand-arrow { transform: rotate(180deg); }
.data-section-content-primary { padding-top: 0.5rem; }
.data-section-content-additional {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.35s ease-in-out, opacity 0.3s ease-in;
}

.data-section-content-additional .content-wrapper {
    padding-top: 0.75rem;
    margin-top: 0.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.expanded .data-section-content-additional {
    opacity: 1;
}

h2 { font-size: 1.5rem; }
#temperature { font-size: 2.25rem; } @media (min-width: 640px) { #temperature { font-size: 3rem; } }
#last-updated { font-size: 0.75rem; color: rgba(255,255,255,0.6); text-align: center; margin-top: 0.5rem; height: 1em; }

#language-selector-container {
    display: flex;
    align-items: center;
    justify-content: center; 
    margin-bottom: 1rem;
}
#lang-select {
    background-color: rgba(0,0,0,0.4); 
    color: white;
    padding: 0.6rem 1rem; 
    padding-right: 2.5rem; 
    border-radius: 20px;  
    border: 1px solid rgba(255,255,255,0.25);
    font-size: 0.9rem;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url('data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%23FFFFFF%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E');
    background-repeat: no-repeat;
    background-position: right 0.8rem center; 
    background-size: 0.65em auto;
    cursor: pointer;
    transition: background-color 0.2s ease, border-color 0.2s ease;
}
#lang-select:hover {
    background-color: rgba(0,0,0,0.5);
    border-color: rgba(255,255,255,0.4);
}
#lang-select:focus {
    outline: none;
    border-color: rgba(255,255,255,0.6);
    box-shadow: 0 0 0 2px rgba(255,255,255,0.3); 
}

#wind-vane-svg { display: block; width: 50px; height: 50px; margin-left: auto; margin-right: auto; }

#current-hourly-forecast {
    display: flex;
    justify-content: center;
    align-items: center;
}

#current-hourly-forecast .hourly-item {
    padding: 1.2rem 1.5rem; 
    border-width: 2px;
    border-color: rgba(255, 255, 255, 0.6); 
    box-shadow: 0 5px 25px rgba(230, 230, 255, 0.35); 
    margin-bottom: 1.5rem; 
    border-radius: 20px; 
    background-color: rgba(0, 0, 0, 0.35);
    width: auto; 
    max-width: 280px; 
}
#current-hourly-forecast .hourly-item .time {
    font-size: 1.4rem; 
    font-weight: 700; 
    color: rgba(255,255,255,1); 
}
#current-hourly-forecast .hourly-item .icon {
    font-size: 4.5rem; 
    margin: 0.75rem 0; 
    line-height: 1;
}
#current-hourly-forecast .hourly-item .temp {
    font-size: 2.5rem; 
    font-weight: 700; 
}
#current-hourly-forecast .hourly-item .precip {
    font-size: 1rem; 
    margin-top: 0.35rem;
    color: rgba(190, 220, 250, 0.95); 
}

#upcoming-hourly-forecasts, #weekly-forecast-container {
    display: flex;
    flex-direction: row;
    gap: 0.75rem;
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 12px;
    padding-left: 5px;
    padding-right: 5px;
    flex-wrap: nowrap;
    min-height: 135px;
    justify-content: flex-start;
    
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.25) rgba(255,255,255,0.08);
}

#upcoming-hourly-forecasts::-webkit-scrollbar, #weekly-forecast-container::-webkit-scrollbar {
    height: 8px;
}

#upcoming-hourly-forecasts::-webkit-scrollbar-track, #weekly-forecast-container::-webkit-scrollbar-track {
    background: rgba(255,255,255,0.08);
    border-radius: 10px;
}

#upcoming-hourly-forecasts::-webkit-scrollbar-thumb, #weekly-forecast-container::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.25);
    border-radius: 10px;
}

#upcoming-hourly-forecasts::-webkit-scrollbar-thumb:hover, #weekly-forecast-container::-webkit-scrollbar-thumb:hover {
    background: rgba(255,255,255,0.8);
    cursor: pointer;
}

.weekly-item {
    flex-shrink: 0;
    padding: 0.75rem 0.5rem;
    background-color: rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.1);
    width: 120px;
    display: flex;
    flex-direction: column;
    justify-content: space-around;
}

.weekly-item .day { font-size: 0.9rem; font-weight: 600; color: rgba(255,255,255,0.95); }
.weekly-item .icon { font-size: 2.5rem; margin: 0.5rem 0; line-height: 1; }
.weekly-item .temp { font-size: 0.9rem; font-weight: 500; }
.weekly-item .temp .max-temp { font-weight: 700; color: white; }
.weekly-item .temp .min-temp { color: rgba(255,255,255,0.7); }
.weekly-item .precip { font-size: 0.75rem; color: rgba(173, 216, 230, 0.9); margin-top: 0.25rem; }

.hourly-item {
    flex-shrink: 0; 
    padding: 0.75rem 0.5rem;
    background-color: rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.1);
    width: 100px; 
    transition: opacity 0.5s ease-out, transform 0.5s ease-out, filter 0.5s ease-out, border-color 0.3s ease, box-shadow 0.3s ease;
}

.hourly-item .time { font-size: 0.8rem; font-weight: 500; color: rgba(255,255,255,0.85); }
.hourly-item .icon { font-size: 1.75rem; margin: 0.25rem 0; line-height: 1; }
.hourly-item .temp { font-size: 1rem; font-weight: 600; }
.hourly-item .precip { font-size: 0.7rem; color: rgba(173, 216, 230, 0.9); margin-top: 0.15rem; }


.hourly-item.fog-out {
    animation: fogOutAnimation 0.7s forwards ease-in-out;
}
@keyframes fogOutAnimation {
    0% { opacity: 1; transform: scale(1) translateY(0); filter: blur(0); }
    100% { opacity: 0; transform: scale(0.85) translateY(-15px); filter: blur(5px); visibility: hidden; }
}

.hourly-item.zoom-in {
    animation: zoomInAppearAnimation 0.5s forwards ease-out;
    opacity: 0; 
}
@keyframes zoomInAppearAnimation {
    0% { opacity: 0; transform: scale(0.8); }
    100% { opacity: 1; transform: scale(1); }
}
.hidden { display: none !important; }
