body {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0;
    min-height: 100vh;
    overflow-y: auto;
    padding: 2em 0;
    background: #222;
    font-family: 'Open Sans', sans-serif;
    background-image: url('https://source.unsplash.com/1600x900/?landscape');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    transition: background-image 0.5s ease-in-out;
    font-size: 120%;
}

.card {
  max-width: 500px;
  width: 100%;
  padding: 2em;
  background: #000000d0;
  border-radius: 30px;
  margin: 2em auto; /* ✅ center it on page */
}


.search {
    display: flex;
    align-items: center;
    justify-content: center;
}

button {
    margin: 0.2em;
    border-radius: 50%;
    border: none;
    height: 45px;
    width: 55px;
    outline: none;
    background: #7c7c7c2b;
    color: whitesmoke;
    cursor: pointer;
    transition: 0.2s ease-in-out;
}

input.searchbar {
    border: none;
    outline: none;
    padding: 0.4em 1em;
    border-radius: 24px;
    background: #7c7c7c2b;
    color: whitesmoke;
    font-family: inherit;
    font-size: 105%;
    width: calc(100% - 100px);
}

button:hover {
    background: rgba(65, 65, 65, 0.886);
    color: black;
    transform: scale(1.07);
}

h1.temp {
    margin: 0;
    margin-bottom: 0.4em;
}

.flex {
    display: flex;
    align-items: center;
}

.description {
    text-transform: capitalize;
    margin-left: 8px;
}

.weather {
    min-height: 160px;
    opacity: 1;
    transition: opacity 0.3s ease;
    position: relative;
    flex: 1;
    overflow-y: auto;
    padding-block-end: 3rem;
}

.weather.loading {
    opacity: 0.3;
    pointer-events: none;
}

.weather.loading::after {
    content: "Loading...";
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    color: var(--text-color);
    font-size: 1em;
}

.unit-btn {
    margin-left: 0.3em;
    border: none;
    border-radius: 10px;
    background: var(--input-bg);
    color: var(--text-color);
    font-size: 1em;
    cursor: pointer;
    height: 40px;
    transition: 0.2s ease-in-out;
    transform: scale(1.07);
}


.unit-btn:hover {
    background: var(--button-hover);
    color: var(--bg-color);
    transform: scale(1.07);
}


.card:hover {
    box-shadow: 5px 5px 5px #00000056;
}

.searchbar:hover {
    transform: scale(1.07);
}

.sunrise, .sunset {
    margin-top: 0.3em;
    font-size: 1rem;
}

.aqi {
    margin-top: 0.5em;
    font-size: 1rem;
    font-weight: 500;
}

.hourly-forecast {
    margin-top: auto;
    padding-top: 1em;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.hourly-container {
    display: flex;
    gap: 1em;
    overflow-x: auto;
    padding: 1em 0;
    scrollbar-width: thin;
    max-width: 100%;
}

.hourly-container::-webkit-scrollbar {
  display: none;
}
.hourly-container {
  scrollbar-width: none;       /* Firefox */
  -ms-overflow-style: none;    /* IE 10+ */
}

.hour-block {
    background: rgba(255, 255, 255, 0.1);
    padding: 1em;
    border-radius: 15px;
    text-align: center;
    min-width: 100px;
    flex: 0 0 auto;
}

.hour-block img {
    width: 40px;
    height: 40px;
}

:root {
    --bg-color: #222;
    --text-color: whitesmoke;
    --card-bg: #000000d0;
    --input-bg: #7c7c7c2b;
    --button-hover: white;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    transition: background 0.3s, color 0.3s;
}

body.light {
    --bg-color: #f0f0f0;
    --text-color: #111;
    --card-bg: #ffffffcc;
    --input-bg: #cccccc2b;
    --button-hover: black;
}

.theme-toggle {
    text-align: right;
    margin-bottom: 1em;
}

.theme-toggle button {
    font-size: 1.5em;
    background: none;
    border: none;
    color: var(--text-color);
    cursor: pointer;
    transition: transform 0.2s ease;
}

.theme-toggle button:hover {
    transform: scale(1.2);
}