/* Ian Christian F. Amistoso 
   LFCA322A012 
   IPT1 API PROJECT */

/* ===== CSS Variables for Theme Support ===== */
:root {
    /* Light Theme Colors */
    --primary-color: #3b82f6;
    --primary-hover: #2563eb;
    --primary-light: #dbeafe;
    --secondary-color: #64748b;
    --accent-color: #f59e0b;
    --success-color: #10b981;
    --error-color: #ef4444;
    --warning-color: #f59e0b;
    
    /* Background Colors */
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-tertiary: #f1f5f9;
    --bg-overlay: rgba(255, 255, 255, 0.95);
    --bg-card: rgba(255, 255, 255, 0.98);
    --bg-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --bg-card-gradient: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(255, 255, 255, 0.85) 100%);
    
    /* Text Colors */
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    --text-inverse: #ffffff;
    
    /* Border Colors */
    --border-color: #e2e8f0;
    --border-focus: #3b82f6;
    --border-card: rgba(255, 255, 255, 0.2);
    
    /* Shadow Colors */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    --shadow-card: 0 8px 32px rgba(0, 0, 0, 0.1);
    --shadow-card-hover: 0 20px 40px rgba(0, 0, 0, 0.15);
    
    /* Spacing */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    --spacing-2xl: 3rem;
    
    /* Border Radius */
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --radius-2xl: 1.5rem;
    
    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
}

/* Dark Theme Colors */
[data-theme="dark"] {
    --primary-color: #60a5fa;
    --primary-hover: #3b82f6;
    --primary-light: rgba(96, 165, 250, 0.1);
    --secondary-color: #94a3b8;
    --accent-color: #fbbf24;
    
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-tertiary: #334155;
    --bg-overlay: rgba(15, 23, 42, 0.95);
    --bg-card: rgba(30, 41, 59, 0.98);
    --bg-gradient: linear-gradient(135deg, #1e293b 0%, #334155 100%);
    --bg-card-gradient: linear-gradient(135deg, rgba(30, 41, 59, 0.95) 0%, rgba(51, 65, 85, 0.85) 100%);
    
    --text-primary: #f1f5f9;
    --text-secondary: #cbd5e1;
    --text-muted: #64748b;
    --text-inverse: #0f172a;
    
    --border-color: #334155;
    --border-focus: #60a5fa;
    --border-card: rgba(255, 255, 255, 0.1);
}

/* ===== Base Styles ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: var(--bg-gradient);
    background-attachment: fixed;
    min-height: 100vh; 
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: var(--text-primary);
    line-height: 1.6;
    transition: all var(--transition-normal);
    overflow-x: hidden;
    position: relative;
}

/* ===== Dynamic Background Animation ===== */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        /* Sunny side (left) */
        linear-gradient(90deg, 
            #87CEEB 0%, 
            #87CEEB 50%, 
            #4682B4 50%, 
            #4682B4 100%
        );
    z-index: -2;
}

/* ===== Animated Sun ===== */
.sun-container {
    position: fixed;
    top: 20%;
    left: 8%;
    width: 120px;
    height: 120px;
    z-index: -1;
    animation: sunOrbit 20s linear infinite;
}

.sun {
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, #FFD700 0%, #FFA500 50%, #FF8C00 100%);
    border-radius: 50%;
    box-shadow: 
        0 0 60px #FFD700,
        0 0 120px rgba(255, 215, 0, 0.5),
        0 0 180px rgba(255, 215, 0, 0.3);
    animation: sunPulse 3s ease-in-out infinite alternate;
}

/* ===== Animated Rain ===== */
.rain-container {
    position: fixed;
    top: 0;
    right: 0;
    width: 50%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
}

.rain-drop {
    position: absolute;
    width: 2px;
    height: 20px;
    background: linear-gradient(to bottom, transparent, #87CEEB);
    border-radius: 0 0 2px 2px;
    animation: rainFall linear infinite;
}

/* Generate multiple rain drops with different positions and speeds */
.rain-drop:nth-child(1) { left: 5%; animation-duration: 1s; animation-delay: 0s; }
.rain-drop:nth-child(2) { left: 10%; animation-duration: 1.2s; animation-delay: 0s; }
.rain-drop:nth-child(3) { left: 15%; animation-duration: 0.8s; animation-delay: 0s; }
.rain-drop:nth-child(4) { left: 20%; animation-duration: 1.1s; animation-delay: 0s; }
.rain-drop:nth-child(5) { left: 25%; animation-duration: 0.9s; animation-delay: 0s; }
.rain-drop:nth-child(6) { left: 30%; animation-duration: 1.3s; animation-delay: 0s; }
.rain-drop:nth-child(7) { left: 35%; animation-duration: 1s; animation-delay: 0s; }
.rain-drop:nth-child(8) { left: 40%; animation-duration: 1.1s; animation-delay: 0s; }
.rain-drop:nth-child(9) { left: 45%; animation-duration: 0.8s; animation-delay: 0s; }
.rain-drop:nth-child(10) { left: 50%; animation-duration: 1.2s; animation-delay: 0s; }
.rain-drop:nth-child(11) { left: 55%; animation-duration: 0.9s; animation-delay: 0s; }
.rain-drop:nth-child(12) { left: 60%; animation-duration: 1.1s; animation-delay: 0s; }
.rain-drop:nth-child(13) { left: 65%; animation-duration: 0.8s; animation-delay: 0s; }
.rain-drop:nth-child(14) { left: 70%; animation-duration: 1.3s; animation-delay: 0s; }
.rain-drop:nth-child(15) { left: 75%; animation-duration: 1s; animation-delay: 0s; }
.rain-drop:nth-child(16) { left: 80%; animation-duration: 1.2s; animation-delay: 0s; }
.rain-drop:nth-child(17) { left: 85%; animation-duration: 0.9s; animation-delay: 0s; }
.rain-drop:nth-child(18) { left: 90%; animation-duration: 1.1s; animation-delay: 0s; }
.rain-drop:nth-child(19) { left: 95%; animation-duration: 0.8s; animation-delay: 0s; }
.rain-drop:nth-child(20) { left: 2%; animation-duration: 1.3s; animation-delay: 0s; }
.rain-drop:nth-child(21) { left: 7%; animation-duration: 1.1s; animation-delay: 0s; }
.rain-drop:nth-child(22) { left: 12%; animation-duration: 0.9s; animation-delay: 0s; }
.rain-drop:nth-child(23) { left: 17%; animation-duration: 1.2s; animation-delay: 0s; }
.rain-drop:nth-child(24) { left: 22%; animation-duration: 0.8s; animation-delay: 0s; }
.rain-drop:nth-child(25) { left: 27%; animation-duration: 1.3s; animation-delay: 0s; }
.rain-drop:nth-child(26) { left: 32%; animation-duration: 1s; animation-delay: 0s; }
.rain-drop:nth-child(27) { left: 37%; animation-duration: 1.1s; animation-delay: 0s; }
.rain-drop:nth-child(28) { left: 42%; animation-duration: 0.9s; animation-delay: 0s; }
.rain-drop:nth-child(29) { left: 47%; animation-duration: 1.2s; animation-delay: 0s; }
.rain-drop:nth-child(30) { left: 52%; animation-duration: 0.8s; animation-delay: 0s; }
.rain-drop:nth-child(31) { left: 57%; animation-duration: 1.3s; animation-delay: 0s; }
.rain-drop:nth-child(32) { left: 62%; animation-duration: 1s; animation-delay: 0s; }
.rain-drop:nth-child(33) { left: 67%; animation-duration: 1.1s; animation-delay: 0s; }
.rain-drop:nth-child(34) { left: 72%; animation-duration: 0.9s; animation-delay: 0s; }
.rain-drop:nth-child(35) { left: 77%; animation-duration: 1.2s; animation-delay: 0s; }
.rain-drop:nth-child(36) { left: 82%; animation-duration: 0.8s; animation-delay: 0s; }
.rain-drop:nth-child(37) { left: 87%; animation-duration: 1.3s; animation-delay: 0s; }
.rain-drop:nth-child(38) { left: 92%; animation-duration: 1s; animation-delay: 0s; }
.rain-drop:nth-child(39) { left: 97%; animation-duration: 1.1s; animation-delay: 0s; }
.rain-drop:nth-child(40) { left: 3%; animation-duration: 0.9s; animation-delay: 0s; }

/* ===== Cloud Effects ===== */
.cloud {
    position: fixed;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 50px;
    z-index: -1;
    animation: cloudFloat linear infinite;
}

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

.cloud-1 {
    width: 100px;
    height: 40px;
    top: 15%;
    right: 85%;
    animation-duration: 20s;
}
.cloud-1::before {
    width: 50px;
    height: 50px;
    top: -25px;
    left: 10px;
}
.cloud-1::after {
    width: 60px;
    height: 60px;
    top: -30px;
    right: 10px;
}

.cloud-2 {
    width: 80px;
    height: 30px;
    top: 25%;
    right: 90%;
    animation-duration: 25s;
    animation-delay: 5s;
}
.cloud-2::before {
    width: 40px;
    height: 40px;
    top: -20px;
    left: 8px;
}
.cloud-2::after {
    width: 45px;
    height: 45px;
    top: -22px;
    right: 8px;
}

.cloud-3 {
    width: 120px;
    height: 45px;
    top: 35%;
    right: 80%;
    animation-duration: 30s;
    animation-delay: 10s;
}
.cloud-3::before {
    width: 60px;
    height: 60px;
    top: -30px;
    left: 15px;
}
.cloud-3::after {
    width: 70px;
    height: 70px;
    top: -35px;
    right: 15px;
}

.cloud-4 {
    width: 90px;
    height: 35px;
    top: 10%;
    right: 92%;
    animation-duration: 22s;
    animation-delay: 7s;
}
.cloud-4::before {
    width: 40px;
    height: 40px;
    top: -18px;
    left: 8px;
}
.cloud-4::after {
    width: 50px;
    height: 50px;
    top: -22px;
    right: 8px;
}

.cloud-5 {
    width: 70px;
    height: 25px;
    top: 45%;
    right: 88%;
    animation-duration: 28s;
    animation-delay: 12s;
}
.cloud-5::before {
    width: 30px;
    height: 30px;
    top: -12px;
    left: 6px;
}
.cloud-5::after {
    width: 35px;
    height: 35px;
    top: -15px;
    right: 6px;
}

.cloud-6 {
    width: 110px;
    height: 40px;
    top: 60%;
    right: 75%;
    animation-duration: 32s;
    animation-delay: 15s;
}
.cloud-6::before {
    width: 55px;
    height: 55px;
    top: -25px;
    left: 12px;
}
.cloud-6::after {
    width: 60px;
    height: 60px;
    top: -28px;
    right: 12px;
}

.cloud-7 {
    width: 60px;
    height: 20px;
    top: 70%;
    right: 95%;
    animation-duration: 18s;
    animation-delay: 18s;
}
.cloud-7::before {
    width: 25px;
    height: 25px;
    top: -10px;
    left: 4px;
}
.cloud-7::after {
    width: 28px;
    height: 28px;
    top: -12px;
    right: 4px;
}

.cloud-8 {
    width: 100px;
    height: 38px;
    top: 80%;
    right: 78%;
    animation-duration: 26s;
    animation-delay: 20s;
}
.cloud-8::before {
    width: 45px;
    height: 45px;
    top: -20px;
    left: 10px;
}
.cloud-8::after {
    width: 50px;
    height: 50px;
    top: -22px;
    right: 10px;
}

/* ===== Background Animations ===== */
@keyframes sunOrbit {
    0% {
        transform: rotate(0deg) translateX(50px) rotate(0deg);
    }
    100% {
        transform: rotate(360deg) translateX(50px) rotate(-360deg);
    }
}

@keyframes sunPulse {
    0% {
        transform: scale(1);
        box-shadow: 
            0 0 60px #FFD700,
            0 0 120px rgba(255, 215, 0, 0.5),
            0 0 180px rgba(255, 215, 0, 0.3);
    }
    100% {
        transform: scale(1.1);
        box-shadow: 
            0 0 80px #FFD700,
            0 0 160px rgba(255, 215, 0, 0.6),
            0 0 240px rgba(255, 215, 0, 0.4);
    }
}

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

@keyframes rainFall {
    0% {
        transform: translateY(-100vh);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateY(100vh);
        opacity: 0;
    }
}

@keyframes cloudFloat {
    0% {
        transform: translateX(100vw);
    }
    100% {
        transform: translateX(-200px);
    }
}

/* ===== App Container ===== */
.app-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: var(--spacing-lg);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xl);
    position: relative;
    z-index: 1;
}

/* === Fix: Ensure dropdowns are not cut off === */
.app-container,
.content-section {
    overflow: visible !important;
}

/* ===== Header Styles ===== */
/* === Header Blends with Background (Glassmorphism) === */
.app-header {
    background: linear-gradient(120deg, rgba(255,255,255,0.60) 0%, rgba(255,255,255,0.30) 100%);
    backdrop-filter: blur(32px) saturate(160%);
    -webkit-backdrop-filter: blur(32px) saturate(160%);
    border: 1px solid rgba(255,255,255,0.18);
    box-shadow: 0 8px 32px rgba(59, 130, 246, 0.08), 0 1.5px 6px rgba(0,0,0,0.03);
}
[data-theme="dark"] .app-header {
    background: linear-gradient(120deg, rgba(30,41,59,0.60) 0%, rgba(51,65,85,0.30) 100%);
    border: 1px solid rgba(51,65,85,0.18);
}

.app-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--primary-color), transparent);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--spacing-lg);
    position: relative;
    z-index: 1;
    padding-right: 20px;
    padding-left: 20px;
}

.logo-section {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
}

.app-title {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
    margin: 0;
}

.title-text {
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

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

.app-subtitle {
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
    margin: 0;
    opacity: 0.8;
}

.header-actions {
    display: flex;
    gap: var(--spacing-sm);
}

.theme-toggle {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: var(--spacing-sm);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-normal);
    font-size: 1.25rem;
    position: relative;
    overflow: hidden;
}

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

.theme-toggle:hover::before {
    left: 100%;
}

.theme-toggle:hover {
    background: var(--primary-color);
    color: var(--text-inverse);
    transform: scale(1.05);
    box-shadow: var(--shadow-md);
}

/* ===== Main Content ===== */
.main-content {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xl);
    flex: 1;
}

/* ===== Content Sections ===== */
.content-section {
    background: var(--bg-card-gradient);
    backdrop-filter: blur(20px);
    border-radius: var(--radius-2xl);
    padding: var(--spacing-xl);
    box-shadow: var(--shadow-card);
    border: 1px solid var(--border-card);
    animation: fadeInUp 0.8s ease-out;
    position: relative;
    overflow: hidden;
}

.content-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--primary-color), transparent);
}

.section-header {
    margin-bottom: var(--spacing-xl);
    text-align: center;
    position: relative;
    z-index: 1;
}

.section-title {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    font-size: 1.75rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--spacing-sm);
}

.section-icon {
    font-size: 1.5rem;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

.section-subtitle {
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-style: italic;
    opacity: 0.8;
}

/* ===== Search Container ===== */
.search-container {
    position: relative;
    margin-bottom: var(--spacing-lg);
}

.search-input-group {
    display: flex;
    gap: var(--spacing-sm);
    align-items: stretch;
    position: relative;
}

.search-input {
    flex: 1;
    padding: var(--spacing-md) var(--spacing-lg);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-xl);
    font-size: 1rem;
    background: var(--bg-primary);
    color: var(--text-primary);
    transition: all var(--transition-normal);
    outline: none;
    box-shadow: var(--shadow-sm);
    padding-right: 2.2em; /* Make space for the clear button */
}

.search-input:focus {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1), var(--shadow-md);
    transform: translateY(-1px);
}

.search-input::placeholder {
    color: var(--text-muted);
}

.search-button {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-md) var(--spacing-lg);
    background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
    color: var(--text-inverse);
    border: none;
    border-radius: var(--radius-xl);
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-normal);
    white-space: nowrap;
    box-shadow: var(--shadow-md);
    position: relative;
    overflow: hidden;
}

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

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

.search-button:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.search-button:active {
    transform: translateY(0);
}

.button-icon {
    font-size: 1rem;
}

.button-text {
    font-size: 0.875rem;
}

/* ===== Suggestions Dropdown ===== */
.suggestions-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    z-index: 1000;
    max-height: 200px;
    overflow-y: auto;
    margin-top: var(--spacing-xs);
    backdrop-filter: blur(10px);
}

.suggestion-item {
    padding: var(--spacing-md);
    cursor: pointer;
    transition: all var(--transition-fast);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.suggestion-item:last-child {
    border-bottom: none;
}

.suggestion-item:hover {
    background: var(--primary-light);
    transform: translateX(4px);
}

.suggestion-city {
    font-weight: 500;
    color: var(--text-primary);
}

.suggestion-country {
    font-size: 0.75rem;
    color: var(--text-muted);
    background: var(--bg-secondary);
    padding: var(--spacing-xs) var(--spacing-sm);
    border-radius: var(--radius-sm);
}

.clear-input-btn {
    position: absolute;
    right: 140px; 
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    font-size: 1.3em;
    color: #e53935;
    cursor: pointer;
    z-index: 3;
    padding: 0 4px;
    line-height: 1;
    border-radius: 50%;
    transition: background 0.2s, color 0.2s;
    display: none; /* JS toggles this */
}
.clear-input-btn:hover, .clear-input-btn:focus {
    background: rgba(229,57,53,0.08);
    color: #b71c1c; /* Material Red 900 */
    outline: none;
}
.suggestion-item.focused, .suggestion-item[aria-selected="true"] {
    background: var(--primary-light);
    color: var(--primary-color);
    outline: 2px solid var(--primary-color);
    outline-offset: -2px;
}

/* ===== Weather Result ===== */
.weather-result {
    margin-top: var(--spacing-lg);
}

.weather-card {
    background: var(--bg-card-gradient);
    border-radius: var(--radius-2xl);
    padding: var(--spacing-2xl);
    text-align: center;
    box-shadow: var(--shadow-card);
    border: 1px solid var(--border-card);
    animation: fadeIn 0.5s ease-out;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(10px);
}

.weather-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--primary-color), transparent);
}

.weather-card h3 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--spacing-md);
    position: relative;
    z-index: 1;
}

.weather-info {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-lg);
    margin-bottom: var(--spacing-md);
    position: relative;
    z-index: 1;
}

.weather-main {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-sm);
}

.weather-temp {
    font-size: 3rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

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

.weather-icon-img {
    width: 80px;
    height: 80px;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.1));
}

.weather-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: var(--spacing-lg);
    margin-top: var(--spacing-xl);
    padding-top: var(--spacing-xl);
    border-top: 1px solid var(--border-color);
    position: relative;
    z-index: 1;
}

.weather-detail {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-md);
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    transition: all var(--transition-normal);
}

.weather-detail:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary-color);
}

.detail-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 500;
}

.detail-value {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
}

/* ===== Category Tabs ===== */
.category-tabs {
    display: flex;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-xl);
    flex-wrap: wrap;
    justify-content: center;
}

.category-tab {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    padding: var(--spacing-sm) var(--spacing-md);
    background: var(--bg-secondary);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-normal);
    font-size: 0.875rem;
    position: relative;
    overflow: hidden;
}

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

.category-tab:hover::before {
    left: 100%;
}

.category-tab:hover {
    background: var(--primary-color);
    color: var(--text-inverse);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.category-tab.active {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
    color: var(--text-inverse);
    border-color: var(--primary-color);
    box-shadow: var(--shadow-md);
}

.tab-icon {
    font-size: 1rem;
}

.tab-text {
    font-size: 0.875rem;
}

/* ===== News Container ===== */
.news-container {
    display: grid;
    gap: var(--spacing-lg);
}

.news-card {
    background: var(--bg-card-gradient);
    border-radius: var(--radius-2xl);
    padding: var(--spacing-xl);
    box-shadow: var(--shadow-card);
    border: 1px solid var(--border-card);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    animation: fadeInUp 0.5s ease-out;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(10px);
}

.news-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--primary-color), transparent);
}

.news-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0,0,0,0.1);
    border-color: var(--primary-color);
}

.news-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-md);
    position: relative;
    z-index: 1;
}

.news-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--spacing-sm);
    line-height: 1.4;
    flex: 1;
}

.news-date {
    font-size: 0.75rem;
    color: var(--text-muted);
    white-space: nowrap;
    background: var(--bg-secondary);
    padding: var(--spacing-xs) var(--spacing-sm);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
}

.news-description {
    color: var(--text-secondary);
    margin-bottom: var(--spacing-md);
    line-height: 1.6;
    position: relative;
    z-index: 1;
}

.news-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--spacing-md);
    margin-top: var(--spacing-md);
    position: relative;
    z-index: 1;
}

.news-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    transition: all var(--transition-fast);
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-xs);
    padding: var(--spacing-sm) var(--spacing-md);
    background: var(--primary-light);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.news-link:hover {
    color: var(--primary-hover);
    background: var(--primary-color);
    color: var(--text-inverse);
    transform: translateX(4px);
    box-shadow: var(--shadow-md);
}

.news-source {
    font-size: 0.75rem;
    color: var(--text-muted);
    background: var(--bg-secondary);
    padding: var(--spacing-xs) var(--spacing-sm);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
}

.link-icon {
    transition: transform var(--transition-fast);
}

.news-link:hover .link-icon {
    transform: translateX(4px);
}

/* ===== Loading Spinner ===== */
.spinner {
    border: 3px solid var(--border-color);
    border-top: 3px solid var(--primary-color);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: var(--spacing-xl) auto;
}

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

/* ===== Footer ===== */
.app-footer {
    background: var(--bg-card-gradient);
    backdrop-filter: blur(20px);
    border-radius: var(--radius-2xl);
    padding: var(--spacing-lg);
    box-shadow: var(--shadow-card);
    border: 1px solid var(--border-card);
    margin-top: auto;
    position: relative;
    overflow: hidden;
}

.app-footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--primary-color), transparent);
}

/* === Centralized Footer Content === */
.app-footer {
    text-align: center;
}
.footer-content, .custom-footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1.2rem;
    width: 100%;
}
.footer-text, .custom-footer-text {
    text-align: center;
}
/* .footer-links, .custom-footer-links {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    align-items: center;
}
.footer-link, .custom-footer-link {
    text-align: center;
} */

/* ===== Animations ===== */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

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

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

/* ===================== UI/UX ENHANCEMENTS ===================== */
/* --- Card/Container Polish --- */
.content-section, .weather-card, .news-card, .app-header, .app-footer {
    box-shadow: 0 8px 32px rgba(59, 130, 246, 0.10), 0 1.5px 6px rgba(0,0,0,0.04);
    border-radius: var(--radius-2xl);
    border: 1.5px solid var(--border-card);
    transition: box-shadow 0.35s cubic-bezier(.4,0,.2,1), border 0.25s;
}
.content-section:hover, .weather-card:hover, .news-card:hover, .app-header:hover, .app-footer:hover {
    box-shadow: 0 16px 48px rgba(59, 130, 246, 0.16), 0 4px 16px rgba(0,0,0,0.08);
    border-color: var(--primary-color);
}

/* --- Button & Input Microinteractions --- */
.search-button, .custom-search-btn, .category-tab, .theme-toggle {
    transition: background 0.2s, color 0.2s, box-shadow 0.2s, transform 0.15s;
    box-shadow: 0 2px 8px rgba(59,130,246,0.08);
    outline: none;
}
.search-button:focus, .custom-search-btn:focus, .category-tab:focus, .theme-toggle:focus {
    box-shadow: 0 0 0 3px rgba(59,130,246,0.18), 0 2px 8px rgba(59,130,246,0.08);
    border-color: var(--primary-color);
    z-index: 2;
}
.search-button:active, .custom-search-btn:active, .category-tab:active, .theme-toggle:active {
    transform: scale(0.97);
}

/* --- Card Hover/Active --- */
.weather-card:active, .news-card:active {
    transform: scale(0.99);
    box-shadow: 0 4px 16px rgba(59,130,246,0.10);
}

/* --- Section Spacing & Layout Polish --- */
.app-container, .main-content {
    gap: var(--spacing-2xl);
}
.content-section, .weather-card, .news-card {
    margin-bottom: var(--spacing-2xl);
    padding: calc(var(--spacing-xl) + 0.5rem);
}
.section-header {
    margin-bottom: var(--spacing-lg);
}

/* --- Typography Hierarchy Polish --- */
.app-title, .custom-title {
    letter-spacing: -0.5px;
    font-size: 2.5rem;
}
.section-title, .custom-section-title {
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: -0.25px;
}
.section-subtitle, .custom-section-subtitle {
    font-size: 1.1rem;
    opacity: 0.85;
}
.weather-card h3, .news-title {
    font-size: 1.35rem;
    font-weight: 600;
}

/* --- Notification Polish --- */
.notification {
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
    color: var(--text-inverse);
    border-radius: var(--radius-lg);
    box-shadow: 0 4px 16px rgba(59,130,246,0.10);
    padding: 1rem 2rem;
    font-size: 1rem;
    font-weight: 500;
    position: fixed;
    top: 2.5rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    opacity: 0.98;
    animation: fadeInDown 0.5s;
}
@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-30px) translateX(-50%); }
    to { opacity: 0.98; transform: translateY(0) translateX(-50%); }
}

/* --- Accessibility: Focus Indicator --- */
:focus-visible {
    outline: 2.5px solid var(--primary-color);
    outline-offset: 2px;
}

/* --- Remove duplicate/unused selectors (manual review required) --- */
/* (This section is a placeholder for actual removal after a full audit) */

/* --- Grouped/Commented for maintainability --- */
/* (Add section comments as needed for future maintainers) */

/* ===== Utility Classes ===== */
.text-center {
    text-align: center;
}

.text-error {
    color: var(--error-color);
}

.text-success {
    color: var(--success-color);
}

.text-warning {
    color: var(--warning-color);
}

.hidden {
    display: none;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Custom layout and utility classes to replace Tailwind */
.custom-max-width {
  max-width: 1100px;
}
.custom-center {
  margin-left: auto;
  margin-right: auto;
}
.custom-padding {
  padding: 1.5rem;
}
.custom-header-flex {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.custom-header-padding {
  padding: 1.25rem 0;
}
.custom-header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 2rem;
}
.custom-title {
  font-size: 2.25rem;
  font-weight: 700;
  color: var(--primary-color, #3b82f6);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.custom-subtitle {
  font-size: 1rem;
  color: var(--text-secondary, #64748b);
  font-weight: 500;
}
.custom-section {
  margin-bottom: 2rem;
  background: var(--bg-card-gradient, #fff);
  border-radius: 1rem;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  padding: 2rem;
}
.custom-mb {
  margin-bottom: 2.5rem;
}
.custom-section-title {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--primary-color, #3b82f6);
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.custom-section-subtitle {
  font-size: 1rem;
  color: var(--text-secondary, #64748b);
  font-style: italic;
}
.custom-input {
  padding: 0.75rem 1.25rem;
  border: 2px solid #e2e8f0;
  border-radius: 0.75rem;
  font-size: 1rem;
  background: #fff;
  color: #1e293b;
  transition: border 0.2s, box-shadow 0.2s;
  outline: none;
    width: 100%;
  box-sizing: border-box;
}
.custom-input:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59,130,246,0.1);
}
.custom-search-btn {
  padding: 0.75rem 1.25rem;
  background: #3b82f6;
  color: #fff;
  border: none;
  border-radius: 0.75rem;
  font-weight: 500;
  cursor: pointer;
  margin-left: 0.5rem;
  transition: background 0.2s, transform 0.2s;
}
.custom-search-btn:hover {
  background: #2563eb;
  transform: translateY(-2px);
}
.custom-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
  justify-content: center;
}
.custom-tab {
  padding: 0.5rem 1.25rem;
  background: #f4f4f5;
  color: #333;
  border-radius: 1.5rem;
  font-weight: 500;
  border: 1px solid #e2e8f0;
  transition: background 0.2s, color 0.2s, transform 0.2s;
}
.custom-tab:hover, .custom-tab.active {
  background: #3b82f6;
  color: #fff;
  transform: scale(1.05);
  border-color: #3b82f6;
}
.custom-footer {
  background: var(--bg-card-gradient, #fff);
  border-radius: 1rem;
  padding: 1.5rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  margin-top: 2rem;
}
.custom-footer-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1.5rem;
}
.custom-footer-text {
  color: #64748b;
  font-size: 0.95rem;
}
.custom-footer-links {
  display: flex;
  gap: 1.5rem;
}
.custom-footer-link {
  color: #64748b;
  text-decoration: none;
  font-size: 0.95rem;
  transition: color 0.2s;
  padding: 0.25rem 0.75rem;
  border-radius: 0.5rem;
}
.custom-footer-link:hover {
  color: #3b82f6;
  background: #e0e7ff;
}
@media (max-width: 900px) {
  .custom-max-width { max-width: 98vw; }
  .custom-section { padding: 1.25rem; }
  .custom-title { font-size: 1.5rem; }
  .custom-section-title { font-size: 1.2rem; }
}
@media (max-width: 600px) {
  .custom-padding { padding: 0.5rem; }
  .custom-section { padding: 0.75rem; }
  .custom-title { font-size: 1.1rem; }
  .custom-section-title { font-size: 1rem; }
  .custom-footer-content { flex-direction: column; gap: 0.75rem; }
}

/* === Enhanced Header Content Placement === */
/* === Header: Title Left, Toggle Right === */
.header-content, .custom-header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--spacing-xl);
    width: 100%;
    position: relative;
}
.header-main {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
}
.logo-section {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: var(--spacing-xs);
}
.header-actions {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    min-width: 60px;
}
@media (max-width: 768px) {
    .header-content, .custom-header-content {
        flex-direction: column;
        gap: var(--spacing-md);
        text-align: center;
    }
    .header-main, .logo-section {
        align-items: center;
        justify-content: center;
    }
    .header-actions {
        justify-content: center;
        width: 100%;
        margin-top: var(--spacing-md);
    }
}

/* === Header Logo Image (Animated & Styled Like .weather-icon) === */
.logo-img {
    height: 1.5rem;
    width: auto;
    vertical-align: middle;
    margin-right: 0.5rem;
    display: inline-block;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
    animation: float 3s ease-in-out infinite;
    animation-delay: 0s;
    height: auto;
    width: auto;
}
@media (max-width: 600px) {
    .logo-img {
        height: 1.1rem;
        margin-right: 0.35rem;
    }
}

/* === Footer Logo and Text Alignment === */
.footer-text, .custom-footer-text {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    text-align: center;
}
.footer-logo {
    height: 1.3rem;
    width: auto;
    vertical-align: middle;
    display: inline-block;
    margin-right: 0.3rem;
    filter: drop-shadow(0 1px 2px rgba(0,0,0,0.08));
}
@media (max-width: 600px) {
    .footer-logo {
        height: 1rem;
        margin-right: 0.2rem;
    }
}

.news-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.news-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0,0,0,0.1);
}

.suggestions-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-sm) var(--spacing-md);
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-muted);
}

.clear-history {
    background: none;
    border: none;
    color: var(--error-color);
    cursor: pointer;
    font-size: 0.75rem;
    padding: var(--spacing-xs);
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
}

.clear-history:hover {
    background: var(--error-color);
    color: var(--text-inverse);
}

.history-item {
    background: var(--primary-light);
    border-left: 3px solid var(--primary-color);
}

.suggestion-type {
    font-size: 0.625rem;
    color: var(--primary-color);
    background: var(--primary-light);
    padding: var(--spacing-xs) var(--spacing-sm);
    border-radius: var(--radius-sm);
    font-weight: 500;
}

.suggestion-hint {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-style: italic;
}

.loading {
    color: var(--text-muted);
    font-style: italic;
}

.no-results {
    color: var(--text-muted);
    text-align: center;
}

.error {
    color: var(--error-color);
}

.news-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    z-index: 1001;
    margin-top: var(--spacing-xs);
    backdrop-filter: blur(10px);
}

.news-suggestion-item {
    padding: var(--spacing-md);
    cursor: pointer;
    transition: all var(--transition-fast);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.news-suggestion-item:hover {
    background: var(--primary-light);
    transform: translateX(4px);
}

.suggestion-title {
    font-weight: 500;
    color: var(--text-primary);
    flex: 1;
}

.suggestion-source {
    font-size: 0.75rem;
    color: var(--text-muted);
    background: var(--bg-secondary);
    padding: var(--spacing-xs) var(--spacing-sm);
    border-radius: var(--radius-sm);
}

.weather-actions {
    margin-top: var(--spacing-lg);
    text-align: center;
}

.refresh-button {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm) var(--spacing-md);
    background: var(--bg-secondary);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-normal);
    font-size: 0.875rem;
}

.refresh-button:hover {
    background: var(--primary-color);
    color: var(--text-inverse);
    transform: scale(1.05);
}

.news-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: var(--spacing-xs);
}

.news-time-ago {
    font-size: 0.625rem;
    color: var(--text-muted);
    background: var(--bg-tertiary);
    padding: var(--spacing-xs) var(--spacing-sm);
    border-radius: var(--radius-sm);
}

.error-card {
    border-color: var(--error-color);
}

.error-card .error-icon {
    font-size: 3rem;
    display: block;
    margin-bottom: var(--spacing-md);
}

.error-suggestions, .no-results-suggestions {
    margin-top: var(--spacing-md);
    padding: var(--spacing-md);
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.error-suggestions ul, .no-results-suggestions ul {
    margin-top: var(--spacing-sm);
    padding-left: var(--spacing-lg);
}

.error-suggestions li, .no-results-suggestions li {
    margin-bottom: var(--spacing-xs);
    color: var(--text-secondary);
}

.weather-card.clear {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1) 0%, rgba(245, 158, 11, 0.1) 100%);
}

.weather-card.cloudy {
    background: linear-gradient(135deg, rgba(100, 113, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
}

.weather-card.rainy {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1) 0%, rgba(37, 99, 235, 0.1) 100%);
}

.weather-card.stormy {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.1) 0%, rgba(220, 38, 38, 0.1) 100%);
}

.weather-card.snowy {
    background: linear-gradient(135deg, rgba(156, 163, 175, 0.1) 0%, rgba(107, 114, 128, 0.1) 100%);
}

.weather-card.misty, .weather-card.foggy {
    background: linear-gradient(135deg, rgba(156, 163, 175, 0.1) 0%, rgba(75, 85, 99, 0.1) 100%);
}

/* Add a higher z-index to the weather section to ensure it stacks above the news section */
.weather-section {
    z-index: 2;
}
