* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: Arial, sans-serif;
}

body {
    background: linear-gradient(135deg, #00feba, #5b548a);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    transition: background-image 0.5s ease-in-out;
    padding: 20px;
}

.main-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
    width: 100%;
    max-width: 1400px;
    margin-top: 60px; /* Space for dark mode toggle */
}

.container {
    background: rgba(255, 255, 255, 0.8);
    padding: 2rem;
    border-radius: 1rem;
    width: 90%;
    max-width: 470px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
}

.search-box {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 2rem;
}

.search-box input {
    flex: 1;
    padding: 1rem;
    border: none;
    outline: none;
    border-radius: 2rem;
    background: #ebfffc;
    font-size: 1rem;
    margin-right: 0.5rem;
}

.search-box button {
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    border: none;
    background: #ebfffc;
    cursor: pointer;
    transition: background 0.3s ease;
}

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

.weather-box {
    text-align: center;
}

.weather-icon {
    width: 120px;
    margin: 1rem 0;
}

.temperature {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin: 1rem 0;
}

.temp {
    font-size: 3rem;
    font-weight: 500;
}

.unit-toggle {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 1rem;
    background: #ebfffc;
    cursor: pointer;
    transition: background 0.3s ease;
}

.unit-toggle:hover {
    background: #def4f0;
}

.description {
    font-size: 1.5rem;
    margin-bottom: 2rem;
}

.weather-details {
    display: flex;
    justify-content: space-between;
    padding: 1rem 0;
    border-top: 1px solid #ccc;
}

.humidity,
.wind {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.hide {
    display: none;
}

.error {
    text-align: center;
    color: red;
    margin-top: 1rem;
}


/* Add new dark mode toggle styles */

.dark-mode-toggle {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 1000;
}

#darkModeBtn {
    background: rgba(0, 0, 0, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

#darkModeBtn:hover {
    background: rgba(0, 0, 0, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
    transform: scale(1.05);
}

#darkModeBtn i {
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}


/* Dark mode class modifications */

body.dark-mode {
    background: linear-gradient(135deg, #1a1a1a, #4a4a4a);
}

.dark-mode .container {
    background: rgba(40, 40, 40, 0.8);
    color: white;
}

.dark-mode .search-box input,
.dark-mode .search-box button,
.dark-mode .unit-toggle {
    background: #3a3a3a;
    color: white;
}

.dark-mode .search-box button:hover,
.dark-mode .unit-toggle:hover {
    background: #4a4a4a;
}

.dark-mode .weather-details {
    border-top: 1px solid #555;
}

.dark-mode #darkModeBtn {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
    color: #ffd700;
}

.dark-mode #darkModeBtn:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
}

.dark-mode #darkModeBtn i {
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.4));
}


/* Add forecast container styles */
.forecast-container {
    background: rgba(255, 255, 255, 0.8);
    padding: 2rem;
    border-radius: 1rem;
    width: 90%;
    max-width: 1200px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
}

.forecast-container h3 {
    text-align: center;
    margin-bottom: 2rem;
    font-size: 1.8rem;
    color: #333;
}

.forecast-boxes {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 1rem;
    overflow-x: auto;
    padding-bottom: 1rem;
}

.forecast-card {
    background: rgba(255, 255, 255, 0.9);
    padding: 1.5rem;
    border-radius: 1rem;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

.forecast-card:hover {
    transform: translateY(-5px);
    cursor: pointer;
}

.forecast-card .date {
    font-size: 1.2rem;
    font-weight: bold;
    margin-bottom: 1rem;
    color: #333;
}

.forecast-card img {
    width: 64px;
    height: 64px;
    margin: 0.5rem 0;
}

.forecast-card .temp-max {
    font-size: 1.4rem;
    color: #ff6b6b;
    margin: 0.5rem 0;
}

.forecast-card .temp-min {
    font-size: 1.2rem;
    color: #4dabf7;
    margin-bottom: 0.5rem;
}

.forecast-card .forecast-description {
    font-size: 1rem;
    color: #666;
    text-transform: capitalize;
}

/* Dark mode modifications for forecast */
.dark-mode .forecast-container {
    background: rgba(40, 40, 40, 0.8);
}

.dark-mode .forecast-container h3 {
    color: #fff;
}

.dark-mode .forecast-card {
    background: rgba(60, 60, 60, 0.9);
    color: #fff;
}

.dark-mode .forecast-card .date {
    color: #fff;
}

.dark-mode .forecast-card .forecast-description {
    color: #ddd;
}

/* Responsive design */
@media (max-width: 1200px) {
    .forecast-boxes {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .forecast-boxes {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .main-wrapper {
        margin-top: 80px;
    }
}

@media (max-width: 480px) {
    .forecast-boxes {
        grid-template-columns: 1fr;
    }

    .container, .forecast-container {
        padding: 1rem;
    }

    .main-wrapper {
        gap: 1rem;
    }
}


/* Add margin between buttons */

#locationBtn {
    margin-right: 0.5rem;
}


/* Add loading animation styles */

.fa-spin {
    animation: fa-spin 1s infinite linear;
}

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