/*--------------------------------------------------------------
# Chat Interface Semantic Formatting
# Styles for enhanced AI response display with Bible verses, lists, etc.
--------------------------------------------------------------*/

/* AI Message Structure */
.message-header {
  margin-bottom: 8px;
  border-bottom: 1px solid rgba(139, 69, 19, 0.1);
  padding-bottom: 4px;
}

.message-content {
  line-height: 1.6;
}

/* Bible Verse References - Clickable and Highlighted */
.bible-verse {
  background: linear-gradient(135deg, rgba(139, 69, 19, 0.1), rgba(139, 69, 19, 0.05));
  color: #8B4513;
  padding: 2px 6px;
  border-radius: 4px;
  cursor: pointer;
  font-weight: 500;
  transition: all 0.3s ease;
  border: 1px solid rgba(139, 69, 19, 0.2);
  display: inline-block;
  margin: 0 2px;
  text-decoration: none;
}

.bible-verse:hover {
  background: linear-gradient(135deg, rgba(139, 69, 19, 0.2), rgba(139, 69, 19, 0.1));
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(139, 69, 19, 0.2);
  color: #5D4037;
  text-decoration: none;
}

/* Numbered List Items with Enhanced Styling */
.list-item {
  margin: 8px 0;
  padding: 10px 14px;
  background: rgba(93, 64, 55, 0.03);
  border-left: 4px solid #8B4513;
  border-radius: 0 8px 8px 0;
  transition: all 0.3s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.list-item:hover {
  background: rgba(93, 64, 55, 0.06);
  transform: translateX(2px);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.list-number {
  font-weight: 600;
  color: #5D4037;
  display: inline-block;
  margin-bottom: 4px;
  font-size: 15px;
  margin-right: 8px;
}

.list-content {
  color: #374151;
  display: inline;
  line-height: 1.5;
}

/* Simple List Items */
.simple-list-item {
  margin: 6px 0;
  padding: 8px 12px;
  background: rgba(93, 64, 55, 0.02);
  border-radius: 6px;
  border-left: 3px solid rgba(139, 69, 19, 0.4);
  transition: all 0.2s ease;
}

.simple-list-item:hover {
  background: rgba(93, 64, 55, 0.04);
  border-left-color: #8B4513;
}

/* Enhanced Typography for AI Responses */
.ai-message .message-content {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

.ai-message .message-content p {
  margin-bottom: 12px;
  line-height: 1.6;
}

.ai-message .message-content strong {
  color: #5D4037;
  font-weight: 600;
}

/* Enhanced Bold Text Styling */
.ai-message .message-content strong:not(.list-number) {
  background: linear-gradient(135deg, rgba(139, 69, 19, 0.08), transparent);
  padding: 1px 3px;
  border-radius: 3px;
}

/* Scripture Citation Styling */
.scripture-quote {
  font-style: italic;
  color: #5D4037;
  border-left: 3px solid #8B4513;
  padding-left: 12px;
  margin: 10px 0;
  background: rgba(139, 69, 19, 0.02);
  border-radius: 0 4px 4px 0;
  padding: 8px 12px;
}

/* Enhanced Line Spacing */
.ai-message .message-content br + br {
  display: block;
  content: "";
  margin-top: 8px;
}

/*--------------------------------------------------------------
# Message Bubbles
--------------------------------------------------------------*/

/* Base message bubble styling */
.message {
  margin-bottom: 16px;
  padding: 0;
}

.user-message {
  display: flex;
  justify-content: flex-end;
  margin-left: 20%;
}

.ai-message {
  display: flex;
  justify-content: flex-start;
  margin-right: 20%;
}

/* User message bubble */
.user-message .message-bubble {
  background: linear-gradient(135deg, rgba(139, 69, 19, 0.1), rgba(139, 69, 19, 0.05));
  backdrop-filter: blur(10px);
  border: 1px solid rgba(139, 69, 19, 0.2);
  border-radius: 18px 18px 4px 18px;
  padding: 12px 16px;
  color: #5D4037;
  box-shadow: 0 2px 8px rgba(139, 69, 19, 0.1);
  max-width: 100%;
  position: relative;
}

/* AI message bubble */
.ai-message .message-bubble {
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(0, 0, 0, 0.05);
  border-radius: 18px 18px 18px 4px;
  padding: 16px 20px;
  color: #374151;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.05);
  max-width: 100%;
  position: relative;
}

/* Message headers inside bubbles */
.message-bubble .message-header {
  margin-bottom: 8px;
  border-bottom: 1px solid rgba(139, 69, 19, 0.1);
  padding-bottom: 4px;
  font-size: 14px;
  font-weight: 600;
}

.user-message .message-bubble .message-header {
  border-bottom-color: rgba(139, 69, 19, 0.2);
  color: #5D4037;
}

.ai-message .message-bubble .message-header {
  border-bottom-color: rgba(0, 0, 0, 0.1);
  color: #374151;
}

/* Content within bubbles */
.message-bubble .message-content {
  line-height: 1.6;
  font-size: 14px;
}

/* Simple messages (like errors, system messages) */
.message:not(.user-message):not(.ai-message) {
  text-align: center;
}

.message:not(.user-message):not(.ai-message) > div {
  background: rgba(239, 68, 68, 0.1);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(239, 68, 68, 0.2);
  border-radius: 12px;
  padding: 10px 16px;
  color: #dc2626;
  display: inline-block;
  max-width: 80%;
}

/*--------------------------------------------------------------
# Loading Indicator
--------------------------------------------------------------*/

.loading-message {
  display: flex;
  justify-content: flex-start;
  margin-right: 20%;
  margin-bottom: 16px;
}

.loading-bubble {
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(0, 0, 0, 0.05);
  border-radius: 18px 18px 18px 4px;
  padding: 16px 20px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.05);
  position: relative;
}

.loading-content {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #6b7280;
  font-size: 14px;
}

.loading-text {
  font-style: italic;
}

.typing-dots {
  display: flex;
  gap: 4px;
}

.typing-dot {
  width: 6px;
  height: 6px;
  background: #8B4513;
  border-radius: 50%;
  animation: typing 1.4s infinite ease-in-out;
}

.typing-dot:nth-child(1) {
  animation-delay: 0s;
}

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

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

@keyframes typing {
  0%, 60%, 100% {
    transform: translateY(0);
    opacity: 0.4;
  }
  30% {
    transform: translateY(-10px);
    opacity: 1;
  }
}

/* Responsive loading indicator */
@media (max-width: 768px) {
  .loading-message {
    margin-right: 10%;
  }
  
  .loading-bubble {
    padding: 12px 16px;
    border-radius: 16px 16px 16px 4px;
  }
  
  .typing-dot {
    width: 5px;
    height: 5px;
  }
}

/* Responsive Adjustments */
@media (max-width: 768px) {
  .user-message {
    margin-left: 10%;
  }
  
  .ai-message {
    margin-right: 10%;
  }
  
  .user-message .message-bubble,
  .ai-message .message-bubble {
    padding: 10px 14px;
    border-radius: 16px 16px 4px 16px;
  }
  
  .ai-message .message-bubble {
    border-radius: 16px 16px 16px 4px;
  }
  
  .list-item {
    margin: 10px 0;
    padding: 10px 12px;
    border-left-width: 3px;
  }
  
  .list-number {
    font-size: 14px;
    margin-bottom: 4px;
  }
  
  .list-content {
    font-size: 13px;
    padding-left: 6px;
  }
  
  .bible-verse {
    padding: 1px 4px;
    font-size: 13px;
    margin: 0 1px;
  }
  
  .simple-list-item {
    padding: 8px 10px;
    font-size: 13px;
    border-left-width: 2px;
  }

  .message-header {
    margin-bottom: 6px;
  }

  .message-content {
    line-height: 1.5;
  }
}

@media (max-width: 480px) {
  .list-item {
    padding: 8px 10px;
    margin: 8px 0;
  }
  
  .list-item:hover {
    transform: translateX(2px);
  }
  
  .bible-verse {
    padding: 1px 3px;
    font-size: 12px;
  }
} 