/*
 * This is a manifest file that'll be compiled into application.css.
 *
 * With Propshaft, assets are served efficiently without preprocessing steps. You can still include
 * application-wide styles in this file, but keep in mind that CSS precedence will follow the standard
 * cascading order, meaning styles declared later in the document or manifest will override earlier ones,
 * depending on specificity.
 *
 * Consider organizing styles into separate files for maintainability.
 */

.chat-wallpaper {
  background-color: #efe9df;
  background-image: url("/assets/chat-bg-c259a05e.jpg");
  background-position: center;
  background-repeat: repeat;
  background-size: 540px 960px;
  position: relative;
}

.chat-wallpaper::before {
  background: rgb(238 232 222 / 0.78);
  content: "";
  inset: 0;
  pointer-events: none;
  position: absolute;
  z-index: 0;
}

.chat-typing-row {
  display: flex;
  width: 100%;
}

[data-chat-message] {
  align-items: flex-start;
}

/* Composer escondido enquanto o bot "digita" (fila de reveal). visibility mantém o espaço,
   sem pulo de layout quando ele reaparece. */
.chat-composer-pending {
  visibility: hidden;
}

.chat-message-bubble {
  position: relative;
  border-radius: 7.5px;
  box-shadow: 0 1px 0.5px rgb(11 20 26 / 0.13);
  color: #111b21;
  display: inline-block;
  font-size: 14.2px;
  line-height: 19px !important;
  max-width: min(85%, 36rem);
  min-height: 0 !important;
  padding: 6px 9px 8px !important;
  overflow-wrap: break-word;
}

/* pre-wrap só no texto: preserva \n intencional das mensagens sem rendererizar a indentação
   do template ERB (newlines entre as tags) como linhas em branco. */
.chat-message-text {
  white-space: pre-wrap;
}

.chat-message-bubble--outbound {
  background: #ffffff;
  border-top-left-radius: 0;
  margin-right: auto;
}

.chat-message-bubble--inbound {
  background: #d9fdd3;
  border-top-right-radius: 0;
  margin-left: auto;
}

.chat-message-bubble strong {
  font-weight: 600;
}

/* Bolha dedicada da letra da música (template Lyrics Bubble). Mensagem do bot → lado esquerdo
   (recebida), texto italic centralizado. */
.chat-lyrics-bubble {
  position: relative;
  overflow: hidden;
  max-width: min(85%, 300px);
  margin-right: auto;
  background: #ffffff;
  border: 1px solid rgb(0 0 0 / 0.05);
  border-radius: 12px;
  border-top-left-radius: 4px;
  box-shadow: 0 1px 1.5px rgb(0 0 0 / 0.18);
  padding: 16px 18px 16px 22px;
}

/* Barra de destaque verde à esquerda (5px) — clipada pelo overflow:hidden no canto arredondado. */
.chat-lyrics-bubble::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 5px;
  background: #2ea44f;
}

.chat-lyrics-text {
  display: block;
  font-style: italic;
  font-size: 14.5px;
  line-height: 1.55;
  color: #3a3a3a;
  text-align: left;
  white-space: pre-wrap;
  overflow-wrap: break-word;
  word-break: break-word;
}

/* Bolha do player de áudio (exemplos): bolha outbound com o <audio> nativo dentro. */
.chat-audio-bubble {
  max-width: min(85%, 20rem);
  padding: 8px 10px !important;
}

.chat-audio {
  display: block;
  width: 260px;
  max-width: 100%;
  height: 40px;
}

/* Reserva espaço na última linha do texto pro horário (que é absoluto, não empurra altura). */
.chat-message-spacer {
  display: inline-block;
  width: 40px;
}

.chat-message-time {
  position: absolute;
  right: 9px;
  bottom: 6px;
  color: #667781;
  font-size: 11px;
  line-height: 15px !important;
  white-space: nowrap;
}

@media (min-width: 640px) {
  .chat-message-bubble {
    max-width: min(65%, 30rem);
  }
}

.chat-typing-bubble {
  background: #fff;
  border-radius: 0.5rem;
  border-top-left-radius: 0.25rem;
  box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
  margin-right: auto;
  padding: 0.75rem 0.875rem;
}

.chat-typing-dot {
  animation: chat-typing 1.15s infinite ease-in-out;
  background: #9aa4aa;
  border-radius: 9999px;
  display: inline-block;
  height: 0.45rem;
  margin-right: 0.22rem;
  width: 0.45rem;
}

.chat-typing-dot:nth-child(2) {
  animation-delay: 0.16s;
}

.chat-typing-dot:nth-child(3) {
  animation-delay: 0.32s;
  margin-right: 0;
}

@keyframes chat-typing {
  0%,
  60%,
  100% {
    opacity: 0.35;
    transform: translateY(0);
  }

  30% {
    opacity: 1;
    transform: translateY(-0.18rem);
  }
}
