/* weather-system.css — Dynamic Day/Night & Weather for Chifftown */

/* === ATMOSPHERIC OVERLAY === */
.atmospheric-overlay {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 5;
    transition: all 2s ease-in-out;
}

/* === AMBIENT GLOW EFFECTS === */
.time-dawn #mapContainer::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 40%;
    background: linear-gradient(to top, rgba(255, 150, 50, 0.1), transparent);
    pointer-events: none;
    z-index: 4;
}

.time-dusk #mapContainer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 50%;
    background: linear-gradient(to bottom, rgba(255, 100, 50, 0.15), transparent);
    pointer-events: none;
    z-index: 4;
}

.time-night #mapContainer::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at 30% 20%, rgba(100, 150, 255, 0.03), transparent 50%),
                radial-gradient(ellipse at 70% 30%, rgba(150, 100, 255, 0.02), transparent 40%);
    pointer-events: none;
    z-index: 4;
    animation: moonGlow 10s ease-in-out infinite;
}

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

/* === TIME OF DAY STATES === */
.time-dawn .atmospheric-overlay {
    background: linear-gradient(to bottom, 
        rgba(255, 183, 94, 0.15) 0%, 
        rgba(255, 220, 150, 0.1) 30%,
        rgba(135, 206, 250, 0.05) 100%
    );
}

.time-day .atmospheric-overlay {
    background: linear-gradient(to bottom,
        rgba(135, 206, 250, 0.1) 0%,
        rgba(255, 255, 255, 0.05) 100%
    );
}

.time-dusk .atmospheric-overlay {
    background: linear-gradient(to bottom,
        rgba(255, 94, 77, 0.2) 0%,
        rgba(147, 51, 234, 0.15) 50%,
        rgba(30, 20, 50, 0.25) 100%
    );
}

.time-night .atmospheric-overlay {
    background: linear-gradient(to bottom,
        rgba(10, 10, 30, 0.5) 0%,
        rgba(20, 15, 40, 0.4) 100%
    );
}

/* === WEATHER EFFECTS === */

/* Rain Effect */
.weather-rain .rain-container {
    display: block !important;
}

.rain-container {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    z-index: 6;
    display: none;
}

.rain-drop {
    position: absolute;
    width: 2px;
    height: 20px;
    background: linear-gradient(to bottom, 
        transparent,
        rgba(174, 194, 224, 0.5),
        rgba(174, 194, 224, 0.8)
    );
    animation: rainFall linear infinite;
    opacity: 0.6;
}

@keyframes rainFall {
    0% {
        transform: translateY(-100vh) translateX(0);
        opacity: 0;
    }
    10% {
        opacity: 0.6;
    }
    90% {
        opacity: 0.6;
    }
    100% {
        transform: translateY(100vh) translateX(50px);
        opacity: 0;
    }
}

/* Snow Effect */
.weather-snow .snow-container {
    display: block !important;
}

.snow-container {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    z-index: 6;
    display: none;
}

.snowflake {
    position: absolute;
    width: 8px;
    height: 8px;
    background: radial-gradient(circle, #fff 0%, rgba(255,255,255,0.8) 50%, transparent 100%);
    border-radius: 50%;
    animation: snowFall linear infinite;
    opacity: 0.8;
}

@keyframes snowFall {
    0% {
        transform: translateY(-100vh) translateX(0) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 0.8;
    }
    90% {
        opacity: 0.8;
    }
    100% {
        transform: translateY(100vh) translateX(100px) rotate(360deg);
        opacity: 0;
    }
}

/* Fog Effect */
.weather-fog .fog-container {
    display: block !important;
}

.fog-container {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 4;
    display: none;
}

.fog-layer {
    position: absolute;
    width: 200%;
    height: 100%;
    background: radial-gradient(ellipse at center,
        rgba(200, 200, 210, 0.15) 0%,
        rgba(180, 180, 200, 0.08) 40%,
        transparent 70%
    );
    animation: fogDrift 40s ease-in-out infinite;
}

.fog-layer:nth-child(1) {
    animation-duration: 35s;
    opacity: 0.5;
}

.fog-layer:nth-child(2) {
    animation-duration: 45s;
    animation-delay: -10s;
    opacity: 0.3;
}

@keyframes fogDrift {
    0%, 100% {
        transform: translateX(-25%);
    }
    50% {
        transform: translateX(0);
    }
}

/* === LIGHTING ADJUSTMENTS === */

/* Dawn lighting - warm golden glow */
.time-dawn .map-hotspot .hotspot-glow {
    filter: hue-rotate(-20deg) saturate(1.2);
}

.time-dawn .city-map-image {
    filter: brightness(1.1) saturate(1.15) hue-rotate(-10deg);
}

/* Day lighting - bright and clear */
.time-day .city-map-image {
    filter: brightness(1.2) saturate(1.1);
}

.time-day .map-hotspot .hotspot-glow {
    opacity: 0.7;
}

/* Dusk lighting - purple/orange glow */
.time-dusk .city-map-image {
    filter: brightness(0.9) saturate(1.3) hue-rotate(10deg);
}

.time-dusk .map-hotspot .hotspot-glow {
    filter: hue-rotate(30deg) saturate(1.4);
}

/* Night lighting - dim with enhanced building lights */
.time-night .city-map-image {
    filter: brightness(0.6) saturate(0.8) contrast(1.2);
}

.time-night .map-hotspot .hotspot-glow {
    opacity: 1.2;
    filter: brightness(1.5);
}

.time-night .occupancy-badge {
    box-shadow: 0 4px 20px rgba(244, 197, 66, 0.8);
}

/* === STARS (Night only) === */
.time-night .stars-container {
    display: block !important;
}

.stars-container {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 3;
    display: none;
}

.star {
    position: absolute;
    width: 2px;
    height: 2px;
    background: white;
    border-radius: 50%;
    box-shadow: 0 0 2px rgba(255, 255, 255, 0.8);
    animation: starTwinkle 3s ease-in-out infinite;
}

/* Star varieties */
.star.bright {
    width: 3px;
    height: 3px;
    box-shadow: 0 0 4px 1px rgba(255, 255, 255, 0.9),
                0 0 8px 2px rgba(200, 220, 255, 0.4);
}

.star.blue {
    background: #aaccff;
    box-shadow: 0 0 3px rgba(170, 200, 255, 0.9);
}

.star.gold {
    background: #ffffaa;
    box-shadow: 0 0 3px rgba(255, 255, 170, 0.8);
}

@keyframes starTwinkle {
    0%, 100% { opacity: 0.3; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.2); }
}

@keyframes starTwinkleFast {
    0%, 100% { opacity: 0.2; }
    25% { opacity: 0.8; }
    50% { opacity: 0.4; }
    75% { opacity: 1; }
}

/* Some stars twinkle faster */
.star:nth-child(5n) {
    animation: starTwinkleFast 2s ease-in-out infinite;
}

.star:nth-child(7n) {
    animation-duration: 4s;
}

/* === WEATHER CONTROL PANEL === */
.weather-controls {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(10, 10, 26, 0.95);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(244, 197, 66, 0.3);
    border-radius: 12px;
    padding: 1rem;
    z-index: 100;
    display: none;
    flex-direction: column;
    gap: 0.75rem;
    min-width: 200px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.fullscreen-map .weather-controls {
    display: flex;
}

.weather-control-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: #f4c542;
    margin-bottom: 0.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.weather-option-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.weather-option-label {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.6);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.25rem;
}

.weather-btn-group {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.weather-btn {
    flex: 1;
    min-width: 70px;
    padding: 0.4rem 0.6rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
}

.weather-btn:hover {
    background: rgba(244, 197, 66, 0.2);
    border-color: rgba(244, 197, 66, 0.5);
    color: #f4c542;
    transform: translateY(-1px);
}

.weather-btn.active {
    background: rgba(244, 197, 66, 0.3);
    border-color: #f4c542;
    color: #f4c542;
    font-weight: 600;
}

.auto-cycle-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.auto-cycle-toggle:hover {
    background: rgba(255, 255, 255, 0.08);
}

.toggle-switch {
    width: 40px;
    height: 20px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    position: relative;
    transition: all 0.3s ease;
}

.toggle-switch.active {
    background: #f4c542;
}

.toggle-slider {
    position: absolute;
    width: 16px;
    height: 16px;
    background: white;
    border-radius: 50%;
    top: 2px;
    left: 2px;
    transition: all 0.3s ease;
}

.toggle-switch.active .toggle-slider {
    left: 22px;
}

/* === AMBIENT SOUNDS INDICATOR === */
.ambient-status {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(10, 10, 26, 0.9);
    backdrop-filter: blur(10px);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    border: 1px solid rgba(244, 197, 66, 0.2);
    display: none;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.7);
    z-index: 100;
}

.fullscreen-map .ambient-status {
    display: flex;
}

.ambient-icon {
    font-size: 1rem;
    animation: pulse 2s ease-in-out infinite;
}

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

/* === RESPONSIVE === */
@media (max-width: 768px) {
    .weather-controls {
        top: 10px;
        right: 10px;
        padding: 0.75rem;
        min-width: 160px;
    }
    
    .weather-btn {
        min-width: 60px;
        padding: 0.3rem 0.5rem;
        font-size: 0.7rem;
    }
    
    .weather-control-title {
        font-size: 0.8rem;
    }
}
