/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent; /* Remove tap highlight on mobile */
}

body {
    font-family: 'Poppins', sans-serif;
    background: linear-gradient(135deg, #0c0c0c 0%, #1a1a2e 25%, #16213e 75%, #0f3460 100%);
    min-height: 100vh;
    color: #e0e0e0;
    overflow-x: hidden;
}

.container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.hidden {
    display: none !important;
}

/* Header Styles */
.header {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: white;
}

.logo i {
    font-size: 2rem;
    color: #ffd700;
}

.logo h1 {
    font-size: 1.8rem;
    font-weight: 600;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.search-container {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.search-input {
    padding: 0.75rem 1rem;
    border: none;
    border-radius: 25px;
    background: rgba(255, 255, 255, 0.15);
    color: white;
    font-size: 1rem;
    width: 250px;
    outline: none;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.search-input:focus {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
    border-color: rgba(255, 215, 0, 0.5);
}

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

.search-btn,
.location-btn,
.theme-toggle,
.favorites-btn {
    padding: 0.75rem;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-btn:hover,
.location-btn:hover,
.theme-toggle:hover,
.favorites-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

.theme-toggle {
    margin-left: 0.25rem;
}

.theme-toggle i {
    transition: transform 0.3s ease;
}

.theme-toggle:active i {
    transform: rotate(180deg);
}

/* Main Content */
.main-content {
    flex: 1;
    padding: 2rem;
    display: flex;
    justify-content: center;
}

/* Loading Spinner */
.loading {
    text-align: center;
    color: white;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 300px;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top: 4px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

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

/* Error Message */
.error {
    background: rgba(220, 53, 69, 0.9);
    color: white;
    padding: 2rem;
    border-radius: 15px;
    text-align: center;
    backdrop-filter: blur(10px);
    max-width: 400px;
    margin: 0 auto;
    animation: fadeInShake 0.5s ease-out;
}

.error i {
    font-size: 2rem;
    margin-bottom: 1rem;
    display: block;
}

@keyframes fadeInShake {
    0% {
        opacity: 0;
        transform: translateX(-20px);
    }
    50% {
        transform: translateX(10px);
    }
    100% {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Weather Display */
.weather-display {
    max-width: 1200px;
    width: 100%;
    animation: fadeInUp 0.6s ease-out;
}

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

/* Current Weather */
.current-weather {
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(20px);
    border-radius: 25px;
    padding: 2rem;
    margin-bottom: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    position: relative;
    overflow: hidden;
}

.current-weather::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(255, 215, 0, 0.1) 0%, rgba(255, 255, 255, 0.05) 50%, transparent 70%);
    animation: float 6s ease-in-out infinite;
}

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

.current-info {
    color: white;
    z-index: 2;
    position: relative;
}

.location-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.location-header h2 {
    margin-bottom: 0;
}

.location-header .favorite-btn {
    font-size: 1.2rem;
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.location-info h2 {
    font-size: 2rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.location-info p {
    color: rgba(255, 255, 255, 0.8);
    font-size: 1rem;
}

.temperature-display {
    margin-top: 1rem;
}

.temp-main {
    display: flex;
    align-items: flex-start;
    margin-bottom: 0.5rem;
}

.temp-main #currentTemp {
    font-size: 4rem;
    font-weight: 300;
    line-height: 1;
    text-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.temp-unit {
    font-size: 2rem;
    font-weight: 300;
    margin-left: 0.5rem;
    color: rgba(255, 255, 255, 0.9);
}

.temp-details p {
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.95rem;
    margin-bottom: 0.25rem;
}

.weather-icon-container {
    z-index: 2;
    position: relative;
}

.weather-icon {
    font-size: 6rem;
    color: #ffd700;
    text-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    animation: pulse 2s ease-in-out infinite;
}

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

/* Weather Details */
.weather-details {
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    padding: 2rem;
    margin-bottom: 2rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.weather-details h3 {
    color: white;
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

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

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

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

.detail-item i {
    font-size: 1.5rem;
    color: #ffd700;
    width: 25px;
    text-align: center;
}

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

.detail-label {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 0.25rem;
}

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

/* Forecast */
.forecast {
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    padding: 2rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.forecast h3 {
    color: white;
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

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

.forecast-item {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    padding: 1.5rem 1rem;
    text-align: center;
    color: white;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    overflow: hidden;
}

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

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

.forecast-item:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-5px);
}

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

.forecast-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: #ffd700;
}

.forecast-temps {
    display: flex;
    justify-content: center;
    gap: 1rem;
    font-size: 1.1rem;
}

.high-temp {
    font-weight: 600;
    color: white;
}

.low-temp {
    color: rgba(255, 255, 255, 0.7);
}

/* Footer */
.footer {
    background: rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(10px);
    text-align: center;
    padding: 1.5rem;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* Responsive Design */
@media (max-width: 768px) {
    body {
        font-size: 14px;
    }

    .header {
        padding: 1rem;
        flex-direction: column;
        gap: 1rem;
        position: relative;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    }

    .logo {
        justify-content: center;
    }

    .logo i {
        font-size: 1.8rem;
    }

    .logo h1 {
        font-size: 1.5rem;
    }

    .search-container {
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
    }

    .search-input {
        width: 100%;
        max-width: 280px;
        margin-bottom: 0.5rem;
        font-size: 16px; /* Prevents zoom on iOS */
    }

    .search-btn,
    .location-btn {
        width: 50px;
        height: 50px;
        font-size: 1.2rem;
    }

    .main-content {
        padding: 1rem 0.5rem;
    }

    .weather-display {
        width: 100%;
        max-width: none;
    }

    .current-weather {
        flex-direction: column;
        text-align: center;
        gap: 1.5rem;
        padding: 1.5rem 1rem;
        margin-bottom: 1.5rem;
        border-radius: 20px;
    }

    .current-info {
        order: 2;
    }

    .weather-icon-container {
        order: 1;
    }

    .location-info h2 {
        font-size: 1.5rem;
        margin-bottom: 0.25rem;
    }

    .location-info p {
        font-size: 0.9rem;
    }

    .temp-main {
        justify-content: center;
        margin-bottom: 1rem;
    }

    .temp-main #currentTemp {
        font-size: 3.5rem;
    }

    .temp-unit {
        font-size: 1.8rem;
    }

    .temp-details {
        text-align: center;
    }

    .temp-details p {
        font-size: 0.9rem;
        margin-bottom: 0.5rem;
    }

    .weather-icon {
        font-size: 5rem;
        margin-bottom: 1rem;
    }

    .weather-details {
        padding: 1.5rem 1rem;
        margin-bottom: 1.5rem;
        border-radius: 18px;
    }

    .weather-details h3 {
        font-size: 1.3rem;
        text-align: center;
        margin-bottom: 1.5rem;
    }

    .details-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .detail-item {
        padding: 1rem 0.75rem;
        border-radius: 12px;
    }

    .detail-item i {
        font-size: 1.3rem;
    }

    .detail-label {
        font-size: 0.8rem;
    }

    .detail-value {
        font-size: 1rem;
    }

    .forecast {
        padding: 1.5rem 1rem;
        border-radius: 18px;
    }

    .forecast h3 {
        font-size: 1.3rem;
        text-align: center;
        margin-bottom: 1.5rem;
    }

    .forecast-container {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }

    .forecast-item {
        padding: 1rem 0.5rem;
        border-radius: 12px;
    }

    .forecast-day {
        font-size: 0.9rem;
        margin-bottom: 0.75rem;
    }

    .forecast-icon {
        font-size: 2rem;
        margin-bottom: 0.75rem;
    }

    .forecast-temps {
        font-size: 1rem;
        gap: 0.5rem;
    }

    .footer {
        padding: 1rem;
        font-size: 0.8rem;
    }

    /* Improve touch targets */
    .search-btn:hover,
    .location-btn:hover,
    .detail-item:hover,
    .forecast-item:hover {
        transform: none; /* Disable hover transforms on touch devices */
    }

    .search-btn:active,
    .location-btn:active {
        transform: scale(0.95);
    }
}

@media (max-width: 480px) {
    .search-container {
        flex-direction: column;
        width: 100%;
    }

    .search-input {
        width: 100%;
        max-width: 300px;
    }

    .forecast-container {
        grid-template-columns: 1fr;
    }

    .forecast-item {
        padding: 1rem;
    }

    .temp-main #currentTemp {
        font-size: 2.5rem;
    }

    .current-weather {
        padding: 1rem;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .search-input {
        background: rgba(255, 255, 255, 0.1);
        color: white;
    }
    
    .search-input::placeholder {
        color: rgba(255, 255, 255, 0.7);
    }
    
    .search-input:focus {
        background: rgba(255, 255, 255, 0.15);
    }
}

/* Animation classes for dynamic content */
.weather-card-enter {
    animation: slideInFromRight 0.5s ease-out;
}

.weather-card-exit {
    animation: slideOutToLeft 0.3s ease-in;
}

@keyframes slideInFromRight {
    from {
        opacity: 0;
        transform: translateX(100px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

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

/* Weather condition specific styles */
.sunny { color: #ffd700; }
.cloudy { color: #87ceeb; }
.rainy { color: #4682b4; }
.snowy { color: #f0f8ff; }
.stormy { color: #696969; }

/* Additional mobile optimizations */
@media (max-width: 768px) and (orientation: landscape) {
    .current-weather {
        flex-direction: row;
        text-align: left;
    }
    
    .current-info {
        order: 1;
    }
    
    .weather-icon-container {
        order: 2;
    }
    
    .temp-main {
        justify-content: flex-start;
    }
    
    .temp-details {
        text-align: left;
    }
}

/* Prevent horizontal scrolling on very small screens */
@media (max-width: 320px) {
    .main-content {
        padding: 0.5rem 0.25rem;
    }
    
    .current-weather,
    .weather-details,
    .forecast {
        margin-left: 0.25rem;
        margin-right: 0.25rem;
    }
    
    .temp-main #currentTemp {
        font-size: 2.8rem;
    }
    
    .weather-icon {
        font-size: 4rem;
    }
}

/* High DPI displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .weather-icon,
    .forecast-icon i {
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
    }
}

/* Accessibility improvements for mobile */
@media (max-width: 768px) {
    .search-btn,
    .location-btn {
        min-height: 44px; /* Apple's recommended minimum touch target */
        min-width: 44px;
    }
    
    .detail-item,
    .forecast-item {
        min-height: 44px;
    }
    
    /* Focus styles for keyboard navigation on mobile */
    .search-input:focus,
    .search-btn:focus,
    .location-btn:focus {
        outline: 2px solid rgba(255, 215, 0, 0.8);
        outline-offset: 2px;
    }
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .current-weather::before {
        animation: none;
    }
    
    .weather-icon {
        animation: none;
    }
    
    .forecast-item::before {
        animation: none;
    }
}

/* Light Theme Styles */
body.light-theme {
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 25%, #90caf9 75%, #64b5f6 100%);
    color: #333;
}

.light-theme .header {
    background: rgba(255, 255, 255, 0.9);
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.light-theme .logo {
    color: #333;
}

.light-theme .logo i {
    color: #ff6b35;
}

.light-theme .logo h1 {
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.light-theme .search-input {
    background: rgba(255, 255, 255, 0.9);
    color: #333;
    border: 1px solid rgba(0, 0, 0, 0.2);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.light-theme .search-input:focus {
    background: white;
    border-color: rgba(255, 107, 53, 0.5);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.light-theme .search-input::placeholder {
    color: rgba(0, 0, 0, 0.6);
}

.light-theme .search-btn,
.light-theme .location-btn,
.light-theme .theme-toggle {
    background: rgba(0, 0, 0, 0.1);
    color: #333;
}

.light-theme .search-btn:hover,
.light-theme .location-btn:hover,
.light-theme .theme-toggle:hover {
    background: rgba(0, 0, 0, 0.2);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

.light-theme .loading {
    color: #333;
}

.light-theme .spinner {
    border: 4px solid rgba(0, 0, 0, 0.1);
    border-top: 4px solid #333;
}

.light-theme .current-weather {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(0, 0, 0, 0.1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.light-theme .current-weather::before {
    background: radial-gradient(circle, rgba(255, 107, 53, 0.1) 0%, rgba(255, 255, 255, 0.05) 50%, transparent 70%);
}

.light-theme .current-info {
    color: #333;
}

.light-theme .location-info h2 {
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.light-theme .location-info p {
    color: rgba(0, 0, 0, 0.7);
}

.light-theme .temp-details p {
    color: rgba(0, 0, 0, 0.8);
}

.light-theme .temp-unit {
    color: rgba(0, 0, 0, 0.8);
}

.light-theme .weather-icon {
    color: #ff6b35;
    text-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.light-theme .weather-details {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(0, 0, 0, 0.1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.light-theme .weather-details h3 {
    color: #333;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.light-theme .detail-item {
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.light-theme .detail-item:hover {
    background: rgba(255, 255, 255, 0.9);
}

.light-theme .detail-item i {
    color: #ff6b35;
}

.light-theme .detail-info {
    color: #333;
}

.light-theme .detail-label {
    color: rgba(0, 0, 0, 0.7);
}

.light-theme .detail-value {
    color: #333;
}

.light-theme .forecast {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(0, 0, 0, 0.1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.light-theme .forecast h3 {
    color: #333;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.light-theme .forecast-item {
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(0, 0, 0, 0.1);
    color: #333;
}

.light-theme .forecast-item:hover {
    background: rgba(255, 255, 255, 0.9);
}

.light-theme .forecast-item::before {
    background: linear-gradient(90deg, transparent, rgba(0, 0, 0, 0.05), transparent);
}

.light-theme .forecast-day {
    color: rgba(0, 0, 0, 0.8);
}

.light-theme .forecast-icon {
    color: #ff6b35;
}

.light-theme .high-temp {
    color: #333;
}

.light-theme .low-temp {
    color: rgba(0, 0, 0, 0.6);
}

.light-theme .footer {
    background: rgba(255, 255, 255, 0.8);
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    color: rgba(0, 0, 0, 0.7);
}

/* Light theme responsive adjustments */
@media (max-width: 768px) {
    .light-theme .header {
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    }
    
    .light-theme .search-btn,
    .light-theme .location-btn,
    .light-theme .theme-toggle {
        min-height: 44px;
        min-width: 44px;
    }
    
    .light-theme .search-input:focus,
    .light-theme .search-btn:focus,
    .light-theme .location-btn:focus,
    .light-theme .theme-toggle:focus {
        outline: 2px solid rgba(255, 107, 53, 0.8);
        outline-offset: 2px;
    }
}

/* Air Quality Index */
.aqi-section {
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    padding: 2rem;
    margin-bottom: 2rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.aqi-section h3 {
    color: white;
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.aqi-overview {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.aqi-value-container {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.aqi-value {
    font-size: 3rem;
    font-weight: 700;
    padding: 0.5rem;
    border-radius: 50%;
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    background: linear-gradient(135deg, #28a745, #20c997);
    box-shadow: 0 8px 20px rgba(40, 167, 69, 0.3);
}

.aqi-value.good { background: linear-gradient(135deg, #28a745, #20c997); }
.aqi-value.moderate { background: linear-gradient(135deg, #ffc107, #fd7e14); }
.aqi-value.unhealthy-sensitive { background: linear-gradient(135deg, #fd7e14, #dc3545); }
.aqi-value.unhealthy { background: linear-gradient(135deg, #dc3545, #6f42c1); }
.aqi-value.very-unhealthy { background: linear-gradient(135deg, #6f42c1, #495057); }
.aqi-value.hazardous { background: linear-gradient(135deg, #495057, #212529); }

.aqi-info .aqi-category {
    font-size: 1.1rem;
    font-weight: 600;
    color: white;
    display: block;
    margin-bottom: 0.25rem;
}

.aqi-info .aqi-description {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.7);
    margin: 0;
}

.favorite-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.favorite-btn:hover {
    color: #e74c3c;
    background: rgba(231, 76, 60, 0.1);
    transform: scale(1.1);
}

.favorite-btn.favorited {
    color: #e74c3c;
}

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

.pollutant-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
    color: white;
}

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

.pollutant-item i {
    font-size: 1.2rem;
    color: #ffd700;
    width: 20px;
    text-align: center;
}

.pollutant-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.pollutant-label {
    font-size: 0.8rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.8);
    text-transform: uppercase;
}

.pollutant-value {
    font-size: 0.9rem;
    font-weight: 600;
    color: white;
}

/* Sun Times */
.sun-times {
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    padding: 2rem;
    margin-bottom: 2rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.sun-times h3 {
    color: white;
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.sun-times-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
}

.sun-time-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
}

.sun-icon {
    position: relative;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.sunrise-icon {
    background: linear-gradient(135deg, #ffecd2, #fcb69f);
    color: #ff6b35;
    box-shadow: 0 8px 20px rgba(255, 107, 53, 0.3);
}

.sunset-icon {
    background: linear-gradient(135deg, #2c3e50, #34495e);
    color: #f39c12;
    box-shadow: 0 8px 20px rgba(52, 73, 94, 0.3);
}

.sun-icon i {
    font-size: 1.5rem;
    z-index: 2;
}

.sun-rays {
    position: absolute;
    width: 100%;
    height: 100%;
    animation: rotate 20s linear infinite;
}

.ray {
    position: absolute;
    width: 2px;
    height: 8px;
    background: #ff6b35;
    border-radius: 1px;
    transform-origin: center;
}

.ray-1 {
    top: 5px;
    left: 50%;
    transform: translateX(-50%);
}

.ray-2 {
    top: 50%;
    right: 5px;
    transform: translateY(-50%) rotate(90deg);
}

.ray-3 {
    bottom: 5px;
    left: 50%;
    transform: translateX(-50%);
}

.ray-4 {
    top: 50%;
    left: 5px;
    transform: translateY(-50%) rotate(90deg);
}

.moon-phases {
    position: absolute;
    width: 100%;
    height: 100%;
}

.phase {
    position: absolute;
    width: 6px;
    height: 6px;
    background: #f39c12;
    border-radius: 50%;
    opacity: 0.6;
}

.phase-1 {
    top: 10px;
    right: 15px;
    animation: twinkle 2s infinite;
}

.phase-2 {
    bottom: 12px;
    left: 12px;
    animation: twinkle 2s infinite 1s;
}

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

@keyframes twinkle {
    0%, 100% { opacity: 0.3; transform: scale(0.8); }
    50% { opacity: 1; transform: scale(1.2); }
}

.sun-info {
    text-align: center;
    color: white;
}

.sun-label {
    font-size: 0.9rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.8);
    display: block;
    margin-bottom: 0.25rem;
}

.sun-time {
    font-size: 1.1rem;
    font-weight: 600;
    color: white;
}

.sun-progress {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin: 0 1rem;
}

.sun-track {
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
    position: relative;
    overflow: hidden;
}

.sun-position {
    width: 12px;
    height: 12px;
    background: linear-gradient(135deg, #ff6b35, #f39c12);
    border-radius: 50%;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    left: 45%;
    box-shadow: 0 2px 8px rgba(255, 107, 53, 0.4);
    animation: sun-pulse 2s infinite;
}

@keyframes sun-pulse {
    0%, 100% { transform: translateY(-50%) scale(1); }
    50% { transform: translateY(-50%) scale(1.2); }
}

.sun-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.7);
    font-weight: 500;
}

/* Light Theme Adjustments for AQI and Sun Times */
.light-theme .aqi-section,
.light-theme .sun-times {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(0, 0, 0, 0.1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.light-theme .aqi-section h3,
.light-theme .sun-times h3 {
    color: #333;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.light-theme .aqi-overview {
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.light-theme .aqi-info .aqi-category {
    color: #333;
}

.light-theme .aqi-info .aqi-description {
    color: rgba(0, 0, 0, 0.6);
}

.light-theme .favorite-btn {
    color: rgba(0, 0, 0, 0.6);
}

.light-theme .pollutant-item {
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(0, 0, 0, 0.1);
    color: #333;
}

.light-theme .pollutant-item:hover {
    background: rgba(255, 255, 255, 0.9);
}

.light-theme .pollutant-item i {
    color: #ff6b35;
}

.light-theme .pollutant-label {
    color: rgba(0, 0, 0, 0.7);
}

.light-theme .pollutant-value {
    color: #333;
}

.light-theme .sun-info {
    color: #333;
}

.light-theme .sun-label {
    color: rgba(0, 0, 0, 0.7);
}

.light-theme .sun-time {
    color: #333;
}

.light-theme .sun-track {
    background: rgba(0, 0, 0, 0.2);
}

.light-theme .sun-labels {
    color: rgba(0, 0, 0, 0.6);
}

/* Favorites Modal */
.favorites-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.3s ease;
}

.favorites-content {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    padding: 2rem;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
    animation: slideInDown 0.4s ease;
}

.favorites-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.favorites-header h3 {
    color: white;
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.close-btn {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    transition: all 0.3s ease;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    transform: rotate(90deg);
}

.favorites-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.no-favorites {
    text-align: center;
    padding: 3rem 1rem;
    color: rgba(255, 255, 255, 0.6);
}

.no-favorites i {
    font-size: 3rem;
    margin-bottom: 1rem;
    display: block;
    opacity: 0.5;
}

.no-favorites p {
    font-size: 1.1rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: rgba(255, 255, 255, 0.8);
}

.no-favorites span {
    font-size: 0.9rem;
    opacity: 0.7;
}

.favorite-item {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
    cursor: pointer;
}

.favorite-item:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.favorite-location {
    color: white;
    font-weight: 500;
    font-size: 1rem;
}

.favorite-actions {
    display: flex;
    gap: 0.5rem;
}

.remove-favorite {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.6);
    font-size: 1rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    transition: all 0.3s ease;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.remove-favorite:hover {
    background: rgba(220, 53, 69, 0.2);
    color: #dc3545;
}

/* Light theme adjustments for favorites modal */
.light-theme .favorites-content {
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(0, 0, 0, 0.1);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
}

.light-theme .favorites-header {
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.light-theme .favorites-header h3 {
    color: #333;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.light-theme .close-btn {
    color: rgba(0, 0, 0, 0.6);
}

.light-theme .close-btn:hover {
    background: rgba(0, 0, 0, 0.1);
    color: #333;
}

.light-theme .no-favorites {
    color: rgba(0, 0, 0, 0.6);
}

.light-theme .no-favorites p {
    color: #333;
}

.light-theme .favorite-item {
    background: rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.light-theme .favorite-item:hover {
    background: rgba(0, 0, 0, 0.1);
}

.light-theme .favorite-location {
    color: #333;
}

.light-theme .remove-favorite {
    color: rgba(0, 0, 0, 0.6);
}

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

@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-30px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Mobile adjustments for favorites modal */
@media (max-width: 768px) {
    .favorites-content {
        width: 95%;
        padding: 1.5rem;
        max-height: 85vh;
    }
    
    .favorite-item {
        padding: 1rem;
    }
    
    .favorite-location {
        font-size: 0.9rem;
    }
}

/* Hourly Forecast Styles */
.hourly-forecast {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    padding: 1.5rem;
    margin: 1rem 0;
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    position: relative;
    overflow: hidden;
}

.hourly-forecast::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 215, 0, 0.05) 0%, rgba(255, 255, 255, 0.02) 50%, transparent 70%);
    animation: float 6s ease-in-out infinite;
    z-index: -1;
}

.hourly-forecast h3 {
    color: white;
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.hourly-forecast h3::before {
    content: '🕐';
    font-size: 1.2rem;
}

.hourly-container {
    display: flex;
    gap: 1rem;
    overflow-x: auto;
    padding-bottom: 0.5rem;
    scroll-snap-type: x mandatory;
}

.hourly-container::-webkit-scrollbar {
    height: 6px;
}

.hourly-container::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

.hourly-container::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
}

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

.hourly-item {
    flex: 0 0 auto;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 15px;
    padding: 1rem;
    text-align: center;
    transition: all 0.3s ease;
    min-width: 90px;
    scroll-snap-align: center;
    backdrop-filter: blur(5px);
}

.hourly-item:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.hourly-time {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.hourly-icon {
    font-size: 1.5rem;
    margin: 0.5rem 0;
    color: #ffd700;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.hourly-temp {
    font-size: 1rem;
    font-weight: 600;
    color: white;
    margin: 0.5rem 0;
}

.hourly-precipitation {
    font-size: 0.75rem;
    color: rgba(135, 206, 250, 0.9);
    margin-top: 0.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
}

.hourly-precipitation i {
    font-size: 0.7rem;
}

/* Search Suggestions Styles */
.search-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.search-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 15px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    z-index: 200;
    max-height: 300px;
    overflow-y: auto;
    margin-top: 0.5rem;
    animation: fadeInDown 0.3s ease;
}

.search-suggestions::-webkit-scrollbar {
    width: 6px;
}

.search-suggestions::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

.search-suggestions::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 3px;
}

.search-suggestions.empty {
    display: none;
}

.suggestion-item {
    padding: 0.75rem 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #333;
}

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

.suggestion-item:hover {
    background: rgba(255, 215, 0, 0.1);
    color: #000;
    transform: translateX(4px);
}

.suggestion-item.loading {
    justify-content: center;
    color: rgba(0, 0, 0, 0.6);
    font-style: italic;
    cursor: default;
}

.suggestion-item.loading:hover {
    background: transparent;
    transform: none;
}

.suggestion-icon {
    color: rgba(0, 0, 0, 0.6);
    font-size: 0.9rem;
}

.suggestion-text {
    flex: 1;
}

.suggestion-country {
    font-size: 0.85rem;
    color: rgba(0, 0, 0, 0.5);
    font-weight: 300;
}

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

/* Light theme adjustments */
.light-theme .hourly-forecast {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(0, 0, 0, 0.1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.light-theme .hourly-forecast::before {
    background: radial-gradient(circle, rgba(255, 107, 53, 0.05) 0%, rgba(255, 255, 255, 0.02) 50%, transparent 70%);
}

.light-theme .hourly-forecast h3 {
    color: #333;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.light-theme .hourly-item {
    background: rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.light-theme .hourly-item:hover {
    background: rgba(0, 0, 0, 0.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.light-theme .hourly-time {
    color: rgba(0, 0, 0, 0.7);
}

.light-theme .hourly-temp {
    color: #333;
}

.light-theme .hourly-icon {
    color: #ff6b35;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.light-theme .hourly-precipitation {
    color: rgba(30, 144, 255, 0.8);
}

.light-theme .search-suggestions {
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(0, 0, 0, 0.1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
}

.light-theme .suggestion-item {
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    color: #333;
}

.light-theme .suggestion-item:hover {
    background: rgba(255, 107, 53, 0.1);
    color: #000;
}

.light-theme .suggestion-icon {
    color: rgba(0, 0, 0, 0.6);
}

.light-theme .suggestion-country {
    color: rgba(0, 0, 0, 0.5);
}

/* Mobile responsive adjustments */
@media (max-width: 768px) {
    .search-wrapper {
        flex-direction: column;
        align-items: stretch;
    }
    
    .search-input {
        width: 100%;
        margin-bottom: 0.5rem;
    }
    
    .search-suggestions {
        position: fixed;
        top: auto;
        left: 1rem;
        right: 1rem;
        bottom: 50%;
        transform: translateY(50%);
        max-height: 50vh;
    }
    
    .hourly-container {
        gap: 0.75rem;
    }
    
    .hourly-item {
        min-width: 80px;
        padding: 0.75rem;
    }
    
    .hourly-forecast h3 {
        font-size: 1.1rem;
        margin-bottom: 0.75rem;
    }
}

@media (max-width: 480px) {
    .hourly-item {
        min-width: 70px;
        padding: 0.5rem;
    }
    
    .hourly-icon {
        font-size: 1.2rem;
    }
    
    .hourly-temp {
        font-size: 0.9rem;
    }
    
    .hourly-time {
        font-size: 0.75rem;
    }
    
    .hourly-precipitation {
        font-size: 0.7rem;
    }
}

/* Smooth theme transition */
* {
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}
