
:root {
    --primary-color: #3498db;
    --secondary-color: #2980b9;
    --background-color: #f9f9f9;
    --card-color: #fff;
    --text-color: #333;
    --shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    --uv-low: #a3d96a;
    --uv-moderate: #f9d423;
    --uv-high: #f39c12;
    --uv-very-high: #e74c3c;
    --uv-extreme: #8e44ad;
    --aqi-good: #2ecc71;
    --aqi-moderate: #f1c40f;
    --aqi-sensitive: #e67e22;
    --aqi-unhealthy: #e74c3c;
    --aqi-very-unhealthy: #9b59b6;
    --aqi-hazardous: #7f8c8d;
    --font-family: 'Poppins', sans-serif;
}

body {
    margin: 0;
    /* font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; */
    background-color: var(--background-color);
    color: var(--text-color);
    transition: all 0.3s ease;
    line-height: 1.6;
    font-family: var(--font-family);
}

.container {
    max-width: 1200px;
    margin: 50px auto;
    padding: 20px;
}

.weather-app {
    background-color: var(--card-color);
    /* border-radius: 15px; */
    box-shadow: var(--shadow);
    overflow: hidden;
    /* transition: transform 0.3s ease, box-shadow 0.3s ease; */
}

/* .weather-app:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
} */

.search-box {
    padding: 20px;
    background: linear-gradient(to right, var(--primary-color), var(--secondary-color));
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
}

.search-box input {
    flex-grow: 1;
    padding: 12px 15px;
    border: none;
    border-radius: 25px;
    font-size: 16px;
    margin-right: 10px;
    outline: none;
}

.search-box button {
    background-color: #fff;
    color: var(--primary-color);
    border: none;
    border-radius: 25px;
    padding: 0 20px;
    height: 44px;
    cursor: pointer;
    font-weight: bold;
    transition: background-color 0.3s ease;
}

.search-box button:hover {
    background-color: #f1f1f1;
}

.favorite-btn {
    background: none;
    border: none;
    color: #fff;
    font-size: 24px;
    cursor: pointer;
    margin-left: 10px;
    transition: transform 0.2s ease;
}

.favorite-btn:hover {
    transform: scale(1.2);
}

.favorite-btn.active {
    color: #f1c40f;
}

.search-controls {
    display: flex;
    align-items: center;
    width: 100%;
}

.weather-info {
    padding: 30px;
}

.current-weather {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 30px;
}

@media (max-width: 768px) {
    .current-weather {
        grid-template-columns: 1fr;
    }
}

.city-info {
    text-align: center;
}

.city-name {
    font-size: 28px;
    font-weight: bold;
    margin-bottom: 5px;
}

.date {
    color: #777;
    margin-bottom: 20px;
}

.weather-icon {
    margin: 20px 0;
    position: relative;
    height: 120px;
}

.weather-icon img {
    height: 100px;
    width: auto;
    animation: bounce 2s infinite ease-in-out;
}

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

.temperature {
    font-size: 48px;
    font-weight: bold;
    margin: 20px 0;
    display: flex;
    justify-content: center;
    align-items: flex-start;
}

.unit-toggle {
    font-size: 16px;
    margin-left: 10px;
    cursor: pointer;
    color: var(--primary-color);
    background: none;
    border: none;
    padding: 5px;
    border-radius: 5px;
}

.unit-toggle:hover {
    background-color: rgba(0,0,0,0.05);
}

.description {
    font-size: 20px;
    text-transform: capitalize;
}

.weather-details {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.weather-detail {
    display: flex;
    align-items: center;
    padding: 15px;
    background-color: rgba(0,0,0,0.03);
    border-radius: 10px;
}

.weather-detail-icon {
    font-size: 24px;
    margin-right: 15px;
    color: var(--primary-color);
}

.weather-detail-text {
    flex-grow: 1;
}

.weather-detail-title {
    font-size: 14px;
    color: #777;
}

.weather-detail-value {
    font-size: 18px;
    font-weight: bold;
    margin-top: 5px;
}

.loading {
    text-align: center;
    padding: 50px;
    display: none;
}

.loading-spinner {
    border: 5px solid #f3f3f3;
    border-top: 5px solid var(--primary-color);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

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

.error-message {
    background-color: #ffebee;
    color: #c62828;
    padding: 15px;
    border-radius: 5px;
    margin-top: 20px;
    display: none;
}

/* Forecast styles */
.forecast-container {
    margin-top: 40px;
}

.section-title {
    font-size: 20px;
    font-weight: bold;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.hourly-forecast {
    display: flex;
    overflow-x: auto;
    gap: 15px;
    padding: 10px 0;
    margin-bottom: 30px;
}

.hourly-item {
    min-width: 80px;
    text-align: center;
    padding: 15px;
    background-color: rgba(0,0,0,0.03);
    border-radius: 10px;
}

.hourly-time {
    font-weight: bold;
    margin-bottom: 10px;
}

.hourly-temp {
    font-size: 18px;
}

.daily-forecast {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.daily-item {
    padding: 15px;
    background-color: rgba(0,0,0,0.03);
    border-radius: 10px;
    text-align: center;
}

.daily-day {
    font-weight: bold;
    margin-bottom: 10px;
}

.daily-temps {
    display: flex;
    justify-content: space-around;
    margin-top: 10px;
}

.daily-high {
    color: #e74c3c;
}

.daily-low {
    color: #3498db;
}

/* Special indicators */
.sun-progress {
    margin-top: 15px;
    height: 8px;
    background-color: #f1f1f1;
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}

.sun-progress-bar {
    height: 100%;
    background: linear-gradient(to right, #f39c12, #f1c40f);
}

.sun-times {
    display: flex;
    justify-content: space-between;
    margin-top: 5px;
    font-size: 12px;
}

.uv-index {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 4px;
    font-weight: bold;
}

.aqi-index {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 4px;
    font-weight: bold;
}

/* Map container */
.map-container {
    height: 250px;
    margin-top: 30px;
    border-radius: 10px;
    overflow: hidden;
}

/* Weather animations */
.weather-animation {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    pointer-events: none;
}

.rain {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
}

.drop {
    position: absolute;
    background: linear-gradient(0deg, rgba(255,255,255,0) 0%, #3498db 100%);
    width: 2px;
    height: 20px;
    top: -20px;
    animation: falling linear infinite;
}

@keyframes falling {
    0% { top: -20px; opacity: 0; }
    50% { opacity: 1; }
    100% { top: 100%; opacity: 0.3; }
}

.cloud {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
}

.cloud-item {
    position: absolute;
    background-color: #fff;
    border-radius: 50%;
    opacity: 0.8;
    animation: float linear infinite;
}

.snow {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
}

.snowflake {
    position: absolute;
    color: #fff;
    font-size: 12px;
    animation: snow-fall linear infinite;
}

@keyframes snow-fall {
    0% { transform: translateY(-10px) rotate(0deg); opacity: 0; }
    50% { opacity: 1; }
    100% { transform: translateY(100px) rotate(360deg); opacity: 0; }
}

.thunder {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
}

.lightning {
    position: absolute;
    width: 3px;
    background: linear-gradient(to bottom, rgba(255,255,255,0.8), rgba(255,255,255,0));
    height: 30px;
    transform: rotate(30deg);
    opacity: 0;
    animation: lightning 5s linear infinite;
}

@keyframes lightning {
    0% { opacity: 0; }
    1% { opacity: 1; }
    2% { opacity: 0; }
    8% { opacity: 0; }
    10% { opacity: 1; }
    11% { opacity: 0; }
    100% { opacity: 0; }
}

/* Theme toggle */
.theme-toggle {
    position: absolute;
    top: 20px;
    right: 20px;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-color);
    font-size: 24px;
    z-index: 100;
}

/* Favorites dropdown */
.favorites-dropdown {
    position: relative;
    display: inline-block;
    margin-left: 10px;
}

.favorites-btn {
    background: rgba(255,255,255,0.2);
    color: white;
    border: none;
    border-radius: 20px;
    padding: 8px 15px;
    cursor: pointer;
    display: flex;
    align-items: center;
}

.favorites-btn:hover {
    background: rgba(255,255,255,0.3);
}

.favorites-content {
    display: none;
    position: absolute;
    background-color: white;
    min-width: 200px;
    box-shadow: 0 8px 16px rgba(0,0,0,0.2);
    z-index: 1;
    border-radius: 10px;
    overflow: hidden;
    right: 0;
    margin-top: 5px;
}

.favorites-content.show {
    display: block;
}

.favorite-item {
    padding: 10px 15px;
    color: #333;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.favorite-item:hover {
    background-color: #f1f1f1;
}

.remove-favorite {
    color: #e74c3c;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
}

.no-favorites {
    padding: 10px 15px;
    color: #777;
    font-style: italic;
}

/* Dark theme */
body.dark-theme {
    --background-color: #121212;
    --card-color: #1e1e1e;
    --text-color: #f1f1f1;
    --shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

body.dark-theme .weather-detail,
body.dark-theme .hourly-item,
body.dark-theme .daily-item {
    background-color: rgba(255,255,255,0.05);
}

body.dark-theme .sun-progress {
    background-color: rgba(255,255,255,0.1);
}

body.dark-theme .favorites-content {
    background-color: #2c3e50;
    color: white;
}

body.dark-theme .favorite-item {
    color: white;
}

body.dark-theme .favorite-item:hover {
    background-color: #34495e;
}

body.dark-theme .date,
body.dark-theme .weather-detail-title {
    color: #bbb;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .container {
        margin: 20px auto;
        padding: 10px;
    }
    
    .search-box {
        flex-direction: column;
        gap: 10px;
    }
    
    .search-controls {
        flex-direction: column;
        gap: 10px;
    }
    
    .favorites-dropdown {
        margin-left: 0;
        margin-top: 10px;
        width: 100%;
    }
    
    .favorites-content {
        width: 100%;
    }
}

/* Ionicon adjustments */
ion-icon {
    font-size: inherit;
    vertical-align: middle;
}