/* ------------------------------
   BASE
--------------------------------*/
body {
  margin: 0;
  font-family: "Poppins", sans-serif;
  background: #f5f5f7;
  color: #222;
  line-height: 1.7;
}

h1, h2 {
  margin: 0;
  font-weight: 700;
}

p {
  margin: 0 0 1rem;
}

/* Limitar tamanho da foto do autor */
#autor .image-frame img {
  width: 100%;
  max-width: 280px;   /* tamanho máximo da foto */
  margin: 0 auto;
  display: block;
  border-radius: 14px;
}

.eyebrow {
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 1.5px;
  color: #777;
}

/* ------------------------------
   HERO
--------------------------------*/
.hero {
  background: linear-gradient(135deg, #A7B8FF, #5A4FCF);
  padding: 5rem 1rem;
  text-align: center;
  color: white;
  border-bottom-left-radius: 40px;
  border-bottom-right-radius: 40px;
  box-shadow: 0 8px 20px rgba(0,0,0,0.15);
}

.hero-inner {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 2.5rem;
}

.sparkles {
  font-size: 2.4rem;
  animation: sparkle 2s infinite ease-in-out;
}

@keyframes sparkle {
  0%, 100% { opacity: 0.3; transform: scale(0.9); }
  50% { opacity: 1; transform: scale(1.25); }
}

/* ------------------------------
   PAGE SHELL
--------------------------------*/
.page-shell {
  max-width: 1100px;
  margin: 3rem auto;
  padding: 0 1.5rem;
}

/* ------------------------------
   CARDS
--------------------------------*/
.card {
  background: white;
  border-radius: 18px;
  padding: 2rem;
  box-shadow: 0 6px 20px rgba(0,0,0,0.08);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.card:hover {
  transform: translateY(-6px);
  box-shadow: 0 10px 28px rgba(0,0,0,0.12);
}

.image-frame {
  width: 100%;
  overflow: hidden;
  border-radius: 14px;
  margin-bottom: 1.2rem;
}

.image-frame img {
  width: 100%;
  display: block;
  transition: transform 0.4s ease;
}

.image-frame:hover img {
  transform: scale(1.05);
}

/* ------------------------------
   BOOKS GRID
--------------------------------*/
.books-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 2.5rem;
  margin-top: 2rem;
}

.featured-book {
  border: 2px solid #F7EFAE;
  position: relative;
}

.ribbon {
  position: absolute;
  top: 1px;
  right: -1px;
  background: #3506eb;
  padding: 0.2rem 1rem;
  border-radius: 8px;
  font-weight: bold;
  color: #ededf3;
  box-shadow: 10 4px 10px rgba(0,0,0,0.15);
}

#chat-messages div {
  white-space: pre-wrap;   /* permite \n e texto multilinha */
  word-wrap: break-word;   /* evita cortar palavras */
}

/* ------------------------------
   BUTTONS
--------------------------------*/
.buy-button {
  display: inline-block;
  background: #5A4FCF;
  color: white;
  padding: 0.7rem 1.2rem;
  border-radius: 10px;
  text-decoration: none;
  font-weight: 600;
  transition: background 0.25s ease, transform 0.2s ease;
}

.buy-button:hover {
  background: #4a3ec0;
  transform: translateY(-2px);
}

/* ------------------------------
   FOOTER
--------------------------------*/
.site-footer {
  text-align: center;
  padding: 2.5rem 1rem;
  background: #5A4FCF;
  color: white;
  margin-top: 4rem;
  border-top-left-radius: 30px;
  border-top-right-radius: 30px;
}

.site-footer a {
  color: #F7EFAE;
  font-weight: 600;
}

/* ------------------------------
   CHATBOT
--------------------------------*/
#chat-toggle {
  position: fixed;
  bottom: 22px;
  right: 22px;
  background: #5A4FCF;
  color: white;
  padding: 0.9rem 1.1rem;
  border-radius: 50%;
  font-size: 1.7rem;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(0,0,0,0.25);
  transition: transform 0.2s ease;
}

#chat-toggle:hover {
  transform: scale(1.1);
}

#chatbox {
  position: fixed;
  bottom: 90px;
  right: 22px;
  width: 330px;
  background: white;
  border-radius: 16px;
  box-shadow: 0 6px 25px rgba(0,0,0,0.25);
  display: none;
  flex-direction: column;
  overflow: hidden;
}

#chat-header {
  background: #5A4FCF;
  color: white;
  padding: 1rem;
  font-weight: bold;
  font-size: 1rem;
}

#chat-messages {
  padding: 1rem;
  max-height: 320px;       /* deixa crescer mais */
  overflow-y: auto;
  background: #fafafa;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

/* MENSAGENS MULTILINHA */
.bot-message,
.user-message {
  white-space: pre-wrap;    /* permite \n e texto multilinha */
  word-wrap: break-word;    /* evita cortar palavras */
  overflow-wrap: break-word;
  line-height: 1.5;
  font-size: 0.95rem;
  padding: 0.8rem 1rem;
  border-radius: 10px;
  max-width: 100%;
}

.bot-message {
  background: #ececec;
}

.user-message {
  background: #d9e0ff;
  align-self: flex-end;
}

#chat-input-area {
  display: flex;
  border-top: 1px solid #ddd;
}

#user-input {
  flex: 1;
  padding: 0.7rem;
  border: none;
  font-size: 1rem;
}

#send-btn {
  background: #5A4FCF;
  color: white;
  border: none;
  padding: 0 1.2rem;
  cursor: pointer;
  font-weight: 600;
  transition: background 0.2s ease;
}

#send-btn:hover {
  background: #4a3ec0;
}

/* ------------------------------
   RESPONSIVE
--------------------------------*/
@media (max-width: 600px) {
  .hero-inner {
    flex-direction: column;
  }

  #chatbox {
    width: 92%;
    right: 4%;
  }
}
