/* ===============================
   AI CHAT TABLE STYLES
   =============================== */

.chat-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 0;
  font-size: 14px;
  background-color: #ffffff;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

/* Header */
.chat-content table thead {
  background-color: #f4f6f8;
}

.chat-content table th {
  padding: 10px 12px;
  text-align: left;
  font-weight: 600;
  color: #2c3e50;
  border-bottom: 1px solid #e0e0e0;
  white-space: nowrap;
}

/* Body cells */
.chat-content table td {
  padding: 10px 12px;
  color: #444;
  border-bottom: 1px solid #f0f0f0;
}

/* Zebra rows */
.chat-content table tbody tr:nth-child(even) {
  background-color: #fafafa;
}

/* Hover */
.chat-content table tbody tr:hover {
  background-color: #eef4ff;
}

/* Last row cleanup */
.chat-content table tbody tr:last-child td {
  border-bottom: none;
}

/* Responsive (horizontal scroll if needed) */
.chat-content .message {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.chat-content .table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  max-width: 100%;
  margin: 12px 0;
  border-radius: 8px;
}

.chat-content .table-scroll table {
  min-width: 560px;
}

.chat-sidebar-container .chat-content-wrap .chat-content {
  padding-bottom: 120px;
}

.chat-content .message-body {
  white-space: pre-wrap;
  word-break: break-word;
}

.chat-content .message-body p {
  margin: 0 0 0.5rem;
}

.chat-content .message-body p:last-child {
  margin-bottom: 0;
}

.chat-content .message-body ul,
.chat-content .message-body ol {
  margin: 0 0 0.5rem 1.25rem;
  padding: 0;
}

.chat-content .message-body pre {
  background: #eef2f7;
  padding: 10px;
  border-radius: 6px;
  overflow-x: auto;
}

/* Small screens */
@media (max-width: 768px) {
  .chat-content table {
    font-size: 13px;
  }
}

/* Mobile tweaks */
@media (max-width: 576px) {
  .chat-content .message {
    font-size: 14px;
  }

  .chat-content .message p {
    line-height: 1.4;
  }

  .chat-content .d-flex.mb-4 {
    margin-bottom: 12px;
  }

  .chat-content .avatar-sm {
    width: 32px;
    height: 32px;
  }

  .chat-content-wrap .chat-topbar {
    padding-left: 12px;
    padding-right: 12px;
  }

  .chat-input-area {
    padding: 12px;
    position: sticky;
    bottom: 0;
    background: #fff;
    z-index: 5;
  }
}

/* ===============================
   Typing Indicator (AiSac)
   =============================== */

.typing-indicator {
  display: flex;
  align-items: center;
  margin: 10px 0;
}

.typing-bubble {
  background: #f1f3f5;
  border-radius: 18px;
  padding: 8px 14px;
  display: flex;
  gap: 4px;
}

.typing-bubble span {
  width: 6px;
  height: 6px;
  background-color: #6c757d;
  border-radius: 50%;
  animation: typing 1.4s infinite ease-in-out;
}

.typing-bubble span:nth-child(1) { animation-delay: 0s; }
.typing-bubble span:nth-child(2) { animation-delay: 0.2s; }
.typing-bubble span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typing {
  0% { opacity: 0.2; }
  20% { opacity: 1; }
  100% { opacity: 0.2; }
}
