#forecast {
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    gap: 15px; /* Consistent gap for spacing */
    transition: opacity 0.5s ease-in-out;
    max-width: 100%;
    justify-content: center;
    padding: 0; /* Consistent padding for spacing */
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body.dark-mode #forecast {
    opacity: 1.0;
}

.forecast-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 15px; /* Consistent gap for spacing */
    width: 100%;
    max-width: 100%;
    margin: 20px 0;
    padding: 0; /* Consistent padding for spacing */
    box-sizing: border-box;
    margin-bottom: 10px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.forecast-grid .day {
    flex: 1 1 calc(50% - 10px); /* Consistent two items per row on mobile */
    background-color: #ffffff;
    border: 0 solid #ddd;
    border-radius: 15px;
    padding: 15px;
    box-shadow: none;
    transition: transform 0.5s ease, background-color 0.5s ease;
    display: flex;
    flex-direction: column;
    justify-content: flex-start; /* Align content to the start */
    align-items: flex-start;
    min-height: 100px;
    margin-bottom: 15px; /* Consistent margin for spacing between items */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

@media (min-width: 768px) {
    .forecast-grid .day {
        flex: 1 1 200px;
    }
}

body.dark-mode .forecast-grid .day {
    background-color: #2c2c2c;
    border: 0 solid #555;
}

body.dark-mode .forecast-grid .day:hover {
    background-color: #444;
}

.forecast-grid .day .date,
.forecast-grid .day .icon,
.forecast-grid .day .maxt,
.forecast-grid .day .mint,
.forecast-grid .day .conditions {
    margin: 5px 0;
    font-size: 14px;
    text-align: left;
    font-weight: normal;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.forecast-grid .day .date {
    font-size: 24px; /* Converted from 2em assuming base font size of 16px */
    color: #000000;
    font-weight: bold;
    transition: color 0.5s ease;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body.dark-mode .forecast-grid .day .date {
    color: #ffffff;
}

.forecast-grid .day .maxt {
    color: #ff4545;
    font-size: 24px;
    font-weight: bold;
    transition: color 0.5s ease;
    text-align: left;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.forecast-grid .day .maxt img {
    margin-right: 10px;
    width: 24px;
    height: 24px;
    transition: transform 0.5s ease;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body.dark-mode .forecast-grid .day .maxt {
    color: #ff4545;
}

.forecast-grid .day .mint {
    color: #45ABF5;
    font-size: 24px;
    font-weight: bold;
    transition: color 0.5s ease;
    text-align: left;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.forecast-grid .day .mint img {
    margin-left: 5px;
    margin-right: 5px;
    width: 24px;
    height: 24px;
    transition: transform 0.5s ease;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body.dark-mode .forecast-grid .day .mint {
    color: #45ABF5;
}

.forecast-grid .day .conditions {
    font-family: "Inter Tight";
    font-size: 16px;
    font-weight: normal;
    transition: color 0.5s ease;
    padding: 5px 0;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body.dark-mode .forecast-grid .day .conditions {
    color: #ffffff;
}

.forecast-grid .day .icon {
    display: flex;
    align-items: center; /* Align images vertically */
    justify-content: flex-start; /* Ensure images are aligned to the start */
    margin-bottom: 5px;
    transition: transform 0.5s ease;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.forecast-grid .day .icon img {
    margin: 5px;
    width: 24px;
    height: 24px;
    max-width: 24px;
    max-height: 24px;
    transition: transform 0.5s ease;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body.dark-mode .forecast-grid .day .icon img {
    filter: brightness(0) invert(1);
}

.forecast-grid .day h1,
.forecast-grid .day h2,
.forecast-grid .day h3,
.forecast-grid .day h4,
.forecast-grid .day h5,
.forecast-grid .day h6 {
    margin: 0 0 0px 0;
    color: #000000;
    transition: color 0.5s ease;
    text-align: left;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body.dark-mode .forecast-grid .day h1,
body.dark-mode .forecast-grid .day h2,
body.dark-mode .forecast-grid .day h3,
body.dark-mode .forecast-grid .day h4,
body.dark-mode .forecast-grid .day h5,
body.dark-mode .forecast-grid .day h6 {
    color: #ffffff;
}

.forecast-grid .day h1 { font-size: 38px; font-weight: normal;} /* Converted from 2.5em */
.forecast-grid .day h2 { font-size: 35px; font-weight: normal;} /* Converted from 2.0em */
.forecast-grid .day h3 { font-size: 24px; font-weight: bold;} /* Converted from 1.5em */
.forecast-grid .day h4 { font-size: 25.4px; } /* Converted from 1.4em */
.forecast-grid .day h5 { font-size: 20.8px; } /* Converted from 1.3em */
.forecast-grid .day h6 { font-size: 18px; font-weight: bold; }

.forecast-grid .day p {
    margin: 10px 0;
    font-size: 16px;
    color: #000000;
    text-align: left;
    transition: color 0.5s ease;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body.dark-mode .forecast-grid .day p {
    color: #ffffff;
}

.forecast-grid .day .wind {
    display: flex;
    align-items: center; /* Align images vertically */
    justify-content: flex-start; /* Ensure images are aligned to the start */
    font-size: 16px;
    font-weight: normal;
    color: #000000;
    transition: color 0.5s ease;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.forecast-grid .day .wind img {
    margin-right: 5px; /* Add margin to separate image from text */
    width: 16px;
    height: 16px;
    max-width: 16px;
    max-height: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body.dark-mode .forecast-grid .day .wind {
    color: #ffffff;
}

.forecast-grid .day .precipitation {
    display: flex;
    align-items: center; /* Align images vertically */
    justify-content: flex-start; /* Ensure images are aligned to the start */
    font-size: 16px;
    font-weight: normal;
    color: #000000;
    transition: color 0.5s ease;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.forecast-grid .day .precipitation img {
    margin-right: 5px; /* Add margin to separate image from text */
    width: 16px;
    height: 16px;
    max-width: 16px;
    max-height: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body.dark-mode .forecast-grid .day .precipitation {
    color: #ffffff;
}
