* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

:root {
    --primary-color: #2196f3;
    --secondary-color: #64b5f6;
    --background-color: #f5f5f5;
    --card-background: #ffffff;
    --text-color: #333;
    --border-radius: 15px;
    --box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

body {
    background: linear-gradient(120deg, #a1c4fd 0%, #c2e9fb 100%);
    min-height: 100vh;
    color: var(--text-color);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Header Styles */
header {
    margin-bottom: 30px;
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background: var(--card-background);
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
}

.logo {
    font-size: 24px;
    font-weight: bold;
    color: var(--primary-color);
}

.search-box {
    display: flex;
    gap: 10px;
}

#search-input {
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 25px;
    width: 250px;
    font-size: 16px;
    outline: none;
    transition: all 0.3s ease;
}

#search-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(33, 150, 243, 0.1);
}

#search-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 25px;
    background: var(--primary-color);
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
}

#search-btn:hover {
    background: var(--secondary-color);
}

.units-toggle button {
    padding: 8px 15px;
    border: 1px solid var(--primary-color);
    background: transparent;
    color: var(--primary-color);
    cursor: pointer;
    transition: all 0.3s ease;
}

.units-toggle button:first-child {
    border-radius: 25px 0 0 25px;
}

.units-toggle button:last-child {
    border-radius: 0 25px 25px 0;
}

.units-toggle button.active {
    background: var(--primary-color);
    color: white;
}

/* Current Weather Card */
.weather-card {
    background: var(--card-background);
    border-radius: var(--border-radius);
    padding: 30px;
    box-shadow: var(--box-shadow);
    margin-bottom: 30px;
}

.location {
    text-align: center;
    margin-bottom: 20px;
}

.location h2 {
    font-size: 32px;
    margin-bottom: 5px;
}

.weather-info {
    display: flex;
    justify-content: space-around;
    align-items: center;
    margin-bottom: 30px;
}

.temperature {
    font-size: 48px;
    font-weight: bold;
}

.weather-icon i {
    font-size: 64px;
    color: var(--primary-color);
}

.description {
    font-size: 20px;
    text-align: center;
}

.details {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    text-align: center;
}

.detail-item {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.detail-item i {
    font-size: 24px;
    color: var(--primary-color);
}

/* Forecast Section */
.forecast {
    background: var(--card-background);
    border-radius: var(--border-radius);
    padding: 30px;
    box-shadow: var(--box-shadow);
    margin-bottom: 30px;
}

.forecast h3 {
    margin-bottom: 20px;
    text-align: center;
}

.forecast-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
}

.forecast-card {
    text-align: center;
    padding: 15px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: var(--border-radius);
    transition: transform 0.3s ease;
}

.forecast-card:hover {
    transform: translateY(-5px);
}

/* Additional Info */
.additional-info {
    background: var(--card-background);
    border-radius: var(--border-radius);
    padding: 30px;
    box-shadow: var(--box-shadow);
}

.sun-times {
    display: flex;
    justify-content: space-around;
    text-align: center;
}

.sunrise, .sunset {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.sunrise i, .sunset i {
    font-size: 32px;
    color: var(--primary-color);
}

/* Loading Screen */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid #f3f3f3;
    border-top: 5px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive Design */
@media (max-width: 768px) {
    nav {
        flex-direction: column;
        gap: 15px;
    }

    .search-box {
        width: 100%;
    }

    #search-input {
        width: 100%;
    }

    .details {
        grid-template-columns: 1fr;
    }

    .forecast-container {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 480px) {
    .forecast-container {
        grid-template-columns: 1fr;
    }

    .weather-info {
        flex-direction: column;
        gap: 20px;
    }

}
