* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 25%, #f093fb 50%, #f5576c 75%, #4facfe 100%);
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
    min-height: 100vh;
    color: #333;
    overflow-x: hidden;
    position: relative;
}

/* Animated background particles */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(circle at 20% 80%, rgba(255,255,255,0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(255,255,255,0.1) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(255,255,255,0.05) 0%, transparent 50%);
    animation: floatingParticles 20s ease-in-out infinite;
    pointer-events: none;
    z-index: -1;
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@keyframes floatingParticles {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    33% { transform: translateY(-20px) rotate(120deg); }
    66% { transform: translateY(10px) rotate(240deg); }
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    position: relative;
    z-index: 1;
}

/* Header Styles with enhanced animations */
.header {
    text-align: center;
    margin-bottom: 40px;
    color: white;
    animation: slideInFromTop 1s ease-out;
}

.header h1 {
    font-size: 3rem;
    margin-bottom: 15px;
    text-shadow: 0 4px 20px rgba(0,0,0,0.3);
    background: linear-gradient(45deg, #fff, #f0f8ff, #e6f3ff);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: titleGlow 3s ease-in-out infinite alternate;
    position: relative;
}

.header h1 i {
    display: inline-block;
    animation: iconBounce 2s ease-in-out infinite;
    margin-right: 15px;
    filter: drop-shadow(0 0 10px rgba(255,255,255,0.5));
}

.header p {
    font-size: 1.2rem;
    opacity: 0.9;
    animation: fadeInUp 1s ease-out 0.5s both;
    text-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

@keyframes slideInFromTop {
    0% { transform: translateY(-100px); opacity: 0; }
    100% { transform: translateY(0); opacity: 1; }
}

@keyframes titleGlow {
    0% { text-shadow: 0 4px 20px rgba(0,0,0,0.3), 0 0 30px rgba(255,255,255,0.2); }
    100% { text-shadow: 0 4px 20px rgba(0,0,0,0.3), 0 0 50px rgba(255,255,255,0.4); }
}

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

@keyframes fadeInUp {
    0% { transform: translateY(30px); opacity: 0; }
    100% { transform: translateY(0); opacity: 1; }
}

/* Enhanced Search Container */
.search-container {
    position: relative;
    max-width: 500px;
    margin: 0 auto 40px;
    animation: slideInFromLeft 1s ease-out 0.3s both;
}

.search-box {
    display: flex;
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(20px);
    border-radius: 30px;
    box-shadow: 
        0 8px 32px rgba(0,0,0,0.1),
        0 0 0 1px rgba(255,255,255,0.2),
        inset 0 1px 0 rgba(255,255,255,0.9);
    overflow: hidden;
    transition: all 0.3s ease;
    position: relative;
}

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

.search-box:hover::before {
    left: 100%;
}

.search-box:hover {
    transform: translateY(-2px);
    box-shadow: 
        0 12px 40px rgba(0,0,0,0.15),
        0 0 0 1px rgba(255,255,255,0.3),
        inset 0 1px 0 rgba(255,255,255,0.9);
}

#cityInput {
    flex: 1;
    padding: 18px 25px;
    border: none;
    outline: none;
    font-size: 1.1rem;
    background: transparent;
    color: #333;
    transition: all 0.3s ease;
}

#cityInput::placeholder {
    color: #999;
    transition: color 0.3s ease;
}

#cityInput:focus::placeholder {
    color: #ccc;
}

#searchBtn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    padding: 18px 25px;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

#searchBtn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255,255,255,0.2);
    border-radius: 50%;
    transition: all 0.3s ease;
    transform: translate(-50%, -50%);
}

#searchBtn:hover::before {
    width: 100px;
    height: 100px;
}

#searchBtn:hover {
    background: linear-gradient(135deg, #5a67d8 0%, #6b46c1 100%);
    transform: scale(1.05);
}

#searchBtn i {
    position: relative;
    z-index: 1;
    transition: transform 0.3s ease;
}

#searchBtn:hover i {
    transform: scale(1.1) rotate(90deg);
}

@keyframes slideInFromLeft {
    0% { transform: translateX(-100px); opacity: 0; }
    100% { transform: translateX(0); opacity: 1; }
}

/* Enhanced Suggestions */
.suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(20px);
    border-radius: 0 0 20px 20px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.1);
    z-index: 1000;
    display: none;
    overflow: hidden;
    animation: slideDown 0.3s ease-out;
}

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

.suggestion-item {
    padding: 15px 25px;
    cursor: pointer;
    border-bottom: 1px solid rgba(0,0,0,0.05);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.suggestion-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(102,126,234,0.1), transparent);
    transition: left 0.3s ease;
}

.suggestion-item:hover::before {
    left: 100%;
}

.suggestion-item:hover {
    background: rgba(102,126,234,0.05);
    transform: translateX(5px);
}

/* Enhanced Weather Container */
.weather-container {
    display: none;
    animation: weatherAppear 0.8s ease-out;
}

@keyframes weatherAppear {
    0% { 
        opacity: 0; 
        transform: translateY(50px) scale(0.9);
    }
    100% { 
        opacity: 1; 
        transform: translateY(0) scale(1);
    }
}

.current-weather {
    background: rgba(255,255,255,0.1);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 25px;
    padding: 40px;
    margin-bottom: 30px;
    box-shadow: 
        0 8px 32px rgba(0,0,0,0.1),
        inset 0 1px 0 rgba(255,255,255,0.2);
    text-align: center;
    position: relative;
    overflow: hidden;
    animation: float 6s ease-in-out infinite;
}

.current-weather::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: conic-gradient(from 0deg, transparent, rgba(255,255,255,0.1), transparent);
    animation: rotate 10s linear infinite;
    pointer-events: none;
}

.current-weather::after {
    content: '';
    position: absolute;
    top: 10px;
    left: 10px;
    right: 10px;
    bottom: 10px;
    background: rgba(255,255,255,0.05);
    border-radius: 20px;
    pointer-events: none;
}

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

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

.weather-icon {
    font-size: 5rem;
    margin-bottom: 20px;
    position: relative;
    z-index: 1;
    animation: iconPulse 3s ease-in-out infinite;
    filter: drop-shadow(0 0 20px rgba(255,255,255,0.3));
}

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

.temperature {
    font-size: 4rem;
    font-weight: bold;
    background: linear-gradient(45deg, #fff, #e6f3ff);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 15px;
    position: relative;
    z-index: 1;
    animation: temperatureGlow 2s ease-in-out infinite alternate;
}

@keyframes temperatureGlow {
    0% { filter: drop-shadow(0 0 10px rgba(255,255,255,0.3)); }
    100% { filter: drop-shadow(0 0 20px rgba(255,255,255,0.6)); }
}

.city-name {
    font-size: 1.8rem;
    margin-bottom: 10px;
    color: white;
    position: relative;
    z-index: 1;
    text-shadow: 0 2px 10px rgba(0,0,0,0.3);
    animation: fadeInUp 1s ease-out 0.5s both;
}

.weather-description {
    font-size: 1.3rem;
    color: rgba(255,255,255,0.9);
    text-transform: capitalize;
    margin-bottom: 20px;
    position: relative;
    z-index: 1;
    animation: fadeInUp 1s ease-out 0.7s both;
}

.date-time {
    color: rgba(255,255,255,0.8);
    font-size: 1rem;
    position: relative;
    z-index: 1;
    animation: fadeInUp 1s ease-out 0.9s both;
}

/* Enhanced Weather Details */
.weather-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
    animation: staggerIn 1s ease-out 0.3s both;
}

@keyframes staggerIn {
    0% { opacity: 0; transform: translateY(30px); }
    100% { opacity: 1; transform: translateY(0); }
}

.detail-card {
    background: rgba(255,255,255,0.1);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 20px;
    padding: 25px;
    box-shadow: 
        0 8px 32px rgba(0,0,0,0.1),
        inset 0 1px 0 rgba(255,255,255,0.2);
    text-align: center;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    animation: cardSlideIn 0.6s ease-out;
}

.detail-card:nth-child(1) { animation-delay: 0.1s; }
.detail-card:nth-child(2) { animation-delay: 0.2s; }
.detail-card:nth-child(3) { animation-delay: 0.3s; }
.detail-card:nth-child(4) { animation-delay: 0.4s; }
.detail-card:nth-child(5) { animation-delay: 0.5s; }
.detail-card:nth-child(6) { animation-delay: 0.6s; }

@keyframes cardSlideIn {
    0% { 
        opacity: 0; 
        transform: translateY(50px) rotateX(45deg);
    }
    100% { 
        opacity: 1; 
        transform: translateY(0) rotateX(0deg);
    }
}

.detail-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;
}

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

.detail-card:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 
        0 15px 40px rgba(0,0,0,0.15),
        inset 0 1px 0 rgba(255,255,255,0.3);
}

.detail-card i {
    font-size: 2.5rem;
    color: white;
    margin-bottom: 15px;
    animation: iconFloat 3s ease-in-out infinite;
    filter: drop-shadow(0 0 10px rgba(255,255,255,0.3));
}

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

.detail-value {
    font-size: 1.8rem;
    font-weight: bold;
    color: white;
    margin-bottom: 8px;
    text-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

.detail-label {
    color: rgba(255,255,255,0.8);
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Enhanced Forecast Container */
.forecast-container {
    background: rgba(255,255,255,0.1);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 25px;
    padding: 30px;
    box-shadow: 
        0 8px 32px rgba(0,0,0,0.1),
        inset 0 1px 0 rgba(255,255,255,0.2);
    animation: slideInFromBottom 1s ease-out 0.5s both;
}

@keyframes slideInFromBottom {
    0% { transform: translateY(100px); opacity: 0; }
    100% { transform: translateY(0); opacity: 1; }
}

.forecast-title {
    text-align: center;
    font-size: 1.5rem;
    margin-bottom: 25px;
    color: white;
    text-shadow: 0 2px 10px rgba(0,0,0,0.3);
    position: relative;
}

.forecast-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 50px;
    height: 2px;
    background: linear-gradient(90deg, transparent, white, transparent);
    animation: lineGlow 2s ease-in-out infinite alternate;
}

@keyframes lineGlow {
    0% { box-shadow: 0 0 5px rgba(255,255,255,0.5); }
    100% { box-shadow: 0 0 15px rgba(255,255,255,0.8); }
}

.forecast-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 20px;
}

.forecast-item {
    text-align: center;
    padding: 20px;
    border-radius: 15px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    animation: forecastSlideIn 0.6s ease-out;
}

.forecast-item:nth-child(1) { animation-delay: 0.1s; }
.forecast-item:nth-child(2) { animation-delay: 0.2s; }
.forecast-item:nth-child(3) { animation-delay: 0.3s; }
.forecast-item:nth-child(4) { animation-delay: 0.4s; }
.forecast-item:nth-child(5) { animation-delay: 0.5s; }

@keyframes forecastSlideIn {
    0% { 
        opacity: 0; 
        transform: translateX(-30px) rotateY(45deg);
    }
    100% { 
        opacity: 1; 
        transform: translateX(0) rotateY(0deg);
    }
}

.forecast-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.1), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.forecast-item:hover::before {
    opacity: 1;
}

.forecast-item:hover {
    transform: translateY(-5px) scale(1.05);
    background: rgba(255,255,255,0.1);
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
}

.forecast-day {
    font-weight: bold;
    margin-bottom: 10px;
    color: white;
    font-size: 1.1rem;
}

.forecast-icon {
    font-size: 2rem;
    margin-bottom: 10px;
    color: white;
    animation: forecastIconBounce 2s ease-in-out infinite;
    filter: drop-shadow(0 0 8px rgba(255,255,255,0.3));
}

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

.forecast-temp {
    font-size: 1.1rem;
    color: rgba(255,255,255,0.9);
    font-weight: bold;
}

.forecast-desc {
    font-size: 0.9rem;
    color: rgba(255,255,255,0.7);
    margin-top: 5px;
    text-transform: capitalize;
}

/* Enhanced Loading Spinner */
.loading {
    display: none;
    text-align: center;
    color: white;
    margin: 50px 0;
    animation: loadingPulse 2s ease-in-out infinite;
}

@keyframes loadingPulse {
    0%, 100% { opacity: 0.7; }
    50% { opacity: 1; }
}

.spinner {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(255,255,255,0.2);
    border-top: 4px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite, spinnerGlow 2s ease-in-out infinite alternate;
    margin: 0 auto 20px;
    position: relative;
}

.spinner::before {
    content: '';
    position: absolute;
    top: -4px;
    left: -4px;
    right: -4px;
    bottom: -4px;
    border: 2px solid transparent;
    border-top: 2px solid rgba(255,255,255,0.5);
    border-radius: 50%;
    animation: spin 2s linear infinite reverse;
}

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

@keyframes spinnerGlow {
    0% { box-shadow: 0 0 10px rgba(255,255,255,0.3); }
    100% { box-shadow: 0 0 25px rgba(255,255,255,0.6); }
}

/* Enhanced Error Styles */
.error {
    display: none;
    background: rgba(231, 76, 60, 0.1);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(231, 76, 60, 0.3);
    color: white;
    padding: 25px;
    border-radius: 20px;
    text-align: center;
    margin: 20px 0;
    animation: errorShake 0.5s ease-in-out;
    position: relative;
    overflow: hidden;
}

.error::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(231, 76, 60, 0.1), transparent);
    animation: errorSlide 2s ease-in-out infinite;
}

@keyframes errorShake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

@keyframes errorSlide {
    0% { left: -100%; }
    100% { left: 100%; }
}

.error i {
    font-size: 2.5rem;
    margin-bottom: 15px;
    animation: errorIconPulse 1s ease-in-out infinite;
}

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

/* Enhanced Footer */
.footer {
    text-align: center;
    color: rgba(255,255,255,0.8);
    margin-top: 40px;
    font-size: 1rem;
    animation: fadeInUp 1s ease-out 1s both;
    position: relative;
}

.footer::before {
    content: '';
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
}

/* Responsive Design with enhanced animations */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    .header h1 {
        font-size: 2.5rem;
    }
    
    .current-weather {
        padding: 25px;
    }
    
    .temperature {
        font-size: 3rem;
    }
    
    .weather-details {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .forecast-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .detail-card {
        padding: 20px;
    }
}

@media (max-width: 480px) {
    .header h1 {
        font-size: 2rem;
    }
    
    .temperature {
        font-size: 2.5rem;
    }
    
    .forecast-grid {
        grid-template-columns: 1fr;
    }
    
    .search-box {
        border-radius: 20px;
    }
    
    #cityInput, #searchBtn {
        padding: 15px 20px;
    }
    
    .current-weather {
        padding: 20px;
    }
    
    .weather-icon {
        font-size: 4rem;
    }
}

/* Additional decorative animations */
@keyframes twinkle {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 1; }
}

.weather-container::before {
    content: '✨';
    position: absolute;
    top: 10%;
    left: 10%;
    font-size: 1rem;
    animation: twinkle 3s ease-in-out infinite;
    animation-delay: 0s;
}

.weather-container::after {
    content: '⭐';
    position: absolute;
    top: 20%;
    right: 15%;
    font-size: 0.8rem;
    animation: twinkle 3s ease-in-out infinite;
    animation-delay: 1.5s;
}

/* Smooth scroll behavior */
html {
    scroll-behavior: smooth;
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(255,255,255,0.1);
}

::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.3);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255,255,255,0.5);
}