@import url("https://fonts.googleapis.com/css2?family=Rubik:ital,wght@0,300..900;1,300..900&display=swap");

* {
  padding: 0;
  margin: 0;
  box-sizing: border-box;
  list-style: none;
  font-family: "Rubik", sans-serif;
}

:root {
  --font-color-main: #332464;
  --white-color: #fff;
  --fairy-gradient: linear-gradient(135deg, #e0c3fc 0%, #8ec5fc 100%);
  --glass-bg: rgba(255, 255, 255, 0.25);
  --glass-border: rgba(255, 255, 255, 0.3);
}

body {
  background: var(--fairy-gradient);
  min-height: 100vh;
}

/* main screen wrapper */
#screen {
  background: rgba(255, 255, 255, 0.4);
  backdrop-filter: blur(12px);
  border: 2px solid var(--glass-border);
  border-radius: 20px;
  width: 100%;
  box-shadow: 0 8px 32px rgba(31, 38, 135, 0.2);
  animation: fadeIn 1s ease-in-out;
}

/* bottom nav */
nav {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  height: 70px;
  background: var(--glass-bg);
  backdrop-filter: blur(10px);
  border-top: 2px solid var(--glass-border);
}

nav ul {
  display: flex;
  gap: 2pc;
}

nav ul li a {
  color: var(--white-color);
  font-size: 18px;
  transition: 0.3s;
}

nav ul li a:hover {
  transform: scale(1.2);
  color: #ffd6ff;
  text-shadow: 0 0 10px #ffb3ff;
}

.active {
  background-color: var(--white-color);
  color: var(--font-color-main);
  border-radius: 100px;
  padding: 8px 15px;
  box-shadow: 0 0 12px rgba(255, 255, 255, 0.6);
}

/* section */
.section {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 40px;
}

.date {
  font-weight: 600;
  font-size: 22px;
  color: var(--font-color-main);
  text-shadow: 0 0 8px rgba(255, 255, 255, 0.7);
}

.button {
  font-size: 24px;
  color: var(--font-color-main);
  cursor: pointer;
  transition: 0.3s;
}

.button:hover {
  transform: rotate(20deg) scale(1.2);
  color: #ff99cc;
}

/* add-section */
.section-box {
  width: auto;
  padding: 0 60px;
  display: flex;
  justify-content: center;
}

.add-section {
  min-width: 280px;
  height: 250px;
  top: -60rem;
  border-radius: 30px;
  border: 2px solid var(--glass-border);
  position: absolute;
  transition: 0.4s ease-in;
  background: var(--glass-bg);
  backdrop-filter: blur(15px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.add-section-title {
  text-align: center;
  color: var(--white-color);
  padding-top: 30px;
  font-size: 20px;
  text-shadow: 0 0 10px #ffccff;
}

/* search bar */
.search {
  margin-top: 20px;
  width: 80%;
  height: 40px;
  margin-left: auto;
  margin-right: auto;
  border-radius: 40px;
  display: flex;
  justify-content: center;
  align-items: center;
  background: var(--white-color);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  transition: 0.3s;
}

.search:hover {
  transform: scale(1.05);
}

.search-icon i {
  font-size: 18px;
  color: var(--font-color-main);
}

.search input {
  width: 80%;
  padding: 8px;
  font-size: 15px;
  color: var(--font-color-main);
  border: none;
  outline: none;
  background: transparent;
}

.search input::placeholder {
  color: #8a6fb0;
}

/* messages */
.messages {
  color: var(--white-color);
  font-size: 15px;
  text-align: center;
  padding: 25px 0;
  font-weight: 500;
  margin-top: 10px;
}

.normal-message {
  display: block;
}

.error-message {
  display: none;
  color: #ffcccc;
  text-shadow: 0 0 8px red;
}

.added-message {
  display: none;
  color: #b3ffb3;
  text-shadow: 0 0 8px green;
}

/* city cards */
.box {
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  padding: 0 30px;
  gap: 15px;
  align-items: center;
  margin-bottom: 40px;
}

.weather-box {
  height: 180px;
  min-width: 280px;
  border-radius: 25px;
  margin-top: 10px;
  display: flex;
  justify-content: center;
  align-items: center;
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  transition: 0.3s;
}

.weather-box:hover {
  transform: translateY(-8px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

.name {
  padding-left: 30px;
  width: 200px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  color: var(--white-color);
}

.city-name {
  font-size: 22px;
  font-weight: bold;
}

.weather-temp {
  font-size: 50px;
}

.weather-icon {
  width: 180px;
  height: 150px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.weather-icon img {
  width: 100%;
}

/* responsive */
@media screen and (min-width: 430px) {
  #screen {
    max-width: 55%;
    min-width: 450px;
    margin: 40px auto;
  }
  nav {
    border-radius: 0 0 20px 20px;
  }
}

/* fade animation */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
