@import url("https://fonts.googleapis.com/css2?family=Nata+Sans:wght@100..900&family=Oswald:wght@200..700&family=Poppins:ital,wght@0,400;0,800;1,400;1,700&family=Road+Rage&family=Roboto:ital,wght@0,100..900;1,100..900&display=swap");

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

body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
  background: #0a0a0a;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  position: relative;
  overflow: hidden;
}

body::before {
  content: "";
  position: fixed;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(
      circle at 30% 40%,
      rgba(0, 153, 255, 0.3) 0%,
      transparent 50%
    ),
    radial-gradient(
      circle at 70% 60%,
      rgba(0, 47, 255, 0.2) 0%,
      transparent 50%
    );
  animation: float 20s ease-in-out infinite;
  z-index: -1;
}

/* @keyframes float {
  0%,
  100% {
    transform: rotate(0deg) scale(1);
  }
  50% {
    transform: rotate(180deg) scale(1.1);
  }
} */

.sun-light {
  position: fixed;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    120deg,
    rgba(255, 255, 200, 0) 0%,
    rgba(255, 255, 200, 0.027) 50%,
    rgba(255, 255, 200, 0) 100%
  );
  pointer-events: none;
  z-index: -1;
  animation: sunlight-pass 20s linear infinite;
}

@keyframes sunlight-pass {
  0% {
    left: -100%;
  }
  100% {
    left: 100%;
  }
}

.rain-drop {
  position: absolute;
  width: 1px;
  height: 10px;
  background-color: rgba(255, 255, 255, 0.966);
  opacity: 0.7; /* Gotas translúcidas */
  animation: rain-fall 2s linear infinite; /* Animação de queda */
  margin: 0;
  top: 0;
  z-index: -2;
}

@keyframes rain-fall {
  0% {
    transform: translateY(0);
  }
  100% {
    transform: translateY(100vh); /* Cai até o fim da tela */
  }
}

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  background: rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 30px;
  padding: 50px;
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

h1 {
  text-align: center;
  color: #ffffff;
  margin-bottom: 40px;
  font-size: 3rem;
  font-family: "Nata Sans", sans-serif;
  font-optical-sizing: auto;
  font-weight: 600;
  font-style: normal;
  letter-spacing: -2px;
  background: linear-gradient(to right, #ffffff, #a0a0a0);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.search-box {
  margin-bottom: 10px;
  position: relative;
  display: grid;
  grid-template-columns: 300px 1fr;
}

.container-input-button {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  justify-self: flex-end;
}

.search-input {
  flex: 1;
  padding: 18px 25px;
  font-size: 16px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 15px;
  outline: none;
  color: #ffffff;
  transition: all 0.3s ease;
  font-weight: 300;
  width: 36rem;
  position: relative;
}

.formateddate {
  margin-left: 10px;
  align-self: center;
}

.search-input::placeholder {
  color: rgba(255, 255, 255, 0.4);
}

.search-input:focus {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.3);
  box-shadow: 0 0 30px rgba(120, 119, 198, 0.3);
}

.search-button {
  padding: 19px 5px;
  background: linear-gradient(90deg, #ebce2dff 0%, #c67700 100%);
  color: white;
  border: none;
  border-bottom-right-radius: 15px;
  border-top-right-radius: 15px;
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 15rem;
  height: 100%;
  position: absolute;
  right: 0;
  gap: 5px;
}

.search-button::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.3);
  transition: left 0.3s ease;
}

.search-button:hover::before {
  left: 100%;
}

.search-button:hover {
  transform: translateX(5px);
  box-shadow: 0 10px 30px rgba(120, 119, 198, 0.4);
}

#forecast-descr {
  color: #fff;
  font-family: "Nata Sans", sans-serif;
  font-optical-sizing: auto;
  font-weight: 400;
  font-style: normal;
}

.loading {
  font-size: 16px;
  font-family: "Nata Sans", sans-serif;
  font-weight: 00;
  color: #fff;
  display: flex;
}
.loading span {
  animation-name: blink;
  animation-duration: 1.4s;
  animation-iteration-count: infinite;
  animation-fill-mode: both;
  color: #ebce2dff;
}
.loading span:nth-child(1) {
  animation-delay: 0s;
}
.loading span:nth-child(2) {
  animation-delay: 0.2s;
}
.loading span:nth-child(3) {
  animation-delay: 0.4s;
}
@keyframes blink {
  0%,
  80%,
  100% {
    opacity: 0;
  }
  40% {
    opacity: 1;
  }
}

#cityName {
  color: #fff;
  font-size: 2rem;
  font-family: "Nata Sans", sans-serif;
  font-optical-sizing: auto;
  font-weight: 300;
  font-style: normal;
}

.error-message {
  color: #ff6b6b;
  text-align: center;
  margin-bottom: 20px;
  font-weight: 400;
  background: rgba(255, 107, 107, 0.1);
  padding: 15px;
  border-radius: 10px;
  border: 1px solid rgba(255, 107, 107, 0.2);
}

.weather-card {
  background: rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: white;
  padding: 40px;
  border-radius: 25px;
  margin-bottom: 40px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
  animation: slideUp 0.6s ease-out;
  position: relative;
  overflow: hidden;
}

#weatherIcon {
  animation: pulse 2s infinite ease-in-out;
  z-index: -1;
}

@keyframes pulse {
  0%,
  100% {
    box-shadow: 0 0 30px 10px rgba(255, 221, 0, 0.5);
  }
  50% {
    box-shadow: 0 0 60px 25px rgba(255, 221, 0, 0.8);
  }
}

.weather-card::before {
  content: "";
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(
    circle at center,
    rgba(120, 119, 198, 0.1) 0%,
    transparent 70%
  );
  animation: pulse 4s ease-in-out infinite;
}

@keyframes pulse {
  0%,
  100% {
    transform: scale(1);
    opacity: 0.5;
  }
  50% {
    transform: scale(1.1);
    opacity: 0.8;
  }
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.weather-card h2 {
  text-align: center;
  font-size: 2.2rem;
  margin-bottom: 30px;
  font-weight: 300;
  letter-spacing: -1px;
  position: relative;
  z-index: 1;
}

.weather-main {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  justify-content: center;
  gap: 30px;
  margin-bottom: 30px;
  position: relative;
  z-index: 1;
}

.weather-main img {
  width: 200px;
  height: 200px;
  filter: drop-shadow(0 0 20px rgba(255, 255, 255, 0.3));
}

.temperature {
  font-size: 5rem;
  font-weight: 200;
  line-height: 1;
  background: linear-gradient(to bottom, #ffffff, #d0d0d0);
  color: #fff;
  -webkit-background-clip: text;
  -webkit-text-fill-color: white;
}

.temperature-container {
  display: flex;
  margin-top: 20px;
  position: relative;
  align-items: center;
}

#temperature::after {
  content: "°C";
  font-size: 2rem;
  font-weight: 200;
  position: absolute;
}

.description {
  text-align: center;
  font-size: 1rem;
  text-transform: capitalize;
  margin-bottom: 40px;
  color: rgba(255, 255, 255, 0.8);
  font-weight: 300;
  position: relative;
  z-index: 1;
  font-family: "Nata Sans", sans-serif;
  font-optical-sizing: auto;
  font-weight: 400;
  font-style: normal;
}

.weather-details {
  display: grid;
  grid-template-columns: 220px 220px;
  justify-content: center;
  align-items: center;
  gap: 0px;
  position: relative;
  z-index: 1;
}

.detail-container {
  margin-top: 20px;
}

.icon-container {
  display: flex;
  justify-items: flex-end;
  align-self: flex-end;
}

.detail {
  text-align: center;
  width: 300px;
  display: flex;
  gap: 10px;
  line-height: 1rem;
}

/* .detail:hover {
  background: rgba(255, 255, 255, 0.08);
  transform: translateY(-3px);
  padding: 0 5px;
} */

.detail .label {
  display: block;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.6);
  margin-bottom: 8px;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.detail span:last-child {
  font-size: 1rem;
  font-weight: 300;
}

.forecast {
  animation: slideUp 0.6s ease-out 0.2s both;
}

.forecast h3 {
  color: #ffffff;
  margin-bottom: 25px;
  font-size: 1.8rem;
  font-weight: 300;
  letter-spacing: -1px;
}

.forecast-cards {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
}

.forecast-card {
  /* background: rgba(255, 255, 255, 0.03); */
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  padding: 25px;
  text-align: center;
  transition: all 0.3s ease;
  cursor: pointer;
}

.forecast-card:hover {
  transform: translateY(-5px) scale(1.02);
  background: rgba(255, 255, 255, 0.06);
  box-shadow: 0 15px 35px rgba(120, 119, 198, 0.2);
}

.forecast-date {
  font-weight: 500;
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: 15px;
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.forecast-card img {
  width: 70px;
  height: 70px;
  margin: 5px 0;
  filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.2));
}

.forecast-temp {
  font-size: 1.8rem;
  font-weight: 300;
  color: #ffffff;
  margin-bottom: 8px;
}

.forecast-temp-min {
  font-size: 0.95rem;
  color: rgba(255, 255, 255, 0.6);
  font-weight: 400;
}

.forecast-description {
  font-size: 13px;
  font-family: "Nata Sans", sans-serif;
  font-optical-sizing: auto;
  font-weight: 400;
  font-style: normal;
  margin: 0 0 10px 0;
}

.hidden {
  display: none;
}

.forecast-card {
  opacity: 0;
  animation: pulseIn 0.6s ease-out forwards;
}

.forecast-card:nth-child(1) {
  animation-delay: 0.5s;
}
.forecast-card:nth-child(2) {
  animation-delay: 1s;
}
.forecast-card:nth-child(3) {
  animation-delay: 1.5s;
}
.forecast-card:nth-child(4) {
  animation-delay: 2s;
}
.forecast-card:nth-child(5) {
  animation-delay: 2.5s;
}

@keyframes pulseIn {
  0% {
    transform: scale(0.5);
    opacity: 0;
  }
  60% {
    transform: scale(1.1);
    opacity: 1;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

@media (max-width: 390px) {
  .container {
    padding: 30px 20px;
  }

  h1 {
    font-size: 2.2rem;
  }

  #forecast h3 {
    font-size: 1.2rem;
  }

  .search-box {
    display: flex;
    position: relative;
  }

  .container-input-button {
    display: grid;
    grid-template-columns: 1fr;
    margin: 5px 0;
  }

  .search-button {
    height: auto;
    right: 0;
    width: auto;
    font-size: 13px;
    position: absolute;
    padding: 21px;
  }

  .search-input {
    width: auto;
  }

  .search-input::placeholder {
    font-size: 11px;
    font-family: "Franklin Gothic Medium", "Arial Narrow", Arial, sans-serif;
    font-weight: 400;
  }

  .weather-main {
    display: flex;
  }

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

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

  .weather-main img {
    margin: 0 auto;
  }

  #weatherIcon img {
    top: 50px;
  }

  .weather-details {
    display: flex;
    flex-direction: column;
  }

  .icon-container {
    display: flex;
    justify-items: center;
    align-self: center;
  }
}

@media (max-width: 768px) {
  .container {
    padding: 30px 20px;
  }

  h1 {
    font-size: 2.2rem;
  }

  .search-box {
    flex-direction: column;
  }

  .weather-main {
    flex-direction: column;
    gap: 20px;
  }

  .temperature {
    font-size: 4rem;
  }

  .forecast-cards {
    display: flex;
    overflow-x: auto;
    gap: 15px;
    padding-bottom: 10px;
  }

  .forecast-card {
    flex: 0 0 120px;
  }
}

@media (max-width: 844px) {
  .container {
    padding: 30px 20px;
  }

  h1 {
    font-size: 2.2rem;
  }

  .search-box {
    flex-direction: column;
  }

  .search-button {
    height: auto;
    right: 0;
    width: auto;
    font-size: 13px;
    position: absolute;
    padding: 21px;
  }

  .search-input {
    width: auto;
  }

  .weather-main {
    flex-direction: column;
    gap: 20px;
  }

  .temperature {
    font-size: 4rem;
  }

  .forecast-cards {
    display: flex;
    overflow-x: auto;
    gap: 15px;
    padding-bottom: 10px;
  }

  .forecast-card {
    flex: 0 0 120px;
  }
}
