/* Professional Weather Dashboard Styles */
:root {
    --primary-color: #1e40af;
    --primary-hover: #1d4ed8;
    --primary-dark: #1e3a8a; /* Added missing primary-dark variable */
    --primary-light: #3b82f6;
    --secondary-color: #64748b;
    --secondary-light: #94a3b8;
    --success-color: #059669;
    --danger-color: #dc2626;
    --warning-color: #d97706;
    --light-bg: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --dark-bg: linear-gradient(135deg, #0c0c0c 0%, #1a1a2e 100%);
    --card-bg: rgba(255, 255, 255, 0.98);
    --card-bg-dark: rgba(30, 41, 59, 0.98);
    --light-text: #1e293b;
    --dark-text: #f1f5f9;
    --border-color: rgba(226, 232, 240, 0.9);
    --border-color-dark: rgba(71, 85, 105, 0.9);
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -1px rgba(0, 0, 0, 0.04);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.12), 0 10px 10px -5px rgba(0, 0, 0, 0.06);
    --shadow-xl: 0 25px 50px -12px rgba(0, 0, 0, 0.15);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-fast: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --border-radius: 16px;
    --border-radius-lg: 20px;
    --border-radius-sm: 8px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
    margin: 0;
    padding: 20px;
    background: linear-gradient(to bottom, #87CEFA, #f8fafc);
    min-height: 100vh;
    transition: background 0.5s ease;
    font-size: 16px;
    line-height: 1.6;
    color: var(--light-text);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    position: relative;
    overflow-x: hidden;
}

/* Weather Animation Containers */
.weather-animation {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
}

/* Stars for night time */
.star {
    position: absolute;
    background: white;
    border-radius: 50%;
    animation: twinkle 2s infinite alternate;
}

.star.small { width: 2px; height: 2px; }
.star.medium { width: 3px; height: 3px; }
.star.large { width: 4px; height: 4px; }

@keyframes twinkle {
    0% { opacity: 0.3; transform: scale(1); }
    100% { opacity: 1; transform: scale(1.2); }
}

/* Shooting stars */
.shooting-star {
    position: absolute;
    width: 2px;
    height: 80px;
    background: linear-gradient(to bottom, transparent, white, transparent);
    animation: shoot 3s linear infinite;
    transform: rotate(45deg);
}

@keyframes shoot {
    0% { 
        top: -100px; 
        left: 100%; 
        opacity: 0; 
    }
    10% { opacity: 1; }
    90% { opacity: 1; }
    100% { 
        top: 100%; 
        left: -100px; 
        opacity: 0; 
    }
}

/* Clouds floating */
.cloud {
    position: absolute;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 50px;
    animation: float 20s infinite linear;
}

.cloud:before {
    content: '';
    position: absolute;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 50px;
}

.cloud.small {
    width: 60px;
    height: 20px;
}

.cloud.small:before {
    width: 40px;
    height: 40px;
    top: -20px;
    left: 10px;
}

.cloud.medium {
    width: 80px;
    height: 30px;
}

.cloud.medium:before {
    width: 50px;
    height: 50px;
    top: -25px;
    left: 15px;
}

.cloud.large {
    width: 100px;
    height: 40px;
}

.cloud.large:before {
    width: 60px;
    height: 60px;
    top: -30px;
    left: 20px;
}

@keyframes float {
    0% { transform: translateX(-30px); }
    50% { transform: translateX(30px); }
    100% { transform: translateX(-30px); }
}

/* Rain drops */
.raindrop {
    position: absolute;
    width: 2px;
    height: 20px;
    background: linear-gradient(to bottom, transparent, #4FC3F7, transparent);
    animation: fall 1s linear infinite;
}

@keyframes fall {
    0% { 
        top: -20px; 
        opacity: 0; 
    }
    10% { opacity: 1; }
    90% { opacity: 1; }
    100% { 
        top: 100vh; 
        opacity: 0; 
    }
}

/* Snow flakes */
.snowflake {
    position: absolute;
    color: white;
    user-select: none;
    pointer-events: none;
    animation: snowfall 10s linear infinite;
}

@keyframes snowfall {
    0% {
        transform: translateY(-100px) rotate(0deg);
        opacity: 0;
    }
    10% { opacity: 1; }
    90% { opacity: 1; }
    100% {
        transform: translateY(100vh) rotate(360deg);
        opacity: 0;
    }
}

/* Lightning effect */
.lightning {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    opacity: 0;
    animation: flash 0.2s ease-in-out;
}

@keyframes flash {
    0%, 100% { opacity: 0; }
    50% { opacity: 1; }
}

/* Sun rays */
.sun-ray {
    position: absolute;
    top: 10%;
    right: 10%;
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(255, 223, 0, 0.3) 0%, transparent 70%);
    border-radius: 50%;
    animation: rotate 20s linear infinite;
}

@keyframes rotate {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Floating particles for mist/fog */
.mist-particle {
    position: absolute;
    background: rgba(255, 255, 255, 0.4);
    border-radius: 50%;
    animation: drift 15s ease-in-out infinite;
}

@keyframes drift {
    0%, 100% { 
        transform: translateX(0) translateY(0) scale(1);
        opacity: 0.4;
    }
    50% { 
        transform: translateX(50px) translateY(-30px) scale(1.2);
        opacity: 0.7;
    }
}

/* Dust/sand particles for dust storms */
.dust-particle {
    position: absolute;
    background: rgba(210, 180, 140, 0.6);
    border-radius: 50%;
    animation: swirl 8s ease-in-out infinite;
}

@keyframes swirl {
    0% { 
        transform: translateX(0) translateY(0) rotate(0deg);
        opacity: 0.3;
    }
    25% { 
        transform: translateX(30px) translateY(-20px) rotate(90deg);
        opacity: 0.7;
    }
    50% { 
        transform: translateX(0) translateY(-40px) rotate(180deg);
        opacity: 0.5;
    }
    75% { 
        transform: translateX(-30px) translateY(-20px) rotate(270deg);
        opacity: 0.7;
    }
    100% { 
        transform: translateX(0) translateY(0) rotate(360deg);
        opacity: 0.3;
    }
}

/* Hail stones */
.hail {
    position: absolute;
    background: radial-gradient(circle, #ffffff 30%, #e8e8e8 70%, #d0d0d0 100%);
    border-radius: 50%;
    animation: hailfall 0.8s linear infinite;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.hail.small { width: 4px; height: 4px; }
.hail.medium { width: 6px; height: 6px; }
.hail.large { width: 8px; height: 8px; }

@keyframes hailfall {
    0% { 
        top: -10px; 
        opacity: 0; 
    }
    10% { opacity: 1; }
    90% { opacity: 1; }
    100% { 
        top: 100vh; 
        opacity: 0; 
    }
}

/* Smoke particles for smoke/haze */
.smoke-particle {
    position: absolute;
    background: radial-gradient(circle, rgba(128, 128, 128, 0.4) 0%, transparent 70%);
    border-radius: 50%;
    animation: smoke-drift 12s ease-in-out infinite;
}

@keyframes smoke-drift {
    0% { 
        transform: translateX(0) translateY(20px) scale(0.5);
        opacity: 0.6;
    }
    50% { 
        transform: translateX(40px) translateY(-30px) scale(1.2);
        opacity: 0.3;
    }
    100% { 
        transform: translateX(-20px) translateY(-60px) scale(0.8);
        opacity: 0;
    }
}

/* Tornado effect */
.tornado {
    position: absolute;
    width: 0;
    height: 0;
    border-left: 20px solid transparent;
    border-right: 20px solid transparent;
    border-bottom: 200px solid rgba(100, 100, 100, 0.7);
    animation: tornado-spin 2s linear infinite;
    left: 50%;
    top: 60%;
    transform-origin: bottom center;
}

@keyframes tornado-spin {
    0% { transform: translateX(-50%) rotate(0deg); }
    100% { transform: translateX(-50%) rotate(360deg); }
}

/* Volcanic ash */
.ash-particle {
    position: absolute;
    background: rgba(64, 64, 64, 0.8);
    border-radius: 50%;
    animation: ash-fall 6s ease-in-out infinite;
}

@keyframes ash-fall {
    0% { 
        transform: translateY(-50px) translateX(0);
        opacity: 0;
    }
    20% { opacity: 0.8; }
    80% { opacity: 0.6; }
    100% { 
        transform: translateY(100vh) translateX(50px);
        opacity: 0;
    }
}

/* Aurora effect for extreme cold */
.aurora {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 50%;
    background: linear-gradient(
        45deg,
        transparent 40%, 
        rgba(0, 255, 150, 0.3) 50%, 
        rgba(0, 150, 255, 0.3) 60%, 
        transparent 70%
    );
    animation: aurora-wave 8s ease-in-out infinite;
}

@keyframes aurora-wave {
    0%, 100% { 
        opacity: 0.3;
        transform: skewY(0deg);
    }
    50% { 
        opacity: 0.7;
        transform: skewY(2deg);
    }
}

/* Fog bank rolling in */
.fog-bank {
    position: absolute;
    bottom: 0;
    width: 200%;
    height: 40%;
    background: linear-gradient(to top, rgba(200, 200, 200, 0.8) 0%, transparent 100%);
    animation: fog-roll 20s linear infinite;
}

@keyframes fog-roll {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(0%); }
}

/* Heavy wind effect */
.wind-particle {
    position: absolute;
    width: 30px;
    height: 2px;
    background: linear-gradient(to right, transparent, rgba(255, 255, 255, 0.6), transparent);
    animation: wind-blow 1.5s linear infinite;
}

@keyframes wind-blow {
    0% { 
        left: -50px;
        opacity: 0;
    }
    20% { opacity: 1; }
    80% { opacity: 1; }
    100% { 
        left: calc(100% + 50px);
        opacity: 0;
    }
}

/* Sleet (mix of rain and snow) */
.sleet {
    position: absolute;
    animation: sleet-fall 1.2s linear infinite;
}

.sleet.rain {
    width: 2px;
    height: 15px;
    background: linear-gradient(to bottom, transparent, #4FC3F7, transparent);
}

.sleet.ice {
    width: 3px;
    height: 3px;
    background: #ffffff;
    border-radius: 50%;
    box-shadow: 0 0 2px rgba(0,0,0,0.3);
}

@keyframes sleet-fall {
    0% { 
        top: -20px; 
        opacity: 0; 
    }
    10% { opacity: 1; }
    90% { opacity: 1; }
    100% { 
        top: 100vh; 
        opacity: 0; 
    }
}

body.dark-mode {
    background: var(--dark-bg);
    color: var(--dark-text);
}

.app-wrapper {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: calc(100vh - 40px);
    padding-top: 40px;
}

.container {
    max-width: 640px;
    width: 100%;
    padding: 40px;
    background: rgba(255, 255, 255, 0.5); /* More opaque for better readability */
    backdrop-filter: blur(25px) saturate(1.3);
    border: 1px solid rgba(255, 255, 255, 0.4);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15), 
                0 4px 16px rgba(0, 0, 0, 0.10),
                inset 0 1px 0 rgba(255, 255, 255, 0.6);
    border-radius: var(--border-radius-lg);
    transition: var(--transition);
    position: relative;
    -webkit-backdrop-filter: blur(25px) saturate(1.3);
}

body.dark-mode .container {
    background: rgba(30, 41, 59, 0.65); /* More opaque for dark mode readability */
    border-color: rgba(255, 255, 255, 0.25);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5), 
                0 4px 16px rgba(0, 0, 0, 0.3),
                inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 36px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border-color);
    position: relative;
}

body.dark-mode .header {
    border-bottom-color: var(--border-color-dark);
}

.header h1 {
    margin: 0;
    font-size: 2.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.02em;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
}

.header h1:hover {
    transform: translateY(-1px);
    filter: brightness(1.1);
}

.favorites-icon {
    padding: 14px;
    border-radius: var(--border-radius);
    background: rgba(30, 64, 175, 0.08);
    border: 1px solid var(--border-color);
    transition: var(--transition);
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.favorites-icon::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;
}

.favorites-icon:hover::before {
    left: 100%;
}

.favorites-icon:hover {
    background: var(--primary-color);
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

body.dark-mode .favorites-icon {
    background: rgba(30, 64, 175, 0.15);
    border-color: var(--border-color-dark);
}

.favorites-icon svg {
    width: 24px;
    height: 24px;
    transition: var(--transition);
    position: relative;
    z-index: 1;
}

.favorites-icon:hover svg {
    stroke: white;
}

.input-group {
    position: relative;
    margin-bottom: 28px;
}

input[type="text"] {
    width: 100%;
    padding: 18px 24px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: var(--border-radius);
    background: rgba(255, 255, 255, 0.25); /* More opaque for readability */
    backdrop-filter: blur(12px) saturate(1.1);
    font-size: 1.1rem;
    transition: var(--transition);
    outline: none;
    font-weight: 500;
    color: var(--light-text);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
}

input[type="text"]:focus {
    border-color: rgba(30, 64, 175, 0.6);
    background: rgba(255, 255, 255, 0.35); /* More opaque on focus */
    box-shadow: 0 0 0 3px rgba(30, 64, 175, 0.15),
                0 8px 24px rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
}

input[type="text"]::placeholder {
    color: var(--secondary-color);
    font-weight: 400;
    opacity: 0.8;
}

body.dark-mode input[type="text"] {
    background: rgba(255, 255, 255, 0.15); /* More opaque for dark mode */
    border-color: rgba(255, 255, 255, 0.2);
    color: var(--dark-text);
    backdrop-filter: blur(12px) saturate(1.1);
}

body.dark-mode input[type="text"]:focus {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(59, 130, 246, 0.6);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2),
                0 8px 24px rgba(0, 0, 0, 0.2);
}

body.dark-mode input[type="text"]::placeholder {
    color: var(--secondary-light);
    opacity: 0.7;
}

/* Input with location button styling */
.input-with-location {
    position: relative;
    display: flex;
    align-items: center;
}

.input-with-location input[type="text"] {
    padding-right: 140px; /* Make room for clear button + existing buttons */
}

/* Clear input button */
.clear-input-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    background: transparent;
    border: none;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition-fast);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--danger-color);
    font-size: 16px;
    font-weight: bold;
    z-index: 10;
    left: 10px; /* This will be dynamically updated by JavaScript */
}

.clear-input-btn.visible {
    opacity: 1;
    visibility: visible;
}

.clear-input-btn:hover {
    background-color: rgba(220, 38, 38, 0.1);
    transform: translateY(-50%) scale(1.2);
}

body.dark-mode .clear-input-btn {
    color: #ef4444;
}

body.dark-mode .clear-input-btn:hover {
    background-color: rgba(239, 68, 68, 0.2);
}

.location-btn {
    position: absolute;
    right: 65px; /* Position to make room for favorites button */
    top: 50%;
    transform: translateY(-50%);
    width: 48px;
    height: 48px;
    padding: 0;
    margin: 0;
    border: none; /* Remove border */
    border-radius: var(--border-radius-sm);
    background: transparent; /* Transparent background */
    color: var(--primary-color); /* Icon color */
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: none; /* Remove shadow */
    outline: none; /* Remove blue outline */
}

.location-btn:hover {
    background: rgba(30, 64, 175, 0.1); /* Light background on hover */
    transform: translateY(-50%) scale(1.1);
    color: var(--primary-hover);
}

.location-btn:focus {
    background: rgba(30, 64, 175, 0.1);
    color: var(--primary-hover);
}

.location-btn svg {
    width: 22px;
    height: 22px;
    stroke: currentColor; /* Use current color */
}

/* Favorites dropdown styling */
.favorites-dropdown-container {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2000; /* High z-index to ensure it's above all weather content */
}

.favorites-btn {
    width: 48px;
    height: 48px;
    padding: 0;
    border: none; /* Remove border */
    border-radius: var(--border-radius-sm);
    background: transparent; /* Transparent background */
    color: var(--primary-color); /* Icon color */
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    box-shadow: none; /* Remove shadow */
    outline: none; /* Remove blue outline */
}

.favorites-btn:hover {
    background: rgba(30, 64, 175, 0.1); /* Light background on hover */
    transform: scale(1.1);
    color: var(--primary-hover);
}

.favorites-btn:active {
    transform: scale(0.95);
}

.favorites-btn:focus {
    background: rgba(30, 64, 175, 0.1);
    color: var(--primary-hover);
}

.favorites-btn svg {
    width: 22px;
    height: 22px;
    stroke: currentColor; /* Use current color */
}

.favorites-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 280px;
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    z-index: 1000; /* Higher z-index to ensure it's above everything */
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: var(--transition);
    max-height: 300px;
    overflow-y: auto;
}

.favorites-dropdown.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

body.dark-mode .favorites-dropdown {
    background: var(--card-bg-dark);
    border-color: var(--border-color-dark);
}

.favorites-header {
    padding: 16px 20px 12px;
    border-bottom: 1px solid var(--border-color);
    font-weight: 600;
    color: var(--light-text);
    font-size: 0.95rem;
}

body.dark-mode .favorites-header {
    border-color: var(--border-color-dark);
    color: var(--dark-text);
}

.favorites-list {
    padding: 8px 0;
}

.no-favorites {
    padding: 20px;
    text-align: center;
    color: var(--secondary-color);
    font-style: italic;
    font-size: 0.9rem;
}

.favorite-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    cursor: pointer;
    transition: var(--transition-fast);
    color: var(--light-text);
}

.favorite-item:hover {
    background: rgba(30, 64, 175, 0.05);
}

body.dark-mode .favorite-item {
    color: var(--dark-text);
}

body.dark-mode .favorite-item:hover {
    background: rgba(30, 64, 175, 0.1);
}

.favorite-name {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    font-size: 0.9rem;
}

/* Custom favorite star indicator - replaces emoji */
.favorite-star-indicator {
    width: 16px;
    height: 16px;
    position: relative;
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(251, 191, 36, 0.3);
    transition: var(--transition);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.favorite-star-indicator::before {
    content: '★';
    color: white;
    font-size: 9px;
    font-weight: bold;
    line-height: 1;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.favorite-star-indicator::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, rgba(255,255,255,0.5), transparent 50%);
    pointer-events: none;
}

/* Custom history icon styling */
.history-icon {
    display: inline-block;
    width: 14px;
    height: 14px;
    position: relative;
    border: 2px solid var(--primary-color);
    border-radius: 50%;
    opacity: 0.7;
    transition: var(--transition);
}

.history-icon::before {
    content: '';
    position: absolute;
    top: 1px;
    left: 50%;
    transform: translateX(-50%);
    width: 1px;
    height: 4px;
    background: var(--primary-color);
    border-radius: 1px;
}

.history-icon::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 50%;
    transform: translateX(-50%) rotate(90deg);
    width: 1px;
    height: 3px;
    background: var(--primary-color);
    border-radius: 1px;
}

.history-item:hover .history-icon {
    opacity: 1;
    border-color: var(--primary-hover);
}

.history-item:hover .history-icon::before,
.history-item:hover .history-icon::after {
    background: var(--primary-hover);
}

/* Dark mode support for history icon */
body.dark-mode .history-icon {
    border-color: var(--primary-light);
}

body.dark-mode .history-icon::before,
body.dark-mode .history-icon::after {
    background: var(--primary-light);
}

body.dark-mode .history-item:hover .history-icon {
    border-color: white;
}

body.dark-mode .history-item:hover .history-icon::before,
body.dark-mode .history-item:hover .history-icon::after {
    background: white;
}

/* Custom remove button styling - replaces emoji */
.favorite-remove {
    padding: 6px 10px;
    border: 1px solid #ef4444;
    border-radius: var(--border-radius-sm);
    background: transparent;
    color: #ef4444;
    cursor: pointer;
    transition: var(--transition);
    font-size: 0.8rem;
    font-weight: 600;
    outline: none;
    position: relative;
    overflow: hidden;
}

.favorite-remove::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    transition: left 0.3s ease;
}

.favorite-remove:hover {
    background: #ef4444;
    color: white;
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.3);
}

.favorite-remove:hover::before {
    left: 100%;
}

.favorite-remove:active {
    transform: scale(0.95);
}

.remove-text {
    position: relative;
    z-index: 1;
    pointer-events: none;
}

/* Hover effects for favorite items */
.favorite-item:hover .favorite-star-indicator {
    transform: scale(1.1) rotate(10deg);
    box-shadow: 0 4px 10px rgba(251, 191, 36, 0.4);
    background: linear-gradient(135deg, #fcd34d, #fbbf24);
}

/* Dark mode support */
body.dark-mode .favorite-star-indicator {
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    box-shadow: 0 2px 6px rgba(251, 191, 36, 0.4);
    border-color: rgba(255, 255, 255, 0.2);
}

body.dark-mode .favorite-remove {
    border-color: #f87171;
    color: #f87171;
}

body.dark-mode .favorite-remove:hover {
    background: #f87171;
    color: var(--dark-text);
}

body.dark-mode .location-btn,
body.dark-mode .favorites-btn {
    background: rgba(59, 130, 246, 0.8);
    border-color: rgba(59, 130, 246, 0.8);
}

body.dark-mode .location-btn:hover,
body.dark-mode .favorites-btn:hover {
    background: rgba(59, 130, 246, 1);
}

/* Weather data styling */
#weatherData {
    background: transparent;
    border: none;
    box-shadow: none;
    padding: 0;
    border-radius: 0;
}

.weather-main {
    text-align: center;
    margin-bottom: 36px;
    position: relative;
    z-index: 1; /* Ensure weather content is below dropdowns */
}

.weather-icon {
    width: 120px;
    height: 120px;
    margin: 0 auto;
    display: block;
    animation: weatherIconFloat 2.5s ease-in-out infinite;
    filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.25)) 
            drop-shadow(0 4px 8px rgba(0, 0, 0, 0.15));
    transition: transform 0.3s ease;
    position: relative;
    z-index: -1; /* Negative z-index to ensure it stays behind all other content */
    background: radial-gradient(circle at center, rgba(255, 255, 255, 0.1), transparent 70%);
    border-radius: 50%;
    padding: 10px;
}

@keyframes weatherIconFloat {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-15px);
    }
}

.weather-main h2 {
    margin: 20px 0 12px 0;
    font-size: 1.9rem;
    font-weight: 700;
    color: var(--light-text);
    letter-spacing: -0.01em;
}

.main-temp {
    font-size: 4.5rem;
    font-weight: 200;
    color: var(--primary-color);
    margin: 20px 0;
    text-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    letter-spacing: -0.02em;
}

.weather-description {
    font-size: 1.3rem;
    color: var(--secondary-color);
    text-transform: capitalize;
    font-weight: 600;
    letter-spacing: 0.01em;
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 24px;
}

.detail-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    flex: 1;
    justify-content: center;
    padding: 16px;
    background: rgba(255, 255, 255, 0.3); /* More opaque for better text readability */
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: var(--border-radius-sm);
    position: relative;
    transition: var(--transition);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

.detail-item:hover {
    background: rgba(255, 255, 255, 0.4);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

body.dark-mode .detail-item {
    background: rgba(255, 255, 255, 0.15); /* More opaque for dark mode text */
    border-color: rgba(255, 255, 255, 0.25);
}

body.dark-mode .detail-item:hover {
    background: rgba(255, 255, 255, 0.2);
}

.detail-info {
    text-align: center;
}

.detail-label {
    font-size: 0.9rem;
    color: var(--secondary-color);
    margin-bottom: 8px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: flex;
    align-items: center;
    gap: 6px;
    justify-content: center;
}

.detail-label i {
    font-size: 1.1rem;
    color: var(--primary-color);
}

.detail-value {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--light-text);
}

/* Back to site button */
.back-to-site-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: var(--primary-color) !important; /* Blue background - force override */
    border: 1px solid var(--primary-color) !important;
    border-radius: var(--border-radius-sm);
    color: white !important; /* White text on blue background - force override */
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: var(--transition);
    backdrop-filter: none !important; /* Disable glassmorphism */
    -webkit-backdrop-filter: none !important;
}

.back-to-site-btn:hover {
    background: #1e3a8a !important; /* Explicit dark blue hex color - force override */
    border-color: #1e3a8a !important;
    color: white !important;
    transform: translateY(-1px);
    box-shadow: var(--shadow);
    backdrop-filter: none !important; /* Disable glassmorphism on hover */
    -webkit-backdrop-filter: none !important;
}

body.dark-mode .back-to-site-btn {
    background: var(--primary-color) !important; /* Same solid blue in dark mode - force override */
    border-color: var(--primary-color) !important;
    color: white !important;
    backdrop-filter: none !important; /* Disable glassmorphism */
    -webkit-backdrop-filter: none !important;
}

body.dark-mode .back-to-site-btn:hover {
    background: #1e3a8a !important; /* Explicit dark blue hex color - force override */
    border-color: #1e3a8a !important;
    color: white !important;
    backdrop-filter: none !important; /* Disable glassmorphism on hover */
    -webkit-backdrop-filter: none !important;
}

.back-to-site-btn svg {
    transition: var(--transition);
}

.back-to-site-btn:hover svg {
    transform: translateX(-2px);
    stroke: white;
}

/* Weather details with improved styling */
.weather-details {
    background: transparent;
    backdrop-filter: none;
    border-radius: 0;
    padding: 0;
    margin: 0;
    border: none;
    box-shadow: none;
}
.forecast-container {
    margin-top: 36px;
}

.forecast-section {
    background: rgba(255, 255, 255, 0.25); /* More opaque for better readability */
    backdrop-filter: blur(15px) saturate(1.1);
    border-radius: var(--border-radius);
    border: 1px solid rgba(255, 255, 255, 0.35);
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08),
                0 2px 8px rgba(0, 0, 0, 0.05);
    transition: var(--transition);
}

.forecast-section:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
}

body.dark-mode .forecast-section {
    background: rgba(255, 255, 255, 0.12); /* More opaque for dark mode */
    border-color: rgba(255, 255, 255, 0.2);
}

body.dark-mode .forecast-section:hover {
    background: rgba(255, 255, 255, 0.15);
}

/* Forbedrede forecast tabs */
.forecast-tabs {
    display: flex;
    background: rgba(255, 255, 255, 0.05); /* More transparent */
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding: 0;
    backdrop-filter: blur(8px);
}

.forecast-tab {
    flex: 1;
    padding: 20px 24px;
    background: transparent;
    border: none;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--secondary-color);
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    text-align: center;
    letter-spacing: 0.01em;
}

.forecast-tab:hover {
    background: rgba(255, 255, 255, 0.08); /* More transparent hover */
    color: var(--light-text);
    transform: translateY(-1px);
}

.forecast-tab.active {
    color: var(--primary-color);
    background: rgba(30, 64, 175, 0.06); /* More transparent active state */
    box-shadow: inset 0 2px 0 var(--primary-color);
}

body.dark-mode .forecast-tab.active {
    background: rgba(30, 64, 175, 0.08);
}

.forecast-tab.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60%;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-color), var(--primary-light));
    border-radius: 3px 3px 0 0;
}

/* Forecast content */
.forecast-content {
    display: none;
    padding: 32px;
}

.forecast-content.active {
    display: block;
}

/* Forbedret hourly forecast styling */
.hourly-details {
    display: flex;
    overflow-x: auto;
    gap: 28px;
    margin-top: 24px;
    padding-bottom: 8px;
    scrollbar-width: thin;
    scrollbar-color: var(--primary-color) rgba(255, 255, 255, 0.1);
}

.hourly-details::-webkit-scrollbar {
    height: 6px;
}

.hourly-details::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

.hourly-details::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 3px;
}

.hourly-details::-webkit-scrollbar-thumb:hover {
    background: var(--primary-hover);
}

.hourly-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 24px 20px;
    background: linear-gradient(135deg, 
        rgba(255, 255, 255, 0.18) 0%, 
        rgba(255, 255, 255, 0.12) 100%);
    border-radius: var(--border-radius);
    text-align: center;
    transition: var(--transition);
    border: 1px solid rgba(255, 255, 255, 0.15);
    position: relative;
    overflow: hidden;
    min-width: 155px;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
}

.hourly-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, var(--primary-color), var(--primary-light));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.hourly-item:hover {
    background: linear-gradient(135deg, 
        rgba(255, 255, 255, 0.28) 0%, 
        rgba(255, 255, 255, 0.22) 100%);
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08);
}

.hourly-item:hover::before {
    opacity: 1;
}

.hour-time {
    font-size: 1rem;
    font-weight: 700;
    color: var(--light-text);
    margin-bottom: 12px;
    letter-spacing: 0.01em;
}

.hour-temp {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--primary-color);
    margin-bottom: 8px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.hour-condition {
    font-size: 0.9rem;
    color: var(--secondary-color);
    margin-bottom: 8px;
    text-transform: capitalize;
    font-weight: 500;
    line-height: 1.3;
}

.hour-precipitation {
    font-size: 0.85rem;
    color: var(--primary-light);
    font-weight: 700;
    background: rgba(30, 64, 175, 0.1);
    padding: 4px 8px;
    border-radius: 12px;
    margin-bottom: 4px;
}

.hour-wind {
    font-size: 0.8rem;
    color: var(--secondary-color);
    font-weight: 500;
}

/* Forbedret daily forecast styling */
.daily-cards {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.daily-card {
    display: grid;
    grid-template-columns: 1.2fr auto 1fr auto;
    align-items: center;
    padding: 24px 28px;
    background: rgba(255, 255, 255, 0.2); /* More opaque for text readability */
    backdrop-filter: blur(12px);
    border-radius: var(--border-radius);
    transition: var(--transition);
    gap: 24px;
    border: 1px solid rgba(255, 255, 255, 0.25);
    position: relative;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}

.daily-card::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: linear-gradient(180deg, var(--primary-color), var(--primary-light));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.daily-card:hover {
    background: rgba(255, 255, 255, 0.3); /* More visible on hover */
    transform: translateY(-2px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

body.dark-mode .daily-card {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.08);
}

body.dark-mode .daily-card:hover {
    background: rgba(255, 255, 255, 0.06);
}

.daily-card:hover::before {
    opacity: 1;
}

.daily-date {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.day-name {
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--light-text);
    margin-bottom: 4px;
    letter-spacing: -0.01em;
}

.day-date {
    font-size: 1rem;
    color: var(--secondary-color);
    font-weight: 500;
}

.daily-icon {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 8px;
}

.daily-weather-icon {
    width: 56px;
    height: 56px;
    filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.2)) 
            brightness(1.1) 
            contrast(1.1);
    background: radial-gradient(circle at center, rgba(255, 255, 255, 0.08), transparent 60%);
    border-radius: 50%;
    padding: 4px;
    transition: var(--transition);
}

.daily-weather-icon:hover {
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.25)) 
            brightness(1.2) 
            contrast(1.15);
    transform: scale(1.05);
}

.precipitation-chance {
    font-size: 0.85rem;
    color: white;
    font-weight: 700;
    background: var(--primary-color);
    padding: 4px 8px;
    border-radius: 12px;
    margin-top: 6px;
    min-width: 35px;
    text-align: center;
}

.daily-temps {
    display: flex;
    align-items: center;
    gap: 12px;
    justify-content: center;
}

.temp-max {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--light-text);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.temp-separator {
    font-size: 1.2rem;
    color: var(--secondary-color);
    font-weight: 400;
}

.temp-min {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--secondary-color);
}

.daily-condition {
    font-size: 1rem;
    color: var(--secondary-color);
    text-transform: capitalize;
    text-align: right;
    font-weight: 500;
    line-height: 1.3;
}

/* Dark mode support for forecasts - forbedret */
body.dark-mode .forecast-section {
    background: rgba(30, 41, 59, 0.5);
    border-color: var(--border-color-dark);
}

body.dark-mode .forecast-tabs {
    background: rgba(30, 41, 59, 0.4);
    border-bottom-color: var(--border-color-dark);
}

body.dark-mode .forecast-tab {
    color: var(--secondary-light);
}

body.dark-mode .forecast-tab:hover {
    background: rgba(30, 41, 59, 0.5);
    color: var(--dark-text);
}

body.dark-mode .forecast-tab.active {
    background: rgba(30, 64, 175, 0.2);
    color: var(--primary-light);
}


body.dark-mode .hourly-item,
body.dark-mode .daily-card {
    background: linear-gradient(135deg, 
        rgba(30, 41, 59, 0.45) 0%, 
        rgba(30, 41, 59, 0.35) 100%);
    border-color: rgba(71, 85, 105, 0.35);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

body.dark-mode .hourly-item:hover,
body.dark_mode .daily-card:hover {
    background: linear-gradient(135deg, 
        rgba(30, 41, 59, 0.6) 0%, 
        rgba(30, 41, 59, 0.5) 100%);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

body.dark-mode .day-name,
body.dark-mode .temp-max,
body.dark-mode .hour-time {
    color: var(--dark-text);
}

body.dark-mode .temp-separator,
body.dark-mode .temp-min,
body.dark-mode .daily-condition,
body.dark-mode .hour-condition,
body.dark-mode .hour-wind,
body.dark-mode .day-date {
    color: var(--secondary-light);
}

body.dark-mode .hour-precipitation {
    background: rgba(30, 64, 175, 0.3);
    color: var(--primary-light);
}

body.dark-mode .precipitation-chance {
    background: var(--primary-light);
    color: var(--dark-text);
}

/* Responsiv design - forbedret */
@media (max-width: 768px) {
    .forecast-content {
        padding: 24px;
    }
    
    .forecast-tabs {
        flex-direction: column;
    }
    
    .forecast-tab {
        padding: 16px 20px;
        border-bottom: 1px solid var(--border-color);
    }
    
    .forecast-tab:last-child {
        border-bottom: none;
    }
    
    .forecast-tab.active::after {
        bottom: auto;
        top: 0;
        left: 0;
        transform: none;
        width: 4px;
        height: 100%;
        border-radius: 0 3px 3px 0;
    }
    
    .hourly-details {
        gap: 16px;
    }
    
    .hourly-item {
        padding: 16px 12px;
        min-width: 100px;
    }
    
    .hour-temp {
        font-size: 1.4rem;
    }
    
    .daily-card {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 16px;
        padding: 20px;
    }
    
    .daily-date {
        align-items: center;
    }
    
    .daily-temps {
        justify-content: center;
    }
    
    .daily-condition {
        text-align: center;
    }
    
    .daily-card::before {
        left: auto;
        right: auto;
        top: 0;
        bottom: auto;
        width: 100%;
        height: 4px;
    }
}

@media (max-width: 480px) {
    .forecast-content {
        padding: 20px;
    }
    
    .hourly-details {
        gap: 12px;
    }
    
    .daily-card {
        padding: 16px;
        gap: 12px;
    }
    
    .daily-weather-icon {
        width: 48px;
        height: 48px;
    }
    
    .hour-temp {
        font-size: 1.3rem;
    }
    
    .temp-max {
        font-size: 1.3rem;
    }
    
    .forecast-tab {
        font-size: 1rem;
        padding: 14px 16px;
    }
}

/* Theme toggle with enhanced styling */
.theme-toggle {
    padding: 14px;
    border-radius: var(--border-radius);
    background: rgba(30, 64, 175, 0.08);
    border: 1px solid var(--border-color);
    transition: var(--transition);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--light-text);
    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);
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
    color: white;
}

body.dark-mode .theme-toggle {
    background: rgba(30, 64, 175, 0.15);
    border-color: var(--border-color-dark);
    color: var(--dark-text);
}

body.dark-mode .theme-toggle:hover {
    color: white;
}

/* City search suggestions styling - improved */
.suggestions-list {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-xl);
    z-index: 1000; /* Higher z-index to ensure it's above everything */
    max-height: 60vh; /* Use viewport height for better responsive design */
    overflow-y: auto; /* Allow scrolling for long lists */
    -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
    margin: 0;
    padding: 0;
    list-style: none;
    display: none;
    transition: var(--transition);
    transform-origin: top;
    animation: dropdownSlide 0.2s ease-out;
}

@keyframes dropdownSlide {
    from {
        opacity: 0;
        transform: translateY(-10px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.suggestions-list:not(:empty) {
    display: block;
}

body.dark-mode .suggestions-list {
    background: var(--card-bg-dark);
    border-color: var(--border-color-dark);
}

.suggestion-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    cursor: pointer;
    transition: var(--transition-fast);
    border-bottom: 1px solid rgba(226, 232, 240, 0.15);
    color: var(--light-text);
    position: relative;
    overflow: hidden;
}

.suggestion-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 0;
    background: linear-gradient(90deg, var(--primary-color), var(--primary-light));
    transition: width 0.3s ease;
}

.suggestion-item:last-child {
    border-bottom: none;
    border-radius: 0 0 var(--border-radius) var(--border-radius);
}

.suggestion-item:first-child:not(.suggestions-header) {
    border-radius: var(--border-radius) var(--border-radius) 0 0;
}

.suggestion-item:hover,
.suggestion-item.selected {
    background: rgba(30, 64, 175, 0.08);
    transform: translateX(3px);
    box-shadow: inset 0 0 0 1px rgba(30, 64, 175, 0.1);
}

.suggestion-item:hover::before,
.suggestion-item.selected::before {
    width: 4px;
}

body.dark-mode .suggestion-item {
    color: var(--dark-text);
    border-bottom-color: rgba(71, 85, 105, 0.2);
}

body.dark-mode .suggestion-item:hover,
body.dark-mode .suggestion-item.selected {
    background: rgba(30, 64, 175, 0.15);
    box-shadow: inset 0 0 0 1px rgba(30, 64, 175, 0.2);
}

.suggestion-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
    position: relative;
    z-index: 1;
}

.suggestion-name {
    font-size: 1rem;
    font-weight: 600;
    color: var(--light-text);
    line-height: 1.3;
    letter-spacing: -0.01em;
}

body.dark-mode .suggestion-name {
    color: var(--dark-text);
}

.suggestion-name strong {
    color: var(--primary-color);
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.suggestion-coords {
    font-size: 0.85rem;
    color: var(--secondary-color);
    opacity: 0.9;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 4px;
}

.suggestion-coords::before {
    content: '📍';
    font-size: 0.75rem;
    opacity: 0.7;
}

body.dark-mode .suggestion-coords {
    color: var(--secondary-light);
}

/* New favorite button styling - replaces suggestion-star */
.suggestion-favorite-btn {
    padding: 6px 12px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid var(--primary-color);
    border-radius: var(--border-radius-sm);
    background: transparent;
    color: var(--primary-color);
    transition: var(--transition);
    outline: none;
    position: relative;
    overflow: hidden;
    white-space: nowrap;
    min-width: 70px;
    text-align: center;
}

.suggestion-favorite-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    transition: left 0.3s ease;
}

.suggestion-favorite-btn:hover {
    background: var(--primary-color);
    color: white;
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(30, 64, 175, 0.3);
}

.suggestion-favorite-btn:hover::before {
    left: 100%;
}

.suggestion-favorite-btn:active {
    transform: scale(0.95);
}

.suggestion-favorite-btn.added {
    background: var(--success-color);
    border-color: var(--success-color);
    color: white;
    animation: favoriteAdded 0.3s ease-out;
}

@keyframes favoriteAdded {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
    }
}

.favorite-text {
    position: relative;
    z-index: 1;
    pointer-events: none;
}

/* Dark mode support for favorite button */
body.dark-mode .suggestion-favorite-btn {
    border-color: var(--primary-light);
    color: var(--primary-light);
}

body.dark-mode .suggestion-favorite-btn:hover {
    background: var(--primary-light);
    color: var(--dark-text);
}

body.dark-mode .suggestion-favorite-btn.added {
    background: var(--success-color);
    border-color: var(--success-color);
    color: white;
}

/* Visually hidden class for accessibility */
.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;
}

/* Initial Loading Screen Styles */
.initial-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #3a8bb1 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.8s ease, visibility 0.8s ease;
}

.initial-loader.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.initial-loader-content {
    text-align: center;
    color: white;
    animation: fadeInUp 1s ease-out;
}

.initial-loader-content h2 {
    font-size: 2rem;
    font-weight: 700;
    margin: 30px 0 15px 0;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    letter-spacing: -0.02em;
}

.initial-loader-content p {
    font-size: 1.1rem;
    opacity: 0.9;
    font-weight: 400;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

/* Initial Spinner */
.initial-spinner {
    width: 80px;
    height: 80px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top: 4px solid white;
    border-radius: 50%;
    animation: spin 1.5s linear infinite;
    margin: 0 auto;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Dark mode support for initial loader */
body.dark-mode .initial-loader {
    background: linear-gradient(135deg, #0c0c0c 0%, #1a1a2e 100%);
}

/* Hide main content while loading */
body.loading .app-wrapper {
    visibility: hidden;
}

/* Disable interactions while loading */
body.loading .container {
    pointer-events: none;
}

/* ========================================
   MOBILE RESPONSIVE DESIGN
   ======================================== */

/* Tablet styles */
@media (max-width: 1024px) {
    .container {
        max-width: 100%;
        padding: 30px;
    }
    
    .detail-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
    
    .hourly-details {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .daily-cards {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Mobile styles */
@media (max-width: 768px) {
    * {
        box-sizing: border-box;
    }
    
    html, body {
        padding: 0;
        margin: 0;
        width: 100%;
        height: 100%;
        overflow-x: hidden;
        font-size: 14px;
        background: #f0f8ff;
    }
    
    .app-wrapper {
        padding: 0;
        margin: 0;
        width: 100vw;
        min-height: 100vh;
        align-items: stretch;
        display: flex;
        flex-direction: column;
    }
    
    .container {
        width: 100vw;
        height: 100vh;
        max-width: 100vw;
        padding: 8px;
        border-radius: 0 !important;
        margin: 0;
        background: rgba(255, 255, 255, 0.98);
        backdrop-filter: blur(15px);
        border: none;
        position: fixed;
        top: 0;
        left: 0;
        overflow-y: auto;
        box-sizing: border-box;
    }
    
    /* Weather-themed overlays for mobile */
    body.weather-clear .container {
        background: rgba(255, 255, 255, 0.95);
        border-color: transparent;
    }
    
    body.weather-clouds .container {
        background: rgba(255, 255, 255, 0.95);
        border-color: transparent;
    }
    
    body.weather-rain .container {
        background: rgba(255, 255, 255, 0.95);
        border-color: transparent;
    }
    
    body.weather-snow .container {
        background: rgba(255, 255, 255, 0.98);
        border-color: transparent;
    }
    
    body.weather-thunderstorm .container {
        background: rgba(255, 255, 255, 0.95);
        border-color: transparent;
    }
    
    /* Add weather-themed gradient overlay */
    .container::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        height: 100px;
        background: transparent;
        pointer-events: none;
        transition: var(--transition);
        z-index: -1;
    }
    
    body.weather-clear .container::before {
        background: linear-gradient(to bottom, rgba(135, 206, 250, 0.1), transparent);
    }
    
    body.weather-clouds .container::before {
        background: linear-gradient(to bottom, rgba(176, 196, 222, 0.15), transparent);
    }
    
    body.weather-rain .container::before {
        background: linear-gradient(to bottom, rgba(112, 128, 144, 0.2), transparent);
    }
    
    body.weather-snow .container::before {
        background: linear-gradient(to bottom, rgba(224, 255, 255, 0.25), transparent);
    }
    
    body.weather-thunderstorm .container::before {
        background: linear-gradient(to bottom, rgba(47, 79, 79, 0.2), transparent);
    }
    
    /* Dark mode adjustments for mobile */
    body.dark-mode .container {
        background: rgba(30, 41, 59, 0.85);
        border-color: rgba(71, 85, 105, 0.4);
    }
    
    body.dark-mode.weather-clear .container::before {
        background: linear-gradient(to bottom, rgba(135, 206, 250, 0.05), transparent);
    }
    
    body.dark-mode.weather-clouds .container::before {
        background: linear-gradient(to bottom, rgba(176, 196, 222, 0.08), transparent);
    }
    
    body.dark-mode.weather-rain .container::before {
        background: linear-gradient(to bottom, rgba(112, 128, 144, 0.1), transparent);
    }
    
    /* Header adjustments */
    .header {
        flex-direction: column;
        gap: 20px;
        text-align: center;
        padding-bottom: 20px;
        margin-bottom: 24px;
        /* Add weather-themed border bottom */
        border-bottom: 3px solid transparent;
        position: relative;
    }
    
    /* Weather-themed header borders */
    body.weather-clear .header {
        border-bottom-color: rgba(135, 206, 250, 0.6);
    }
    
    body.weather-clouds .header {
        border-bottom-color: rgba(176, 196, 222, 0.6);
    }
    
    body.weather-rain .header {
        border-bottom-color: rgba(112, 128, 144, 0.6);
    }
    
    body.weather-snow .header {
        border-bottom-color: rgba(224, 255, 255, 0.8);
    }
    
    body.weather-thunderstorm .header {
        border-bottom-color: rgba(47, 79, 79, 0.6);
    }
    
    .header h1 {
        font-size: 2rem;
        margin-bottom: 0;
        /* Add subtle weather-themed glow on mobile */
        text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    }
    
    /* Settings panel mobile */
    .settings-dropdown {
        position: fixed;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        width: 90vw;
        max-width: 350px;
        max-height: 80vh;
        overflow-y: auto;
    }
    
    /* Input group mobile */
    .input-group {
        margin-bottom: 24px;
    }
    
    .input-with-location {
        position: relative;
        display: flex;
        flex-direction: row;
        align-items: center;
        gap: 0;
        background: white;
        border: 1px solid var(--border-color);
        border-radius: 12px;
        padding: 4px;
    }
    
    .input-with-location input[type="text"] {
        flex: 1;
        padding: 12px 16px;
        font-size: 16px; /* Prevent zoom on iOS */
        border: none;
        background: transparent;
        outline: none;
        border-radius: 8px;
    }
    
    /* Button group for mobile */
    .input-with-location .button-group {
        display: flex;
        gap: 4px;
        margin-left: 4px;
        align-items: center;
        justify-content: center;
        height: 40px;
    }
    
    .location-btn-container,
    .favorites-dropdown-container {
        position: relative;
        width: 40px;
        height: 40px;
        display: flex;
        align-items: center;
        justify-content: center;
        flex-shrink: 0;
    }
    
    .location-btn,
    .favorites-btn {
        position: static !important;
        width: 40px;
        height: 40px;
        min-width: 40px;
        margin: 0 !important;
        font-size: 0;
        padding: 0 !important;
        border-radius: 8px;
        display: flex !important;
        align-items: center;
        justify-content: center;
        flex-shrink: 0;
        transform: none !important;
        top: auto !important;
        left: auto !important;
    }
    
    .location-btn svg,
    .favorites-btn svg {
        width: 18px;
        height: 18px;
        flex-shrink: 0;
    }
    
    .favorites-dropdown {
        position: fixed;
        top: 200%;
        left: -750%;
        transform: translate(-50%, 0);
        width: 85vw;
        max-width: 320px;
        max-height: 60vh;
        overflow-y: auto;
        right: auto;
    }
    
    /* Weather main section */
    .weather-main {
        margin-bottom: 28px;
        text-align: center;
    }
    
    .weather-icon {
        width: 100px;
        height: 100px;
    }
    
    .weather-main h2 {
        font-size: 1.5rem;
        margin: 15px 0 10px 0;
    }
    
    .main-temp {
        font-size: 3rem;
        margin: 15px 0;
    }
    
    .weather-description {
        font-size: 1.1rem;
    }
    
    /* Weather details grid */
    .detail-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    
    .detail-item {
        padding: 16px;
    }
    
    .detail-label {
        font-size: 0.85rem;
    }
    
    .detail-value {
        font-size: 1.1rem;
    }
    
    /* Forecast section */
    .forecast-section {
        width: 100%;
        max-width: 100%;
        overflow: visible;
        box-sizing: border-box;
    }
    
    .forecast-content {
        width: 100%;
        max-width: 100%;
        overflow: visible;
        box-sizing: border-box;
    }
    
    .forecast-tabs {
        flex-direction: column;
        gap: 8px;
        width: 100%;
    }
    
    .forecast-tab {
        width: 100%;
        padding: 12px;
        font-size: 0.95rem;
    }
    
    /* Hourly forecast */
    .hourly-details {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    
    .hourly-item {
        padding: 12px;
    }
    
    .hour-time {
        font-size: 0.9rem;
    }
    
    .hour-temp {
        font-size: 1.1rem;
    }
    
    .hour-condition,
    .hour-precipitation,
    .hour-wind {
        font-size: 0.8rem;
    }
    
    /* Daily forecast */
    .daily-cards {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .daily-card {
        padding: 16px;
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }
    
    .daily-date {
        flex: 1;
        text-align: left;
    }
    
    .daily-icon {
        flex: 0 0 auto;
        margin: 0 15px;
    }
    
    .daily-weather-icon {
        width: 48px;
        height: 48px;
    }
    
    .daily-temps {
        flex: 0 0 auto;
        text-align: right;
    }
    
    .daily-condition {
        display: none; /* Hide on mobile to save space */
    }
    
    /* City suggestions */
    .suggestions-list {
        max-height: 60vh; /* Use viewport height instead of fixed pixels */
        overflow-y: auto; /* Allow scrolling for long lists */
        -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
    }
    
    .suggestion-item {
        padding: 14px 16px;
        font-size: 0.95rem;
    }
    
    /* Loading spinner */
    .spinner-overlay {
        border-radius: var(--border-radius);
    }
    
    .spinner {
        width: 40px;
        height: 40px;
        border-width: 3px;
    }
    
    /* Initial loader mobile */
    .initial-loader-content h2 {
        font-size: 1.75rem;
        margin: 25px 0 12px 0;
    }
    
    .initial-loader-content p {
        font-size: 1rem;
    }
    
    .initial-spinner {
        width: 60px;
        height: 60px;
        border-width: 3px;
    }
}

/* Small mobile styles */
@media (max-width: 480px) {
    body {
        padding: 5px;
    }
    
    .container {
        padding: 15px;
        border-radius: 12px;
        background: rgba(255, 255, 255, 0.5); /* Same glassmorphism effect as desktop */
        backdrop-filter: blur(25px) saturate(1.3);
        border: 1px solid rgba(255, 255, 255, 0.4);
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15), 
                    0 4px 16px rgba(0, 0, 0, 0.10),
                    inset 0 1px 0 rgba(255, 255, 255, 0.6);
        -webkit-backdrop-filter: blur(25px) saturate(1.3);
    }
    
    .header h1 {
        font-size: 1.75rem;
    }
    
    .main-temp {
        font-size: 2.5rem;
    }
    
    .weather-icon {
        width: 80px;
        height: 80px;
    }
    
    .detail-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .hourly-details {
        grid-template-columns: 1fr;
    }
    
    /* Touch-friendly buttons */
    .location-btn,
    .favorites-btn,
    .forecast-tab {
        min-height: 44px; /* iOS touch target minimum */
    }
    
    /* Larger text for readability */
    input[type="text"] {
        font-size: 16px !important; /* Prevent zoom */
    }
    
    /* Optimize search suggestions for small screens */
    .suggestions-list {
        max-height: 50vh; /* Smaller height on very small screens */
        left: -5px; /* Extend slightly beyond container */
        right: -5px; /* For better touch targets */
        border-radius: var(--border-radius-sm);
    }
    
    .suggestion-item {
        padding: 16px 12px; /* Larger touch targets */
        font-size: 0.9rem;
        min-height: 44px; /* iOS touch target minimum */
        display: flex;
        align-items: center;
    }
}

/* Landscape phone adjustments */
@media (max-width: 768px) and (orientation: landscape) {
    .container {
        padding: 15px;
        background: rgba(255, 255, 255, 0.5); /* Same glassmorphism effect as desktop */
        backdrop-filter: blur(25px) saturate(1.3);
        border: 1px solid rgba(255, 255, 255, 0.4);
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15), 
                    0 4px 16px rgba(0, 0, 0, 0.10),
                    inset 0 1px 0 rgba(255, 255, 255, 0.6);
        -webkit-backdrop-filter: blur(25px) saturate(1.3);
    }
    
    .header {
        flex-direction: row;
        padding-bottom: 15px;
        margin-bottom: 20px;
    }
    
    .header h1 {
        font-size: 1.5rem;
    }
    
    .weather-main {
        margin-bottom: 20px;
    }
    
    .detail-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .hourly-details {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* High DPI/Retina display support */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .weather-icon,
    .daily-weather-icon,
    .hourly-icon {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
    /* Remove hover effects on touch devices */
    .location-btn:hover,
    .favorites-btn:hover,
    .forecast-tab:hover,
    .suggestion-item:hover {
        transform: none;
        box-shadow: var(--shadow);
    }
    
    /* Add active states for touch feedback */
    .location-btn:active,
    .favorites-btn:active,
    .forecast-tab:active {
        transform: scale(0.95);
        transition: transform 0.1s ease;
    }
    
    .suggestion-item:active {
        background: var(--primary-color);
        color: white;
    }
    
    /* Increase touch target sizes */
    .location-btn,
    .favorites-btn {
        min-width: 44px;
        min-height: 44px;
    }
    
    /* Improve text selection on touch */
    .weather-description,
    .detail-value,
    .hour-condition,
    .daily-condition {
        -webkit-user-select: none;
        -moz-user-select: none;
        -ms-user-select: none;
        user-select: none;
    }
}

/* Prevent zoom on input focus for iOS */
@supports (-webkit-touch-callout: none) {
    input[type="text"] {
        font-size: 16px !important;
        transform: scale(1);
    }
}

/* Accessibility improvements for mobile */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .weather-icon {
        animation: none !important;
    }
    
    .initial-spinner {
        animation: none !important;
    }
}