/* ===============================================
   WeatherAI - Premium Enhanced UI with Animations
   =============================================== */

/* Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Premium Color Palette */
    --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-secondary: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --gradient-success: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    --gradient-warm: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
    --gradient-cool: linear-gradient(135deg, #30cfd0 0%, #330867 100%);
    --gradient-sunset: linear-gradient(135deg, #ff6b6b 0%, #feca57 50%, #48dbfb 100%);
    
    /* Glass Effect */
    --glass-bg: rgba(255, 255, 255, 0.1);
    --glass-border: rgba(255, 255, 255, 0.2);
    --glass-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37);
    
    /* Animations */
    --transition-smooth: cubic-bezier(0.4, 0, 0.2, 1);
    --transition-bounce: cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

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

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

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #667eea, #764ba2);
    border-radius: 10px;
}

/* Body with Animated Background */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

/* Animated Background Particles */
.background-animation {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 0;
    pointer-events: none;
}

/* Floating Orbs */
.gradient-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.6;
    animation: float 20s ease-in-out infinite;
}

.orb-1 {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(102, 126, 234, 0.8), transparent);
    top: -250px;
    left: -250px;
    animation-delay: 0s;
}

.orb-2 {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(236, 72, 153, 0.8), transparent);
    top: 50%;
    right: -200px;
    animation-delay: 7s;
}

.orb-3 {
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.8), transparent);
    bottom: -300px;
    left: 30%;
    animation-delay: 14s;
}

@keyframes float {
    0%, 100% { 
        transform: translate(0, 0) scale(1);
    }
    33% { 
        transform: translate(100px, -100px) scale(1.1);
    }
    66% { 
        transform: translate(-100px, 100px) scale(0.9);
    }
}

/* Weather Particles */
.weather-particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.particle {
    position: absolute;
    width: 3px;
    height: 3px;
    background: white;
    border-radius: 50%;
    opacity: 0.6;
    animation: fall linear infinite;
}

@keyframes fall {
    to {
        transform: translateY(100vh);
        opacity: 0;
    }
}

/* Main Container */
.container {
    position: relative;
    z-index: 2;
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
    min-height: 100vh;
}

/* Glass Header */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    box-shadow: var(--glass-shadow);
    margin-bottom: 3rem;
    animation: slideDown 0.8s var(--transition-bounce);
}

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

.logo {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.logo-icon {
    font-size: 2.5rem;
    animation: rotate 20s linear infinite;
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.logo-text {
    font-size: 1.8rem;
    font-weight: 700;
    background: linear-gradient(135deg, #fff, #f0f0f0);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -1px;
}

.logo-highlight {
    background: linear-gradient(135deg, #ffd700, #ffed4e);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Hero Section */
.hero {
    text-align: center;
    margin-bottom: 3rem;
    animation: fadeInUp 1s var(--transition-smooth) 0.3s both;
}

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

.hero-title {
    font-size: 4rem;
    font-weight: 800;
    color: white;
    margin-bottom: 1rem;
    line-height: 1.2;
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.gradient-text {
    background: linear-gradient(135deg, #ffd700 0%, #ffed4e 50%, #fff 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: shimmer 3s ease-in-out infinite;
    background-size: 200% auto;
}

@keyframes shimmer {
    0%, 100% { background-position: 0% center; }
    50% { background-position: 100% center; }
}

.hero-subtitle {
    font-size: 1.3rem;
    color: rgba(255, 255, 255, 0.9);
    max-width: 600px;
    margin: 0 auto;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

/* Search Section with Glass Effect */
.search-section {
    max-width: 800px;
    margin: 0 auto 4rem;
    animation: fadeInUp 1s var(--transition-smooth) 0.5s both;
}

.search-container {
    display: flex;
    gap: 1rem;
    padding: 0.8rem;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 50px;
    box-shadow: var(--glass-shadow);
    transition: all 0.3s var(--transition-smooth);
}

.search-container:focus-within {
    transform: translateY(-2px);
    box-shadow: 0 12px 40px 0 rgba(31, 38, 135, 0.5);
    border-color: rgba(255, 255, 255, 0.4);
}

.search-input {
    flex: 1;
    padding: 1rem 1.5rem;
    background: transparent;
    border: none;
    color: white;
    font-size: 1.1rem;
    outline: none;
}

.search-input::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

.search-btn {
    padding: 1rem 2.5rem;
    background: linear-gradient(135deg, #ffd700, #ffed4e);
    border: none;
    border-radius: 50px;
    color: #764ba2;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s var(--transition-bounce);
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.4);
}

.search-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(255, 215, 0, 0.6);
}

.search-btn:active {
    transform: scale(0.98);
}

/* Weather Card - Premium Glass Design */
.weather-card {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 30px;
    padding: 3rem;
    box-shadow: var(--glass-shadow);
    animation: scaleIn 0.8s var(--transition-bounce) 0.7s both;
    position: relative;
    overflow: hidden;
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Animated Background Gradient */
.weather-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    animation: rotate-gradient 15s linear infinite;
    pointer-events: none;
}

@keyframes rotate-gradient {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.weather-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 2rem;
    position: relative;
    z-index: 1;
}

.location-name {
    font-size: 2.5rem;
    font-weight: 700;
    color: white;
    margin-bottom: 0.5rem;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.location-coords {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.7);
}

/* Temperature Display - Hero Style */
.weather-main {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 3rem;
    align-items: center;
    margin-bottom: 3rem;
    position: relative;
    z-index: 1;
}

.temperature-display {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
}

.temp-value {
    font-size: 8rem;
    font-weight: 800;
    background: linear-gradient(135deg, #fff 0%, #ffd700 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    line-height: 1;
    text-shadow: 0 4px 20px rgba(255, 215, 0, 0.5);
    animation: pulse 3s ease-in-out infinite;
}

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

.temp-unit {
    font-size: 3rem;
    color: rgba(255, 255, 255, 0.8);
    margin-top: 1rem;
}

/* Weather Icon with Animation */
.weather-icon {
    animation: float-gentle 6s ease-in-out infinite;
}

.weather-icon svg {
    filter: drop-shadow(0 4px 20px rgba(255, 215, 0, 0.5));
}

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

.weather-description h3 {
    font-size: 2rem;
    color: white;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.weather-description p {
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.8);
}

/* Weather Details Grid */
.weather-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-top: 3rem;
    position: relative;
    z-index: 1;
}

.detail-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s var(--transition-smooth);
}

.detail-item:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.detail-icon {
    font-size: 2rem;
    animation: bounce-gentle 2s ease-in-out infinite;
}

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

.detail-content {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

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

.detail-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: white;
}

/* Forecast Grid */
.forecast-section {
    margin-top: 3rem;
    position: relative;
    z-index: 1;
}

.forecast-title {
    font-size: 1.5rem;
    color: white;
    margin-bottom: 1.5rem;
    font-weight: 600;
}

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

.forecast-item {
    text-align: center;
    padding: 1.5rem 1rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s var(--transition-bounce);
}

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

.forecast-day {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 1rem;
    font-weight: 600;
}

.forecast-icon {
    font-size: 2.5rem;
    margin: 1rem 0;
    animation: bounce-gentle 2s ease-in-out infinite;
}

.forecast-temp {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1rem;
}

.temp-high {
    font-size: 1.3rem;
    font-weight: 700;
    color: white;
}

.temp-low {
    font-size: 1.3rem;
    color: rgba(255, 255, 255, 0.6);
}

/* Loading Animation */
.loading-state {
    text-align: center;
    padding: 4rem;
}

.loader {
    width: 60px;
    height: 60px;
    margin: 0 auto 2rem;
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-top: 4px solid #ffd700;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-state p {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.2rem;
}

/* Theme Toggle */
.theme-toggle {
    width: 60px;
    height: 30px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50px;
    position: relative;
    cursor: pointer;
    transition: all 0.3s var(--transition-smooth);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.theme-toggle:hover {
    background: rgba(255, 255, 255, 0.15);
}

.theme-toggle-slider {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 24px;
    height: 24px;
    background: linear-gradient(135deg, #ffd700, #ffed4e);
    border-radius: 50%;
    transition: all 0.3s var(--transition-bounce);
}

.theme-toggle.active .theme-toggle-slider {
    transform: translateX(30px);
}

/* Navigation Buttons */
.nav {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.nav-btn {
    padding: 0.8rem 1.5rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50px;
    color: white;
    cursor: pointer;
    transition: all 0.3s var(--transition-smooth);
    font-weight: 500;
}

.nav-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

/* Active State Animations */
.active {
    display: block !important;
    animation: fadeIn 0.5s var(--transition-smooth);
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Responsive Design */
@media (max-width: 768px) {
    .hero-title {
        font-size: 2.5rem;
    }
    
    .temp-value {
        font-size: 5rem;
    }
    
    .weather-main {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .search-container {
        flex-direction: column;
    }
    
    .search-btn {
        width: 100%;
    }
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(10px);
    z-index: 1000;
    animation: fadeIn 0.3s var(--transition-smooth);
}

.modal.active {
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 30px;
    padding: 3rem;
    max-width: 600px;
    width: 90%;
    box-shadow: var(--glass-shadow);
    animation: scaleIn 0.4s var(--transition-bounce);
    position: relative;
    color: white;
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.3s var(--transition-smooth);
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg);
}

/* Footer */
.footer {
    text-align: center;
    padding: 2rem;
    color: rgba(255, 255, 255, 0.8);
    margin-top: 4rem;
}

.footer p {
    margin: 0.5rem 0;
}

/* Connection Status */
.connection-status {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    padding: 1rem 1.5rem;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 50px;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    color: white;
    box-shadow: var(--glass-shadow);
    z-index: 100;
}

.connection-status-dot {
    width: 10px;
    height: 10px;
    background: #10b981;
    border-radius: 50%;
    animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
    0%, 100% { 
        opacity: 1;
        transform: scale(1);
    }
    50% { 
        opacity: 0.5;
        transform: scale(1.2);
    }
}

/* Utility Classes */
.fade-in {
    animation: fadeIn 0.6s var(--transition-smooth);
}

.slide-in {
    animation: slideIn 0.6s var(--transition-smooth);
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Error State */
.error-state {
    text-align: center;
    padding: 4rem;
    color: white;
}

.error-icon {
    font-size: 4rem;
    margin-bottom: 2rem;
    animation: shake 0.5s var(--transition-smooth);
}

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

.error-state h3 {
    font-size: 2rem;
    margin-bottom: 1rem;
}

.retry-btn {
    margin-top: 2rem;
    padding: 1rem 2.5rem;
    background: linear-gradient(135deg, #ffd700, #ffed4e);
    border: none;
    border-radius: 50px;
    color: #764ba2;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s var(--transition-bounce);
}

.retry-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(255, 215, 0, 0.6);
}

