/* Global styles */
:root {
    --primary-color: #fff;
    --secondary-color: #ffdd57;
    --background-color: rgba(0, 0, 0, 0.7);
    --button-color: #28a745;
    --button-hover-color: #218838;
    --toggle-button-color: #007bff;
    --toggle-button-hover-color: #0056b3;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Arial', sans-serif;
    color: var(--primary-color);
    display: flex;
    flex-direction: column;
    align-items: center;
    background: url('https://images.pexels.com/photos/1118873/pexels-photo-1118873.jpeg') no-repeat center center fixed;
    background-size: cover;
    transition: background 0.5s ease-in-out;
    min-height: 100vh;
    padding: 1rem;
    font-size: 16px;
    gap: 30px;
}

h1 {
    margin: 1rem 0;
    font-size: 2.5rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.7);
}

form {
    display: flex;
    width: 100%;
    justify-content: center;
    align-items: center;
}

#locationForm{
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.7rem;
}


input[type="text"] {
    padding: 0.3rem 0.5rem;
    font-size: 1rem;
    border: 2px solid #ccc;
    border-radius: 5px;
    width: 100%;
    max-width: 400px;
    background-color: rgba(255, 255, 255, 0.7);
    color: #333;
}

#loading {
    font-size: 1.2rem;
    color: var(--primary-color);
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: var(--background-color);
    padding: 0.5rem 1rem;
    border-radius: 5px;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
}

#weatherDisplay {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: var(--background-color);
    padding: 1rem;
    border-radius: 10px;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.5);
    width: 100%;
    max-width: 1200px;
    margin-bottom: 1rem;
}

.weather {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    max-width: 300px;
    text-align: center;
    margin-bottom: 1rem;
}

#weatherDetails {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
    width: 100%;
}

.weather-detail {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: var(--primary-color);
}

.weather-detail-item {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.weather-condition {
    font-size: 1.5rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
}


.weather-location {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
}

.weather-date,
.weather-time {
    font-size: 1rem;
    color: #ddd;
    margin-bottom: 0.25rem;
}

.weather-temp {
    font-size: 3rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
    color: var(--secondary-color);
}

.weather-icon {
    width: 70px;
    height: auto;
    margin-bottom: 0.5rem;
}

.icon {
    padding: 0.5rem;
    font-size: 2rem;
    color: var(--secondary-color);
    width: 30px;
}

.carousel {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
}
.carousel .prev,
.carousel .next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: var(--button-color);
    color: var(--primary-color);
    border: none;
    padding: 0.5rem 1rem;
    cursor: pointer;
    transition: background 0.3s ease;
    z-index: 1;
}

.carousel .prev:hover,
.carousel .next:hover {
    background: var(--button-hover-color);
}

.carousel .prev {
    left: 0;
}

.carousel .next {
    right: 0;
}

.forecast-container {
    display: flex;
    overflow-y: hidden;
    gap: 1rem;
    scroll-behavior: smooth;
    width: 70%;
}

#dailyForecast{
    width: 100%;
    display: flex;
    justify-content: center;
}
#dailyForecast,
#hourlyForecast {
    display: flex;
    gap: 1rem;
    padding: 0.5rem;
}

.forecast-item {
    flex: 0 0 auto;
    width: 130px;
    text-align: center;
    padding: 1rem;
    background: var(--background-color);
    border-radius: 10px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    color: var(--primary-color);
}

.forecast-item h3 {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
}

.forecast-item img {
    width: 50px;
    height: auto;
    margin-bottom: 0.5rem;
}

.changeButtons {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.changeButtons button,
.togglebutton {
    padding: 0.5rem 1rem;
    font-size: 1rem;
    color: var(--primary-color);
    background-color: var(--button-color);
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.3s ease;
}

.changeButtons button:hover {
    background-color: var(--button-hover-color);
}

.changeButtons .selected-button {
    background-color: var(--button-hover-color);
}

.togglebutton {
    background-color: var(--toggle-button-color);
}

.togglebutton:hover {
    background-color: var(--toggle-button-hover-color);
}

.day-temp {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.max-temp,
.hour-temp {
    font-size: 1.8rem;
    font-weight: bold;
    color: var(--secondary-color);
}

.min-temp {
    font-size: 1rem;
}

@media (max-width: 1200px) {
    #weatherDisplay {
        max-width: 95%;
    }
}

@media (max-width: 992px) {
    body {
        font-size: 14px;
    }

    h1 {
        font-size: 2rem;
    }

    .weather-temp {
        font-size: 2.5rem;
    }

    .forecast-item {
        width: 110px;
    }
}

@media (max-width: 768px) {
    body {
        font-size: 12px;
    }

    h1 {
        font-size: 1.8rem;
    }

    .weather-temp {
        font-size: 2rem;
    }

    .forecast-item {
        width: 100px;
    }

    .max-temp,
    .hour-temp {
        font-size: 1.5rem;
    }
}

@media (max-width: 576px) {
    body {
        padding: 0.5rem;
    }

    h1 {
        font-size: 1.5rem;
    }

    input[type="text"] {
        font-size: 0.9rem;
    }

    .weather-icon {
        width: 50px;
    }

    .forecast-item {
        width: 90px;
        padding: 0.5rem;
    }

    .forecast-item h3 {
        font-size: 1rem;
    }

    .forecast-item img {
        width: 40px;
    }

    .changeButtons button,
    .togglebutton {
        padding: 0.4rem 0.8rem;
        font-size: 0.9rem;
    }
}

@media (max-width: 424px) {
    body{
        gap: 40px;
    }

    .forecast-item {
        width: 80px;
        padding: 0.5rem;
    }

    .forecast-item h3 {
        font-size: 0.8rem;
    }

    .forecast-item img {
        width: 30px;
    }

    .changeButtons button,
    .togglebutton {
        padding: 0.3rem 0.6rem;
        font-size: 0.8rem;
    }
}