:root {
    /* Color Palette */
    --bg-dark: #0a0a0f;
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.7);
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    --primary-accent: #6366f1; /* Indigo */
    --secondary-accent: #a855f7; /* Purple */
    
    /* Layout */
    --border-radius: 24px;
    --transition-speed: 0.3s;
}

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

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow-x: hidden;
    overflow-y: auto;
    position: relative;
    padding: 40px 16px;
}

/* Dynamic Animated Background Blobs */
.background-blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    z-index: -1;
    opacity: 0.6;
    animation: float 20s infinite ease-in-out alternate;
}

.blob-1 {
    width: 400px;
    height: 400px;
    background: var(--primary-accent);
    top: -100px;
    left: -100px;
    animation-delay: 0s;
}

.blob-2 {
    width: 500px;
    height: 500px;
    background: var(--secondary-accent);
    bottom: -150px;
    right: -100px;
    animation-delay: -5s;
}

.blob-3 {
    width: 300px;
    height: 300px;
    background: #0ea5e9; /* Sky blue */
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation-delay: -10s;
}

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

/* Main App Container - Glassmorphism */
.weather-app {
    width: 100%;
    max-width: 480px;
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius);
    padding: 32px;
    box-shadow: var(--glass-shadow);
    z-index: 10;
    transition: all var(--transition-speed);
    margin: auto;
}

/* Search Container */
.search-container {
    display: flex;
    align-items: center;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--glass-border);
    border-radius: 100px;
    padding: 8px 16px;
    margin-bottom: 24px;
    transition: all var(--transition-speed);
}

.search-container:focus-within {
    border-color: rgba(255, 255, 255, 0.3);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.3);
    background: rgba(0, 0, 0, 0.4);
}

.search-icon {
    font-size: 1.2rem;
    color: var(--text-secondary);
    margin-right: 12px;
}

input[type="text"] {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-size: 1rem;
    font-family: 'Outfit', sans-serif;
    padding: 8px 0;
}

input[type="text"]::placeholder {
    color: var(--text-secondary);
}

#search-btn {
    background: linear-gradient(135deg, var(--primary-accent), var(--secondary-accent));
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 100px;
    font-family: 'Outfit', sans-serif;
    font-weight: 500;
    cursor: pointer;
    transition: transform var(--transition-speed), box-shadow var(--transition-speed);
}

#search-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

#search-btn:active {
    transform: translateY(0);
}

/* Status & Loading */
.status-container {
    text-align: center;
    padding: 40px 0;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    border-top-color: var(--primary-accent);
    animation: spin 1s ease-in-out infinite;
    margin: 0 auto;
}

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

.error-message {
    color: #ef4444; /* Red */
    background: rgba(239, 68, 68, 0.1);
    padding: 12px;
    border-radius: 12px;
    border: 1px solid rgba(239, 68, 68, 0.2);
    font-size: 0.95rem;
}

.hidden {
    display: none !important;
}

/* Weather Content Layout */
.weather-content {
    animation: fadeIn 0.5s ease-out forwards;
}

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

/* Main Info Section */
.main-info {
    text-align: center;
    margin-bottom: 32px;
}

.location-header {
    margin-bottom: 24px;
}

.city-name {
    font-size: 2.2rem;
    font-weight: 700;
    margin-bottom: 4px;
    letter-spacing: -0.5px;
}

.current-date {
    color: var(--text-secondary);
    font-size: 0.95rem;
    font-weight: 300;
}

.temperature-display {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    margin-bottom: 8px;
}

.weather-icon {
    width: 100px;
    height: 100px;
    filter: drop-shadow(0 8px 16px rgba(0,0,0,0.2));
}

.temp-wrapper {
    display: flex;
    align-items: flex-start;
}

.temperature {
    font-size: 5rem;
    font-weight: 700;
    line-height: 1;
    letter-spacing: -2px;
}

.unit {
    font-size: 1.5rem;
    font-weight: 500;
    margin-top: 8px;
    color: var(--text-secondary);
}

.weather-description {
    font-size: 1.2rem;
    color: var(--text-secondary);
    text-transform: capitalize;
    font-weight: 400;
}

/* Details Grid */
.details-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.detail-card {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: transform var(--transition-speed), background var(--transition-speed);
}

.detail-card:hover {
    transform: translateY(-2px);
    background: rgba(0, 0, 0, 0.3);
}

.detail-icon {
    font-size: 1.8rem;
    color: var(--primary-accent);
    background: rgba(99, 102, 241, 0.1);
    padding: 10px;
    border-radius: 12px;
}

.detail-info {
    display: flex;
    flex-direction: column;
}

.detail-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.detail-value {
    font-size: 1.1rem;
    font-weight: 600;
}

/* Responsive adjustments */
@media (max-width: 400px) {
    .weather-app {
        padding: 24px 20px;
    }
    
    .temperature {
        font-size: 4rem;
    }
    
    .weather-icon {
        width: 80px;
        height: 80px;
    }
    
    .details-grid {
        grid-template-columns: 1fr;
    }
}
