/* Weather Background Animations */

/* Sunny Animation */
.sunny-bg {
    background: linear-gradient(135deg, #ffd89b 0%, #19547b 100%);
    position: relative;
}

.sunny-bg::before {
    content: '';
    position: absolute;
    top: 20%;
    right: 20%;
    width: 100px;
    height: 100px;
    background: radial-gradient(circle, #ffeb3b 0%, #ffc107 70%, transparent 100%);
    border-radius: 50%;
    animation: sunPulse 4s ease-in-out infinite;
}

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

/* Sunny rays */
.sunny-particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.sun-ray {
    position: absolute;
    width: 2px;
    height: 20px;
    background: linear-gradient(to bottom, #ffeb3b, transparent);
    animation: sunRays 3s linear infinite;
}

@keyframes sunRays {
    0% { transform: translateY(-100px) rotate(0deg); opacity: 0; }
    50% { opacity: 1; }
    100% { transform: translateY(100px) rotate(180deg); opacity: 0; }
}

/* Cloudy Animation */
.cloudy-bg {
    background: linear-gradient(135deg, #bdc3c7 0%, #2c3e50 100%);
    position: relative;
}

.cloud {
    position: absolute;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 50px;
    animation: cloudDrift 20s linear infinite;
}

.cloud::before,
.cloud::after {
    content: '';
    position: absolute;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 50px;
}

.cloud-1 {
    width: 60px;
    height: 30px;
    top: 20%;
    left: -80px;
    animation-duration: 25s;
}

.cloud-1::before {
    width: 40px;
    height: 40px;
    top: -20px;
    left: 10px;
}

.cloud-1::after {
    width: 30px;
    height: 30px;
    top: -15px;
    right: 10px;
}

.cloud-2 {
    width: 80px;
    height: 40px;
    top: 40%;
    left: -100px;
    animation-duration: 30s;
    animation-delay: -10s;
}

.cloud-2::before {
    width: 50px;
    height: 50px;
    top: -25px;
    left: 15px;
}

.cloud-2::after {
    width: 40px;
    height: 40px;
    top: -20px;
    right: 15px;
}

.cloud-3 {
    width: 70px;
    height: 35px;
    top: 60%;
    left: -90px;
    animation-duration: 35s;
    animation-delay: -20s;
}

.cloud-3::before {
    width: 45px;
    height: 45px;
    top: -22px;
    left: 12px;
}

.cloud-3::after {
    width: 35px;
    height: 35px;
    top: -18px;
    right: 12px;
}

@keyframes cloudDrift {
    0% { left: -100px; }
    100% { left: calc(100% + 100px); }
}

/* Rainy Animation */
.rainy-bg {
    background: linear-gradient(135deg, #4b6cb7 0%, #182848 100%);
    position: relative;
}

.rain-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.raindrop {
    position: absolute;
    width: 2px;
    height: 15px;
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0.8), rgba(174, 194, 224, 0.6));
    border-radius: 0 0 50% 50%;
    animation: rainFall 1s linear infinite;
}

@keyframes rainFall {
    0% { transform: translateY(-100px); opacity: 1; }
    100% { transform: translateY(calc(100vh + 100px)); opacity: 0; }
}

/* Storm Animation */
.stormy-bg {
    background: linear-gradient(135deg, #2c3e50 0%, #000000 100%);
    position: relative;
}

.lightning {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.1);
    animation: lightning 4s ease-in-out infinite;
}

@keyframes lightning {
    0%, 90%, 100% { opacity: 0; }
    1%, 3%, 5% { opacity: 1; }
}

/* Snow Animation */
.snowy-bg {
    background: linear-gradient(135deg, #e6f2ff 0%, #b3d9ff 100%);
    position: relative;
}

.snowflake {
    position: absolute;
    color: rgba(255, 255, 255, 0.8);
    font-size: 1rem;
    animation: snowFall 3s linear infinite;
}

@keyframes snowFall {
    0% { 
        transform: translateY(-100px) translateX(0px);
        opacity: 1;
    }
    100% { 
        transform: translateY(calc(100vh + 100px)) translateX(100px);
        opacity: 0;
    }
}

/* Misty Animation */
.misty-bg {
    background: linear-gradient(135deg, #cfd9df 0%, #e2ebf0 100%);
    position: relative;
}

.mist {
    position: absolute;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    animation: mistMove 8s ease-in-out infinite;
}

.mist-1 {
    width: 200px;
    height: 50px;
    top: 30%;
    left: -100px;
}

.mist-2 {
    width: 150px;
    height: 40px;
    top: 50%;
    left: -75px;
    animation-delay: -3s;
}

.mist-3 {
    width: 180px;
    height: 45px;
    top: 70%;
    left: -90px;
    animation-delay: -6s;
}

@keyframes mistMove {
    0%, 100% { transform: translateX(0) scale(1); opacity: 0.3; }
    50% { transform: translateX(50px) scale(1.1); opacity: 0.6; }
}

/* Weather Icon Animations */
.weather-icon-main {
    animation: iconFloat 3s ease-in-out infinite;
}

@keyframes iconFloat {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

/* Pulse animation for temperature */
.temperature {
    animation: temperaturePulse 2s ease-in-out infinite;
}

@keyframes temperaturePulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.02); }
}

/* Card hover animations */
.forecast-card {
    position: relative;
    overflow: hidden;
}

.forecast-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.5s ease;
}

.forecast-card:hover::before {
    left: 100%;
}

/* Hourly item animations */
.hourly-item {
    position: relative;
    overflow: hidden;
}

.hourly-item::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--accent-color);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.hourly-item:hover::after {
    transform: scaleX(1);
}

/* Search suggestions animation */
.search-suggestions {
    animation: slideDown 0.3s ease;
}

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

/* Loading animation for cards */
.loading-card {
    background: linear-gradient(90deg, 
        var(--card-bg) 25%, 
        rgba(255, 255, 255, 0.1) 50%, 
        var(--card-bg) 75%
    );
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

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

/* Smooth transitions for theme switching */
body,
.card-bg,
.primary-bg,
.secondary-bg {
    transition: all 0.3s ease;
}

/* Stagger animation for forecast cards - REMOVED for uniform styling */
/* All forecast cards now have the same animation timing */

/* Breathing animation for important elements */
.breathing {
    animation: breathe 4s ease-in-out infinite;
}

@keyframes breathe {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

/* Typewriter effect for location name */
.typewriter {
    overflow: hidden;
    border-right: 2px solid var(--accent-color);
    white-space: nowrap;
    animation: typewriter 2s steps(40) 1s forwards, blink 0.75s step-end infinite;
}

@keyframes typewriter {
    from { width: 0; }
    to { width: 100%; }
}

@keyframes blink {
    from, to { border-color: transparent; }
    50% { border-color: var(--accent-color); }
}

/* Ripple effect for buttons */
.ripple {
    position: relative;
    overflow: hidden;
}

.ripple::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.ripple:active::after {
    width: 300px;
    height: 300px;
}

/* Particle system for weather effects */
.particle {
    position: absolute;
    pointer-events: none;
    opacity: 0.7;
}

.particle.fade-out-particle {
    animation: particleFadeOut 0.5s ease-out forwards;
}

@keyframes particleFadeOut {
    to {
        opacity: 0;
        transform: scale(0.8) translateY(-20px);
    }
}

/* Smooth scrolling indicator */
.scroll-indicator {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateX(-50%) translateY(0); }
    40% { transform: translateX(-50%) translateY(-10px); }
    60% { transform: translateX(-50%) translateY(-5px); }
}

/* Enhanced focus animations */
*:focus {
    animation: focusGlow 0.3s ease;
}

@keyframes focusGlow {
    0% { box-shadow: 0 0 0 0 var(--accent-color); }
    100% { box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.3); }
}
