/*
 * 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.
 */


/* ========================================
   Community Chatter Speech Bubbles
   ======================================== */

.speech-bubble {
  position: relative;
  background: white;
  padding: 16px 20px;
  border-radius: 18px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  color: #1f2937;
  max-width: 80%;
  word-wrap: break-word;
}

/* Left bubble (questions from left side) */
.speech-bubble-left {
  background: #f3f4f6;
  margin-right: auto;
}

.speech-bubble-left::before {
  content: '';
  position: absolute;
  left: -8px;
  top: 20px;
  width: 0;
  height: 0;
  border-top: 8px solid transparent;
  border-bottom: 8px solid transparent;
  border-right: 8px solid #f3f4f6;
}

/* Right bubble (questions from right side) */
.speech-bubble-right {
  background: #DCEDC8;
  margin-left: auto;
}

.speech-bubble-right::before {
  content: '';
  position: absolute;
  right: -8px;
  top: 20px;
  width: 0;
  height: 0;
  border-top: 8px solid transparent;
  border-bottom: 8px solid transparent;
  border-left: 8px solid #DCEDC8;
}

/* Typing indicator */
.typing-indicator {
  opacity: 0;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 12px 16px;
  background: #f3f4f6;
  border-radius: 18px;
  max-width: 60px;
}

.typing-indicator.typing-right {
  background: #DCEDC8;
}

.typing-indicator span {
  width: 8px;
  height: 8px;
  background: #9ca3af;
  border-radius: 50%;
  animation: typingBounce 1.4s infinite;
}

.typing-indicator span:nth-child(2) {
  animation-delay: 0.2s;
}

.typing-indicator span:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes typingBounce {
  0%, 60%, 100% {
    transform: translateY(0);
  }
  30% {
    transform: translateY(-10px);
  }
}

/* Chat message container with typing then bubble */
.chat-message {
  position: relative;
  min-height: 44px;
}

.chat-message .typing-indicator {
  position: absolute;
  opacity: 0;
  visibility: hidden;
}

.animate .chat-message-1 .typing-indicator {
  animation: showTyping 0.3s ease-out 0s forwards, hideTyping 0.3s ease-out 0.9s forwards;
  left: 0;
}

.animate .chat-message-2 .typing-indicator {
  animation: showTyping 0.3s ease-out 1.5s forwards, hideTyping 0.3s ease-out 2.4s forwards;
  right: 0;
}

.animate .chat-message-3 .typing-indicator {
  animation: showTyping 0.3s ease-out 3s forwards, hideTyping 0.3s ease-out 3.9s forwards;
  left: 0;
}

.animate .chat-message-4 .typing-indicator {
  animation: showTyping 0.3s ease-out 4.5s forwards, hideTyping 0.3s ease-out 5.4s forwards;
  right: 0;
}

.animate .chat-message-5 .typing-indicator {
  animation: showTyping 0.3s ease-out 6s forwards, hideTyping 0.3s ease-out 6.9s forwards;
  left: 0;
}

.animate .chat-message-6 .typing-indicator {
  animation: showTyping 0.3s ease-out 7.5s forwards, hideTyping 0.3s ease-out 8.4s forwards;
  right: 0;
}

/* Speech bubbles appear after typing */
.chat-message .speech-bubble {
  opacity: 0;
  transform: scale(0.8);
}

.animate .chat-message-1 .speech-bubble {
  animation: bubbleAppear 0.4s ease-out 1s forwards;
}

.animate .chat-message-2 .speech-bubble {
  animation: bubbleAppear 0.4s ease-out 2.5s forwards;
}

.animate .chat-message-3 .speech-bubble {
  animation: bubbleAppear 0.4s ease-out 4s forwards;
}

.animate .chat-message-4 .speech-bubble {
  animation: bubbleAppear 0.4s ease-out 5.5s forwards;
}

.animate .chat-message-5 .speech-bubble {
  animation: bubbleAppear 0.4s ease-out 7s forwards;
}

.animate .chat-message-6 .speech-bubble {
  animation: bubbleAppear 0.4s ease-out 8.5s forwards;
}

@keyframes showTyping {
  from {
    opacity: 0;
    visibility: hidden;
  }
  to {
    opacity: 1;
    visibility: visible;
  }
}

@keyframes hideTyping {
  from {
    opacity: 1;
    visibility: visible;
  }
  to {
    opacity: 0;
    visibility: hidden;
  }
}

@keyframes bubbleAppear {
  from {
    opacity: 0;
    transform: scale(0.8);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

