/* ===== GLOBAL RESET & FONTS ===== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background: #f8f3e6; /* Vintage parchment */
  background-image: url("data:image/svg+xml,%3Csvg width='100' height='100' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M11 18c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm48 25c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm-43-7c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm63 31c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM34 90c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm56-76c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM12 86c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm28-65c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm23-11c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm-6 60c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm29 22c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zM32 63c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm57-13c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm-9-21c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM60 91c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM35 41c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM12 60c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2z' fill='%23d7ccc8' fill-opacity='0.2' fill-rule='evenodd'/%3E%3C/svg%3E");
  color: #3e2723; /* Deep brown */
  font-family: 'Quicksand', sans-serif;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 1rem;
  background-color: rgb(195, 179, 182);
}

/* ===== VINTAGE TEXTURE OVERLAY ===== */
.background-texture {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23bcaaa4' fill-opacity='0.08'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  pointer-events: none;
  z-index: -1;
}

/* ===== MAIN CONTAINER ===== */
.container {
  background: #fdfaf3; /* Off-white parchment */
  border: 1px solid #d7ccc8;
  border-radius: 12px;
  box-shadow:
    0 8px 20px rgba(62, 39, 35, 0.1),
    inset 0 0 0 1px rgba(215, 204, 200, 0.5);
  padding: 2rem;
  width: 100%;
  max-width: 420px;
  text-align: center;
  position: relative;
  z-index: 2;
}

.header h1 {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 700;
  font-size: 2.2rem;
  color: #5d4037;
  margin-bottom: 0.6rem;
  letter-spacing: 0.5px;
}

.header p {
  color: #6d4c41;
  margin-bottom: 1.5rem;
  font-size: 1.05rem;
  line-height: 1.5;
}

/* ===== SELECT & BUTTON ===== */
.mood-selector label {
  display: block;
  margin-bottom: 0.6rem;
  font-weight: 600;
  color: #5d4037;
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.1rem;
}

select {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid #bcaaa4;
  border-radius: 8px;
  background: #fffaf7;
  font-family: 'Quicksand', sans-serif;
  font-size: 1rem;
  color: #4e342e;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%238d6e63' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14 2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.8rem center;
  background-size: 12px;
  cursor: pointer;
}

select:focus {
  outline: none;
  border-color: #8d6e63;
  box-shadow: 0 0 0 2px rgba(141, 110, 99, 0.2);
}

.suggest-btn {
  background: linear-gradient(to right, #8d6e63, #6d4c41);
  color: #f5f5f5;
  border: none;
  border-radius: 8px;
  padding: 0.85rem 1.2rem;
  font-family: 'Quicksand', sans-serif;
  font-weight: 600;
  font-size: 1.1rem;
  cursor: pointer;
  transition: all 0.3s ease;
  width: 100%;
  margin: 1rem 0;
  box-shadow: 0 4px 8px rgba(109, 76, 65, 0.2);
}

.suggest-btn:hover {
  background: linear-gradient(to right, #6d4c41, #5d4037);
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(109, 76, 65, 0.3);
}

.suggest-btn:active {
  transform: translateY(0);
}

.suggest-btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
}

/* ===== BOOK CARD ===== */
.book-card {
  margin-top: 1.8rem;
  padding: 1.2rem;
  background: #fffdf9;
  border: 1px solid #e0d7cf;
  border-radius: 10px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  display: none;
  text-align: left;
  animation: fadeInUp 0.6s ease;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.book-image-container {
  position: relative;
  margin-bottom: 1rem;
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
}

.book-card img {
  width: 100%;
  display: block;
  border-radius: 6px;
  background: #f5f5f5;
}

.book-info h2 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.4rem;
  color: #4e342e;
  margin-bottom: 0.3rem;
}

.book-info h3 {
  font-family: 'Quicksand', sans-serif;
  font-weight: 500;
  color: #795548;
  margin-bottom: 0.8rem;
  font-size: 1.05rem;
}

.book-info p {
  color: #5d4037;
  line-height: 1.6;
  margin-bottom: 1rem;
  font-size: 0.95rem;
}

/* ===== TAGS ===== */
.book-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.tag {
  background: #e8eaf6;
  color: #5c6bc0;
  padding: 0.3rem 0.7rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  font-family: 'Quicksand', sans-serif;
}

/* ===== BUTTONS ===== */
.more-info-btn {
  display: inline-block;
  background: #d7ccc8;
  color: #5d4037;
  text-decoration: none;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  font-weight: 600;
  transition: background 0.3s;
  font-family: 'Quicksand', sans-serif;
}

.more-info-btn:hover {
  background: #bcaaa4;
  color: #fff;
}

/* ===== FOOTER ===== */
.footer {
  margin-top: 1.5rem;
  color: #8d6e63;
  font-style: italic;
  font-size: 0.95rem;
}

/* ===== SPARKLE ANIMATION (for JS) ===== */
.sparkle {
  position: absolute;
  pointer-events: none;
  z-index: 10;
  font-size: 1.2rem;
  opacity: 0;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 480px) {
  .container {
    padding: 1.5rem;
  }

  .header h1 {
    font-size: 1.8rem;
  }

  select, .suggest-btn {
    font-size: 1rem;
  }
}