/*========IMPORT FONT========*/
@import url("https://fonts.googleapis.com/css2?family=Montserrat+Alternates:wght@100;400;600;700&display=swap");
@import url("https://fonts.googleapis.com/css2?family=Montserrat:wght@100..900&display=swap");

/*========CSS GENERAL========*/

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

html {
  scroll-behavior: smooth;
}

header {
  font-family: var(--body-font);
  font-size: var(--normal-font-size);
  color: var(--whiteColor);
  background: var(--firstGradient);
}

body {
  font-family: var(--body-font);
  font-size: var(--normal-font-size);
  background: var(----backgroundColor);
  color: var(--blackColor);
  height: 100vh;
}

ul {
  list-style: none;
}

a {
  text-decoration: none;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

input,
button,
textarea {
  border: none;
  outline: none;
}

/*========ROOT========*/

:root {
  --header-height: 4rem;

  /*========COULEUR========*/

  /* LIGHT MODE*/

  --firstColor: hsl(189, 38%, 16%);
  --secondColor: hsl(43, 100%, 50%);
  --firstGradient: radial-gradient(
    circle,
    hsl(189, 50%, 8%),
    hsl(189, 45%, 12%),
    hsl(189, 38%, 16%)
  );

  --firstColorDarken: hsl(43, 100%, 36%);
  --backgroundColor: hsl(60, 100%, 97%);
  --titleColor: hsl(255, 12%, 24%);
  --textColor: hsl(2225, 12%, 24%);
  --textColorLight: rgb(173, 174, 168);
  --blackColor: hsl(0, 0%, 0%);
  --whiteColor: hsl(0, 0%, 100%);
  --shadowImg: drop-shadow(0 12px 14px hsla(0, 0%, 0%, 0.4));
  --shadowText: 0 2px 4px var(--firstColorFDarken);
  --shadowCircle: 0 12px 214px hsla(0, 0%, 0%, 0.4);
  --shadowButton: 2px 4px 8px hsla(0, 0%, 0%, 0.3);
  --shadowCard: 0 2px 20px var(--firstColorDarken);
  --greyBorder: hsl(255, 6%, 90%);
  --blackBoarder: hsl(255, 10%, 20%);

  /*========FONT & TYPO========*/
  /*1rem = 16px*/

  --home-font: "Montserrat Alternates", system-ui;
  --body-font: "Montserrat", sans-serif;

  --biggest-font-size: 2.5rem;
  --bigger-font-size: 1.25rem;
  --big-font-size: 3rem;
  --h1-font-size: 1.5rem;
  --h2-font-size: 1.25rem;
  --h3-font-size: 1rem;
  --normal-font-size: 0.938rem;
  --small-font-size: 0.813rem;
  --smaller-font-size: 0.75rem;

  /*========== FONT WEIGHT ==========*/

  --font-light: 100;
  --font-regular: 400;
  --font-medium: 500;
  --font-semi-bold: 600;
  --font-bold: 700;

  /*==========Z INDEX ==========*/

  --z-tooltip: 10;
  --z-fixed: 100;
}

/*DARK MODE*/

/*======== Responsive typography ==========*/
@media screen and (min-width: 1152px) {
  :root {
    --biggest-font-size: 5rem;
    --bigger-font-size: 2rem;
    --h1-font-size: 4rem;
    --h2-font-size: 1.5rem;
    --h3-font-size: 1.25rem;
    --normal-font-size: 1rem;
    --small-font-size: 0.875rem;
    --smaller-font-size: 0.813rem;
  }
}

/*==========CLASSE REUTULISABLE==========*/

.container {
  max-width: 1120px;
  margin: 0 auto;
}

/*Masquer les éléments en débordement : */

main {
  overflow: hidden;
}

.grid {
  display: grid;
  gap: 1.5rem;
}

.section {
  padding-block: 2rem 1rem;
}

/*=======TOAST========*/

.toast {
  visibility: hidden;
  width: 100%;
  background-color: hsl(48, 90%, 48%);
  color: #fff;
  text-align: center;
  border-radius: 2px;
  padding: 1rem;
  position: fixed;
  z-index: 1;
  left: 0;
  top: 5rem;
  font-size: 1rem;
  transition: opacity 0.5s, visibility 0.5s;
  opacity: 0;
}

.toast.show {
  visibility: visible;
  opacity: 1;
}

.toast.success {
  background-color: hsl(122, 39%, 49%);
  color: #fff;
}

.toast.info {
  background-color: hsl(45, 100%, 51%);
  color: #000;
}

.toast.error {
  background-color: hsl(4, 90%, 58%);
  color: #fff;
}

/*==========HEADER==========*/

.header {
  position: fixed;
  width: 100%;
  top: 0;
  left: 0;
  background-color: transparent;
  z-index: var(--z-tooltip);
}

.nav {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  height: var(--header-height);
}

.nav__logo svg {
  display: inline-block;
  vertical-align: middle;
  width: 40px; /* Ajuste selon la taille que tu veux pour le SVG */
  height: auto;
  filter: drop-shadow(0 0 2px white);
  margin-inline: 0 1rem;
}

.nav__logo span {
  vertical-align: middle;
  color: var(--secondColor);
}

.nav__logo,
.nav__link {
  color: var(--whiteColor);
  font-weight: var(--font-semi-bold);
  font-size: var(--normal-font-size);
}

.nav__toggle {
  cursor: pointer;
  height: 32px;
  width: 32px;
  font-size: 1.5rem;
  color: var(--whiteColor);
  position: absolute;
  right: 1rem;
  top: 1rem;
}

.nav__close {
  cursor: pointer;
  height: 32px;
  width: 32px;
  font-size: 1.5rem;
  color: var(--whiteColor);
}

/*=====AJOUT CLASSE JS=====*/

.favorite__cities td {
  color: var(--firstColor);
  font-weight: var(--font-semi-bold);
  position: relative;
  transition: transform 0.4s;
  margin-left: .5rem;
  display: flex;
  align-items: center;
}

.favorite__cities td:hover:first-child {
  transform: translateX(0.25rem);
}

.favoriteCities__item {
  margin-bottom: 1rem;
  cursor: pointer;
  font-size: var(--h1-font-size);
  display: flex;
  align-items: center;
}

.delete__btn {
  background: var(--firstColor);
  margin-left: 0.5rem;
  cursor: pointer;
  box-shadow: var(--shadowButton);
  border-radius: 0.5rem;
  height: 1.25rem;
  width: 1.25rem;
}

.favoriteCities_default{
    color: var(--blackColor);
}

/*=====NAVBURGER=======*/

.nav__menu-active {
  right: 0;
}

/*=========Navigation pour mobile==========*/

@media screen and (max-width: 2000px) {
  .nav__menu {
    position: fixed;
    top: 0;
    right: -100%; /*-100%*/
    background-color: hsla(0, 0%, 100%, 0.1);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    width: 60%;
    height: 100%;
    padding: 5rem 3.5rem 0;
    transition: 0.4s right;
    z-index: var(--z-fixed);
  }
}
.nav__list {
  display: flex;
  flex-direction: column;
  row-gap: 3rem;
}

.nav__close {
  position: absolute;
  top: 0.8rem;
  right: 1.6rem;
}

/*=====NAVBURGER ACTIVE=======*/

.nav__menu-active {
  right: 0;
}

/*=====HOME=======*/

.home__container {
  margin-inline: 32px 32px;
  gap: 0.5rem;
}

.home__form {
  grid-template-columns: 1fr 30px;
  margin: 2rem 2rem 0 2rem;
}

.home__search-btn {
  display: flex;
  justify-content: center;
  color: var(--whiteColor);
  background: var(--firstGradient);
  box-shadow: var(--shadowButton);
  padding: 0.5rem;
  border-radius: 0.5rem;
}

.home__input {
  padding: 0.5rem;
  border-radius: 0.5rem;
  display: flex;
  width: 100%;
  background: var(--secondColor);
  box-shadow: var(--shadowButton);
  margin-right: 1rem;
}

input::placeholder {
  color: var(--firstColor);
  font-weight: var(--normal-font-size);
}

.home__data {
  grid-template-columns: 250px 100px;
  gap: 0.5rem;
}

.home__data #date {
  color: var(--blackColor);
  margin-top: 0.5rem;
  text-align: start;
}

button i {
  color: var(--secondColor);
}

.home__data-content {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
}

.home__temp-feel-container {
  display: flex;
  align-items: center;
  font-size: 2rem;
}

.home__title-content {
  display: flex;
  align-items: center;
}

.home__description {
  color: var(--blackColor);
  font-weight: var(--font-medium);
  margin-top: 0.5rem;
  text-align: center;
}

.home__btn-add {
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 1.5rem;
  background-color: var(--firstColor);
  border-radius: 50%;
  color: var(--secondColor);
  box-shadow: var(--shadowButton);
  width: 15px;
  height: 15px;
}

.home__btn-add > i {
  font-size: 1rem;
}

.home__title {
  margin-right: 0.5rem;
  font-weight: var(--font-semi-bold);
  font-size: var(--big-font-size);
  box-shadow: var(--shadowText);
}

.home__img {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  
}

.home__info {
  margin-top: 2rem;
}

.weather__list {
  grid-template-columns: repeat(2, 130px);
  row-gap: 0.2rem;
  justify-content: center;
  background: none;
}

.weather__item {
  font-size: var(--normal-font-size);
  color: var(--firstColor);
}

.weather__item:nth-child(even) {
  text-align: end;
}
.weather__item:nth-child(odd) {
  text-align: start;
}

.weather__icon {
  width: 100px;
}

/*=====DATA=======*/

.data__title {
  color: var(--secondColor);
  background: var(--firstGradient);
  padding: 0.5rem 1.5rem;
}

.data i {
  color: var(--secondColor);
  font-size: 2rem;
}

.data__item {
  display: flex;
  align-items: center;
  padding: 0.5rem 0.5rem;
}

.data__item-title {
  font-size: var(--smaller-font-size);
  text-align: center;
  margin-bottom: 0.5rem;
}

.data__info {
  grid-template-columns: repeat(2, 140px);
  padding-block: 3rem 2rem;
  gap: 1rem;
  justify-content: center;
}

.data__item-content {
  display: inline-flex;
}

.data__item {
  display: inline-flex;
  background: var(--firstColor);
  color: var(--whiteColor);
  border-radius: 0.5rem;
}

.data__item-info {
  display: grid;
  justify-items: center;
  padding-left: 1rem;
  padding: 1rem 0 1rem 1rem;
}

.data__sunrise-value,
.data__sunset-value {
  font-size: var(--small-font-size);
}

.data__item:first-child {
  border-right: 2px outset rgba(128, 128, 128, 0.183);
  border-bottom: 2px outset rgba(128, 128, 128, 0.183);
  border-left: none;
  border-top: none;
  box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.3);
}

.data__item:nth-child(2) {
  border-right: none;
  border-bottom: 2px outset rgba(128, 128, 128, 0.183);
  border-left: 2px outset rgba(128, 128, 128, 0.183);
  border-top: none;
  box-shadow: -2px 2px 5px rgba(0, 0, 0, 0.3);
}

.data__item:nth-child(3) {
  border-right: 2px outset rgba(128, 128, 128, 0.183);
  border-bottom: none;
  border-left: none;
  border-top: 2px outset rgba(128, 128, 128, 0.183);
  box-shadow: 2px -2px 5px rgba(0, 0, 0, 0.3);
}

.data__item:last-child {
  border-right: none;
  border-bottom: none;
  border-left: 2px outset rgba(128, 128, 128, 0.183);
  border-top: 2px outset rgba(128, 128, 128, 0.183);
  box-shadow: -2px -2px 5px rgba(0, 0, 0, 0.3);
}

/*=====FOOTER=======*/

footer {
  background: var(--firstGradient);
  padding-block: 0.5rem;
}

.footer__copy {
  text-align: center;
}

.footer__copy a {
  color: var(--whiteColor);
  font-size: 0.5rem;
}

/*BREAKPOINT*/

@media screen and (min-width: 400px) {
  .weather__list {
    grid-template-columns: repeat(2, 1fr);
  }

  .data__info {
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: repeat(2, 1fr);
    margin-inline: 1rem 1rem;
  }
}

@media screen and (min-width: 768px) {
  .home__form {
    grid-template-columns: 350px 35px;
  }

  .home__data {
    grid-template-columns: initial;
    align-self:flex-start;
  }

  .weather__item:nth-child(even) {
    text-align: start;
    
  }

  .weather__list{
    grid-template-columns: auto auto;
    column-gap: 6rem;
  }

  .data__item {
    justify-content: center;
    text-align: left;
  }

  .data__item-title {
    margin-inline: 2rem;
    font-size: var(--h2-font-size);
  }

  .data__item-content {
    font-size: var(--h2-font-size);
  }

  .data__sunrise-value,
  .data__sunset-value {
    font-size: initial;
  }
}

@media screen and (min-width: 1150px) {
  main {
    grid-template-columns: 600px 475px;
    margin-inline: auto;
  }

  .main__container {
    margin-top: 1rem;
  }

  .home__container {
    margin-inline: 2rem 1rem;
  }

  .home__data {
    grid-template-columns: 300px 250px;
  }

  .home__title {
    font-size: 45px;
  }

  .home__info {
    display: flex;
    flex-direction: column;
  }

  .weather__list {
    justify-items: center;
    margin-bottom: 2rem;
  }

  .favoriteCities__item {
    font-size: var(--h2-font-size);
  }

  .data__title {
    border-radius: 0.5rem;
    text-align: center;
  }

  .data__info {
    grid-template-columns: repeat(2, 200px);
    grid-template-rows: repeat(2, 1fr);
    margin-inline: 1rem 1rem;
  }

  .data__item-title {
    font-size: var(--smaller-font-size);
    text-align: center;
    margin-bottom: 0.2rem;
  }

  .data__item-content {
    display: inline-flex;
  }

  .data__item {
    display: inline-flex;
    color: var(--whiteColor);
  }

  .data__item-info {
    display: grid;
    justify-items: center;
    padding-left: 1rem;
    padding: 1rem 0 1rem 1rem;
  }

  .footer__copy a {
    color: var(--whiteColor);
    font-size: 0.75rem;
  }

  footer {
    position: absolute;
    bottom: 0;
    width: 100vw;
  }
}
