* {
    padding: 0;
    margin: 0;
    text-decoration: none;

}

:root {
    --Bricolage: "Bricolage Grotesque", sans-serif;
    --DMSans: "DM Sans", sans-serif;
    --Neutral900: hsl(243, 96%, 9%);
    --Neutral800: hsl(243, 27%, 20%);
    --Neutral700: hsl(243, 23%, 24%);
    --Neutral600: hsl(243, 23%, 30%);
    --Neutral300: hsl(240, 6%, 70%);
    --Neutral200: hsl(250, 6%, 84%);
    --Neutral0: hsl(0, 0%, 100%);
    --Orange500: hsl(28, 100%, 52%);
    --Blue500: hsl(233, 67%, 56%);
    --Blue700: hsl(248, 70%, 36%);
}

body {
    background-color: var(--Neutral900);
    color: var(--Neutral0);
    display: flex;
    flex-direction: column;
    padding: 1rem;
}

.sr_only {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
}

/*Header*/
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 3rem;
}

.logo img {
    height: 30px;
}

.units {
    all: unset;
    cursor: pointer;
    font-family: var(--DMSans);
    display: flex;
    align-items: center;
    width: auto;
    gap: 6px;
    background-color: var(--Neutral700);
    padding: 0.5rem 0.75rem;
    border-radius: 5px;
}

/*section search*/
.search {
    margin-bottom: 1rem;
}

.search h1 {
    text-align: center;
    font-family: var(--Bricolage);
    font-size: 3rem;
    padding: 0 2rem;
    font-weight: 700;
    margin-bottom: 3rem;
}

.search form {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.search input {
    flex: 1;
    width: 100%;
}


.search_box {
    position: relative;
    flex: 1;
    width: 100%;

}

.search_box input {
    width: 100%;
}

.search_dropdown {
    position: absolute;
    top: 110%;
    left: 0;
    width: 100%;
    max-width: 100%;
    display: flex;
    box-sizing: border-box;
    flex-direction: column;
    gap: 1px;
    align-items: stretch;
    z-index: 1;

    background: var(--Neutral800);
    border-radius: 10px;
    padding: 0.5rem;

    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    transition: 0.15s ease;
}

.search_dropdown button {
    all: unset;

    display: block;
    width: 100%;
    box-sizing: border-box;

    padding: 10px;
    font-family: var(--DMSans);
    border-radius: 10px;

    cursor: pointer;
}

.search_dropdown button:hover {
    outline: 1px solid var(--Neutral600);
    background-color: var(--Neutral700);
    cursor: pointer;
}

.hidden {
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    pointer-events: none;
}

form input {
    height: 3rem;
    border: none;
    border-radius: 10px;
    background-color: var(--Neutral700);
    font-family: var(--DMSans);
    font-weight: 500;
    color: var(--Neutral0);
    font-size: 1.1rem;
    text-indent: 1rem;
    cursor: pointer;
}

form button {
    height: 3rem;
    border: none;
    border-radius: 10px;
    background-color: var(--Blue500);
    font-family: var(--DMSans);
    font-weight: 500;
    color: var(--Neutral0);
    font-size: 1.1rem;
    cursor: pointer;
    margin-bottom: 1rem;
    transition: 0.3s;
}

form button:hover {
    background-color: var(--Blue700);
}



/*article temp*/
.temp {
    background-image: url('../assets/images/bg-today-small.svg');
    background-repeat: no-repeat;
    background-position: center;
    background-size: cover;
    display: flex;
    flex-direction: column;
    align-items: center;
    font-family: var(--DMSans);
    padding: 2rem 0;
    border-radius: 1rem;
    margin-bottom: 1rem;
}

.temp h2 {
    font-size: 1.8rem;
    margin-bottom: 1rem;
}

.temp p {
    color: var(--Neutral200);
    margin-bottom: 1rem;
}

.temp_number {
    font-size: 5rem;
    display: flex;
    align-items: center;
    gap: 2rem;
    font-family: var(--DMSans);
}

.temp_number img {
    height: 7rem;
}

/*section temp_info*/
.temp_info {
    margin-top: 1.5rem;
}

.temp_info_grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.temp_infoCard {
    background-color: var(--Neutral800);
    padding: 1rem;
    border: 1px solid var(--Neutral600);
    border-radius: 14px;

    font-family: var(--DMSans);
    display: flex;
    flex-direction: column;
    gap: 1.3rem;
}

.temp_infoCard span {
    font-size: 1.1rem;
    color: var(--Neutral200);
}

.temp_infoCard strong {
    font-size: 1.8rem;
    font-family: var(--DMSans);
    font-weight: 300;
}

/*Section dailyForecast*/
.dailyForecast {
    margin-top: 2rem;
    font-family: var(--DMSans);
}

.dailyForecast h2 {
    font-size: 1.2rem;
    margin-bottom: 1rem;
    font-weight: 500;
}

.dailyForecast_list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.dailyForecast_list {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.dailyForecast_card {
    background-color: var(--Neutral800);
    padding: 1rem;
    border: 1px solid var(--Neutral600);
    border-radius: 14px;

    font-family: var(--DMSans);
    display: flex;
    flex-direction: column;
    gap: 1rem;
    text-align: center;
}

.dailyForecast_card img {
    height: 4rem;
}

.dailyForecast_card h3 {
    font-weight: 500;
    color: var(--Neutral200);
}

.dailyForecast_cardNumber {
    display: flex;
    justify-content: space-between;
}

.dailyForecast_cardNumber p:nth-child(2) {
    color: var(--Neutral300);
}
.placeholder {
  background: linear-gradient(
    90deg,
    rgba(255,255,255,0.05) 25%,
    rgba(255,255,255,0.15) 50%,
    rgba(255,255,255,0.05) 75%
  );
  background-size: 200% 100%;
  animation: loading 1.2s infinite;
}

@keyframes loading {
  from {
    background-position: 200% 0;
  }
  to {
    background-position: -200% 0;
  }
}

/*article hourlyForecast*/
.hourlyForecast {
    margin-top: 2rem;
    padding: 1rem;
    background-color: var(--Neutral800);
    border-radius: 14px;
}

.hourlyForecast_header {
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
}

.hourlyForecast_header h3 {
    font-family: var(--DMSans);
    font-weight: 500;
}

.hourlyForecast_header button {
    border: none;
    padding: 0.5rem 1rem;
    font-family: var(--DMSans);
    display: flex;
    gap: 0.5rem;
    align-items: center;
    background-color: var(--Neutral600);
    border-radius: 8px;
    color: var(--Neutral0);
    cursor: pointer;
}

.hourlyForecast_list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.hourlyForecast_card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 1rem;
    background-color: var(--Neutral700);
    border: 1px solid var(--Neutral600);
    border-radius: 10px;
    font-family: var(--DMSans);
    font-weight: 500;
}

.hourlyForecast_card p:nth-child(1) {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.hourlyForecast_card img {
    height: 2.5rem;
}

/*dropdown hourlyForecast*/
.dropdown_hourlyForecast {
    position: relative;
    display: inline-block;
}

.dropdown_hourlyForecast_menu {
    position: absolute;
    top: 140%;
    right: 0;

    background: var(--Neutral800);
    border: 1px solid var(--Neutral600);
    border-radius: 10px;
    padding: 0.5rem;
    width: 150px;

    display: flex;
    flex-direction: column;
    font-family: var(--DMSans);
    font-size: 0.8rem;
    gap: 0.1rem;

    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: 0.2s ease;
}

.dropdown_hourlyForecast.open .dropdown_hourlyForecast_menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown_hourlyForecast_menu button {
    all: unset;
    padding: 0.5rem;
    border-radius: 10px;
    cursor: pointer;
}
.dropdown_hourlyForecast_menu button.is_active{
    background-color: var(--Neutral700);
}

/* Dropdown_units*/

.dropdown_units {
    position: relative;
    display: inline-block;
}

.dropdown_menu_units {
    position: absolute;
    top: 120%;
    right: 0;

    background: var(--Neutral800);
    border: 1px solid var(--Neutral600);
    border-radius: 10px;
    padding: 1rem;
    width: 180px;

    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: 0.2s ease;
    z-index: 1;
}

.dropdown_units.open .dropdown_menu_units {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown_menu_units h2 {
    font-size: 1.1rem;
    font-family: var(--DMSans);
    font-weight: 500;
    margin-bottom: 1rem;

}

.dropdown_menu_units_temperature h3,
.dropdown_menu_units_windSpeed h3,
.dropdown_menu_units_precipitation h3 {
    font-size: 0.9rem;
    font-family: var(--DMSans);
    font-weight: 300;
    color: var(--Neutral300);
    padding: 0 0.4rem;
}

.dropdown_menu_units_temperature,
.dropdown_menu_units_windSpeed,
.dropdown_menu_units_precipitation {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.dropdown_menu_units_temperature,
.dropdown_menu_units_windSpeed {
    border-bottom: 1px solid var(--Neutral600);
    margin-bottom: 0.5rem;
}

.dropdown_menu_units_temperature button:nth-of-type(2),
.dropdown_menu_units_windSpeed button:nth-of-type(2) {
    margin-bottom: 0.5rem;

}

.dropdown_menu_units_temperature button,
.dropdown_menu_units_windSpeed button,
.dropdown_menu_units_precipitation button {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0.4rem;
    border: none;
    text-align: left;
    border-radius: 5px;
    background: var(--Neutral800);
    color: var(--Neutral0);
    font-family: var(--DMSans);
    font-weight: 300;
    cursor: pointer;
}

.dropdown_menu_units button.is_active,
.dropdown_menu_units_windSpeed button.is_active,
.dropdown_menu_units_precipitation button.is_active {
    background: var(--Neutral700);
}
.dropdown_menu_units button.is_active::after,
.dropdown_menu_units_windSpeed button.is_active::after,
.dropdown_menu_units_precipitation button.is_active::after {
    content: "";
    display: inline-block;

    width: 14px;
    height: 14px;

    background-image: url("../assets/images/icon-checkmark.svg");
    background-size: contain;
    background-repeat: no-repeat;
}

/*rodape*/
.attribution {
    font-size: 11px;
    text-align: center;
    padding: 1rem 0;
    font-family: var(--DMSans);
}

.attribution a {
    color: var(--Blue500);
}

/*Loader*/
.loader_dots{
  display:flex;
  gap:6px;
  justify-content:center;
}

.loader_dots span{
  width:8px;
  height:8px;
  border-radius:50%;
  background:white;
  display:block;
  animation: bounce 1.2s infinite;
}

.loader_dots span:nth-child(2){
  animation-delay:0.2s;
}

.loader_dots span:nth-child(3){
  animation-delay:0.4s;
}

@keyframes bounce{
  0%,80%,100%{
    transform:scale(0);
  }
  40%{
    transform:scale(1);
  }
}

/*Estado de loading*/
.temp{
  position: relative;
}

.temp.is_loading::after{
  content: "Loading...";
  position: absolute;
  inset: 0;

  display:flex;
  align-items:center;
  justify-content:center;

  font-family: var(--DMSans);
  font-size: 1.2rem;

  background: rgba(0,0,0,0.35);
  border-radius: 1rem;
}

/*Erro state*/
.error_state {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;

  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;

  text-align: center;

  background: var(--bg-main);
  z-index: 999;
}
.error_content{
  display:flex;
  flex-direction: column;
  align-items:center;
}
.error_state > img{
    margin-bottom: 1rem;
    height: 1.8rem;
}
.error_content h2{
    font-family: var(--DMSans);
    font-weight: 600;
    font-size: 2.3rem;
    margin-bottom: 1rem;
}
.error_content p{
    font-family: var(--DMSans);
    color: var(--Neutral300);
    margin-bottom: 1rem;
}
.error_state button{
    display: flex;
    align-items: center;
    justify-content:center;
    padding: 0.5rem 0.8rem;
    border: none;
    border-radius: 5px;
    background: var(--Neutral800);
    color: var(--Neutral0);
    font-family: var(--DMSans);
    font-weight: 300;
    cursor: pointer;
    gap: 0.5rem;
    
}
.error_state button img{
    display:block;
    height: 1rem;
}

@media (min-width: 800px) {
    .dailyForecast_list {
        display: grid;
        grid-template-columns: repeat(6, 1fr);
        gap: 1rem;
    }
}

@media (min-width: 1200px) {
    .mainContent {
        position:relative;
        display: grid;
        grid-template-columns: 2fr 1fr;
        gap: 2rem;
        align-items: start;
        max-width: 1100px;
        margin: 0 auto;
    }

    .header {
        margin: 2rem 6rem;
    }

    .dailyForecast_list {
        display: grid;
        grid-template-columns: repeat(7, 1fr);
        gap: 1rem;
    }

    .temp {
        display: flex;
        flex-direction: row;
        justify-content: space-between;
        padding: 5rem 2rem;
    }

    .hourlyForecast {
        margin-top: 0;
    }


    .search h1 {
        font-size: 4rem;
    }

    .search_dropdown button {
        width: 100%;
        display: block;
        box-sizing: border-box;
    }

    .search {
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .search form {
        display: flex;
        flex-direction: row;
        align-items: stretch;
        gap: 1rem;
        width: 100%;
        max-width: 600px;
    }

    .search_box {
        position: relative;
        flex: 1;
        min-width: 0;
    }

    form button[type="submit"] {
        width: 120px;
    }

    .temp_info_grid {
        display: grid;
        grid-template-columns: repeat(4, 1fr);
        gap: 1rem;
    }

    .dailyForecast_card {
        gap: 0.8rem;
    }
}