* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Roboto', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #fff;
    transition: all 0.5s ease, filter 0.3s ease;
    position: relative;
    overflow-x: hidden;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('https://source.unsplash.com/random/1920x1080/?weather') no-repeat center center;
    background-size: cover;
    opacity: 0.1;
    z-index: -1;
    filter: blur(2px);
}

body.ambient-mode {
    filter: brightness(0.8) saturate(1.2);
}

body.dark {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    color: #ecf0f1;
}

body.dark.sunny {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
}

body.dark.rainy {
    background: linear-gradient(135deg, #0f1419 0%, #1a252f 100%);
}

body.dark.rainy::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><text fill="rgba(255,255,255,0.05)" font-size="20">💧</text></svg>');
    animation: rain 1s linear infinite;
    pointer-events: none;
}

body.dark.cloudy {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
}

body.dark.snowy {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
}

body.dark.snowy::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><text fill="rgba(255,255,255,0.1)" font-size="20">❄️</text></svg>');
    animation: snow 2s linear infinite;
    pointer-events: none;
}

body.sunny {
    background: linear-gradient(135deg, #FFD580 0%, #FF6F61 100%);
}

body.rainy {
    background: linear-gradient(135deg, #90CAF9 0%, #2196F3 100%);
}

body.rainy::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><text fill="rgba(255,255,255,0.1)" font-size="20">💧</text></svg>');
    animation: rain 1s linear infinite;
    pointer-events: none;
}

body.cloudy {
    background: linear-gradient(135deg, #CFD8DC 0%, #90A4AE 100%);
}

body.snowy {
    background: linear-gradient(135deg, #d299c2 0%, #fef9d7 100%);
}

body.snowy::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><text fill="rgba(255,255,255,0.3)" font-size="20">❄️</text></svg>');
    animation: snow 2s linear infinite;
    pointer-events: none;
}

@keyframes rain {
    0% { transform: translateY(-100vh); }
    100% { transform: translateY(100vh); }
}

@keyframes snow {
    0% { transform: translateY(-100vh) rotate(0deg); }
    100% { transform: translateY(100vh) rotate(360deg); }
}

.container {
    text-align: center;
    max-width: 1200px;
    width: 100%;
    padding: 20px;
    position: relative;
    z-index: 1;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

h1 {
    font-size: 2.5rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.theme-toggle {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.theme-toggle:hover {
    transform: scale(1.1);
    background: rgba(255, 255, 255, 0.3);
}

.search-box {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
    gap: 10px;
    flex-wrap: wrap;
}

#city-input {
    padding: 15px;
    border: none;
    border-radius: 25px 0 0 25px;
    outline: none;
    font-size: 1rem;
    width: 250px;
    background: rgba(255, 255, 255, 0.9);
    color: #333;
    transition: all 0.3s ease;
}

#city-input:focus {
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

#search-btn, #location-btn, #voice-btn, #unit-toggle, #share-btn {
    padding: 15px 20px;
    border: none;
    background: linear-gradient(135deg, #ff6b6b, #ff5252);
    color: #fff;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s ease;
    border-radius: 0;
}

#search-btn {
    border-radius: 0 25px 25px 0;
}

#location-btn {
    border-radius: 25px;
    background: linear-gradient(135deg, #4CAF50, #45a049);
}

#voice-btn {
    border-radius: 25px;
    background: linear-gradient(135deg, #9C27B0, #7B1FA2);
}

#unit-toggle {
    border-radius: 25px;
    background: linear-gradient(135deg, #FF9800, #F57C00);
    min-width: 60px;
}

#share-btn {
    border-radius: 25px;
    background: linear-gradient(135deg, #2196F3, #1976D2);
}

#search-btn:hover, #location-btn:hover, #voice-btn:hover, #unit-toggle:hover, #share-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.date-time {
    margin-bottom: 20px;
    font-size: 1.1rem;
    opacity: 0.8;
}

.weather-info {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 30px;
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 8px 32px rgba(31, 38, 135, 0.37);
    display: none;
    margin-bottom: 30px;
}

.weather-info.show {
    display: block;
}

.fade-in {
    animation: fadeIn 0.6s ease-in-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.weather-main {
    margin-bottom: 20px;
}

.weather-icon {
    width: 120px;
    height: 120px;
    margin-bottom: 10px;
    filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.3));
}

.temperature {
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.description {
    font-size: 1.3rem;
    margin-bottom: 20px;
    text-transform: capitalize;
    font-style: italic;
}

.country-flag {
    width: 24px;
    height: 18px;
    vertical-align: middle;
    margin-right: 8px;
    border-radius: 2px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.weather-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
}

.detail {
    background: rgba(255, 255, 255, 0.2);
    padding: 20px;
    border-radius: 15px;
    text-align: center;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.detail:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

.detail i {
    font-size: 2rem;
    margin-bottom: 10px;
    display: block;
}

.detail p {
    font-size: 0.9rem;
    margin-bottom: 5px;
    opacity: 0.8;
}

.detail span {
    font-weight: 600;
    font-size: 1.1rem;
}

.forecast {
    margin-bottom: 30px;
}

.forecast-title {
    font-size: 1.5rem;
    margin-bottom: 15px;
}

.forecast-cards {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding: 10px 0;
}

.forecast-card {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    padding: 15px;
    text-align: center;
    min-width: 100px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
}

.forecast-card:hover {
    transform: scale(1.05);
}

.forecast-day {
    font-size: 0.9rem;
    margin-bottom: 5px;
}

.forecast-icon {
    font-size: 2rem;
    margin: 5px 0;
}

.forecast-temp {
    font-weight: 600;
}

.weather-quote {
    margin-bottom: 20px;
}

.quote {
    font-style: italic;
    font-size: 1.1rem;
    background: rgba(255, 255, 255, 0.1);
    padding: 15px;
    border-radius: 10px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.sun-times, .aqi {
    margin-bottom: 20px;
}

.sun-times-card, .aqi-card {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    padding: 20px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    display: inline-block;
}

.sun-times-title, .aqi-title {
    font-size: 1.2rem;
    margin-bottom: 10px;
}

.sun-times-details, .aqi-details {
    display: flex;
    gap: 20px;
    justify-content: center;
}

.sun-detail, .aqi-detail {
    text-align: center;
}

.sun-detail i, .aqi-detail i {
    font-size: 1.5rem;
    margin-bottom: 5px;
}

#chart-container, #map-container {
    margin-bottom: 20px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    padding: 20px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    display: none;
    height: 400px;
}

#temp-chart {
    max-height: 300px;
}

#alerts {
    margin-bottom: 20px;
}

.alerts-card {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    padding: 20px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.alerts-title {
    font-size: 1.2rem;
    margin-bottom: 15px;
}

.alert-item {
    background: rgba(255, 0, 0, 0.1);
    border: 1px solid rgba(255, 0, 0, 0.3);
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 10px;
}

.alert-item h4 {
    margin-bottom: 5px;
    color: #ff6b6b;
}

.alert-item p {
    margin-bottom: 5px;
}

.alert-item small {
    opacity: 0.8;
}

.offline-notice {
    background: rgba(255, 165, 0, 0.1);
    border: 1px solid rgba(255, 165, 0, 0.3);
    color: #ffa500;
    padding: 10px;
    border-radius: 5px;
    margin-top: 10px;
}

.sound-toggle {
    position: fixed;
    bottom: 20px;
    right: 20px;
}

#sound-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

#sound-btn:hover {
    transform: scale(1.1);
    background: rgba(255, 255, 255, 0.3);
}

.error {
    color: #ff6b6b;
    font-weight: 500;
    background: rgba(255, 0, 0, 0.1);
    padding: 15px;
    border-radius: 10px;
    border: 1px solid rgba(255, 0, 0, 0.3);
}

.loading {
    font-size: 1.2rem;
    animation: pulse 1.5s infinite;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.loading::before {
    content: '⏳';
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

@media (max-width: 768px) {
    .container {
        padding: 10px;
        max-width: 100%;
    }

    .header {
        flex-direction: column;
        gap: 20px;
    }

    h1 {
        font-size: 2rem;
    }

    #city-input {
        width: 200px;
    }

    .search-box {
        flex-wrap: wrap;
    }

    .weather-details {
        grid-template-columns: 1fr;
    }

    .forecast-cards {
        padding: 10px;
    }

    .forecast-card {
        min-width: 80px;
    }

    .sun-times-details, .aqi-details {
        flex-direction: column;
        gap: 10px;
    }
}
