* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 2rem;
  color: #333;
  background: linear-gradient(
    68.4deg,
    rgb(248, 182, 204) 0.5%,
    rgb(192, 198, 230) 49%,
    rgb(225, 246, 240) 99.8%
  );
  background-size: 600% 600%;
  animation: gradientMove 10s ease infinite;
}

@keyframes gradientMove {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

.container {
  max-width: 800px;
  width: 100%;
  background-color: white;
  border-radius: 15px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  padding: 2.5rem;
  margin-bottom: 2rem;
}

.app-header {
  text-align: center;
  padding: 2rem 1rem;
  background: rgb(232, 240, 254);
  position: relative;
  font-family: "Inter", sans-serif;
  margin-bottom: 2.5rem;
  border-radius: 15px;
}

.header-icon {
  font-size: 2.5rem;
  margin-bottom: 1rem;
  animation: float 3s ease-in-out infinite;
}

@keyframes float {
  0%,
  100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-5px);
  }
}

.app-title {
  font-family: "Playfair Display", serif;
  font-size: 2.8rem;
  font-weight: 300;
  color: #a1887f;
  margin: 0;
  letter-spacing: -0.5px;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
  position: relative;
  display: inline-block;
}

.app-title::after {
  content: "";
  position: absolute;
  bottom: -8px;
  left: 10%;
  width: 80%;
  height: 2px;
  background: linear-gradient(90deg, transparent, #8d6e63, transparent);
  border-radius: 2px;
}

.app-subtitle {
  font-family: "Inter", sans-serif;
  font-size: 1.1rem;
  color: #a1887f;
  font-weight: 300;
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-top: 0.5rem;
}

.app-header::after {
  content: "•";
  color: #6d4c41;
  font-size: 1.5rem;
  letter-spacing: 10px;
  margin-top: 1rem;
  display: block;
  opacity: 0.5;
}

.search-form {
  display: flex;
  margin-bottom: 2rem;
  gap: 10px;
}

.search-input {
  flex: 1;
  padding: 15px 20px;
  border: 2px solid rgb(232, 240, 254);
  border-radius: 50px;
  font-size: 1rem;
  transition: all 0.3s ease;
}

.search-input:focus {
  outline: none;
  /* border-color: rgb(232, 240, 254); */
  box-shadow: 0 0 0 3px rgb(192, 198, 230);
}

.submit-btn {
  padding: 15px 30px;
  background: linear-gradient(
    68.4deg,
    rgb(248, 182, 204) 0.5%,
    rgb(192, 198, 230) 49%,
    rgb(225, 246, 240) 99.8%
  );
  color: white;
  border: none;
  border-radius: 50px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.submit-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(74, 111, 165, 0.3);
}

.submit-btn:active {
  transform: translateY(0);
}

.errorMessage {
  color: #ff6b6b;
  font-size: 0.9em;
}

.affirmation-section {
  margin-top: 2rem;
  padding: 2rem;
  background-color: #f9fbfd;
  border-radius: 10px;
  min-height: 300px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  border: 1px dashed #d1d9e6;
  position: relative;
}

.affirmation-section::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url("https://s3.amazonaws.com/shecodesio-production/uploads/files/000/174/325/original/download_%286%29.jpg?1759272086");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  opacity: 0.2;
  z-index: 0;
  border-radius: 16px;
}

.affirmation-section > * {
  position: relative;
  z-index: 1;
}

.affirmation-placeholder {
  color: #a0aec0;
  font-style: italic;
}

.affirmation-content {
  white-space: pre-line;
  line-height: 1.8;
  font-size: 1.1rem;
  color: #4a5568;
  width: 100%;
}

.affirmation-title {
  font-weight: bold;
  font-size: 1.2rem;
  margin-bottom: 1rem;
  color: rgb(139, 127, 163);
}

.affirmation-body {
  white-space: pre-line;
  line-height: 1.8;
  font-size: 1.1rem;
  color: #4a5568;
  width: 100%;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

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

.spinner {
  width: 50px;
  height: 50px;
  border: 5px solid #ffffff;
  border-top: 5px solid rgb(139, 127, 163);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 1rem;
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

footer {
  color: #7a7a7a;
  text-align: center;
  padding-top: 15px;
  font-size: smaller;
}

a {
  color: rgb(183, 74, 111);
  text-decoration: none;
  font-weight: 600;
  transition: color 0.3s ease;
}

a:hover {
  color: rgb(105, 85, 146);
  text-decoration: underline;
}

@media (max-width: 600px) {
  .container {
    padding: 1.5rem;
  }

  h1 {
    font-size: 2rem;
  }

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

  .submit-btn {
    margin-top: 10px;
  }

  .affirmation-title {
    font-size: 1.1rem;
  }

  .poem-body {
    font-size: 1rem;
    line-height: 1.6;
    transition-duration: 0.8s;
  }
}
