/*=============== GOOGLE FONTS ===============*/
@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@400;500&display=swap");

/*=============== VARIABLES CSS ===============*/
:root {
  /*========== Colors ==========*/
  /*Color mode HSL(hue, saturation, lightness)*/
  --first-color: hsl(222, 80%, 58%);
  --dark-color: hsl(222, 24%, 8%);
  --title-color: hsl(222, 8%, 8%);
  --text-color-light: hsl(222, 8%, 65%);
  --white-color: #fff;
  --body-color: hsl(222, 100%, 99%);

  /*========== Font and typography ==========*/
  /*.5rem = 8px | 1rem = 16px ...*/
  --body-font: "Poppins", sans-serif;
  --small-font-size: 0.813rem;
}

/* Responsive typography */
@media screen and (min-width: 968px) {
  :root {
    --small-font-size: 0.875rem;
  }
}

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

body {
  background-color: var(--body-color);
}

/*=============== SEARCH ===============*/
.container {
  height: 100vh;
  margin-inline: 1.5rem;
  display: grid;
  place-items: center;
}

.search {
  position: relative;
  width: 76px;
  height: 76px;
  background-color: var(--white-color);
  box-shadow: 0 4px 24px hsla(222, 68%, 12%, 0.1);
  padding: 10px;
  border-radius: 4rem;
  overflow: hidden;
  transition: width 0.5s cubic-bezier(0.9, 0, 0.3, 0.9);
}
.search__input {
  border: none;
  outline: none;
  width: calc(100% - 64px);
  height: 100%;
  border-radius: 4rem;
  padding-left: 14px;
  font-family: var(--body-font);
  font-size: var(--small-font-size);
  font-weight: 500;
  opacity: 0;
  pointer-events: none;
  transition: opacity 1.5s;
}

.search__input:-webkit-autofill {
  box-shadow: 0 0 0 100px var(--white-color) inset;
}
.search__button {
  width: 56px;
  height: 56px;
  background-color: var(--dark-color);
  border-radius: 50%;
  position: absolute;
  top: 0;
  bottom: 0;
  right: 10px;
  margin: auto;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: transform 0.6s cubic-bezier(0.9, 0, 0.3, 0.9);
}
.search__icon,
.search__close {
  color: var(--white-color);
  font-size: 1.5rem;
  position: absolute;
  transition: opacity 0.5s cubic-bezier(0.9, 0, 0.3, 0.9);
}

.search__close {
  opacity: 0;
}
/* Search animated */
.show-search {
  width: 100%;
}
.show-search .search__input {
  opacity: 1;
  pointer-events: initial;
}

.show-search .search__button {
  transform: rotate(90deg);
  z-index: 1;
}
.show-search .search__icon {
  opacity: 0;
}
.show-search .search__close {
  opacity: 1;
}

/*=============== BREAKPOINTS ===============*/
/* For medium devices */
@media screen and (min-width: 576px) {
  .show-search {
    width: 450px;
  }
}
