﻿/* ===============================
   COMETIQ CHATBOT STYLES
=============================== */

/* Floating Chat Button */
.chat-toggle { position: fixed !important; bottom: 25px !important; right: 25px !important; width: 65px; height: 65px; border-radius: 50%; border: 2px solid #0b0b3b; background: #ffffff; box-shadow: 0 6px 15px rgba(0, 0, 0, 0.25); display: flex; align-items: center; justify-content: center; cursor: pointer; transition: all 0.25s ease-in-out; z-index: 999999 !important; }
.chat-toggle:hover { transform: scale(1.08); box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35); }
.chat-toggle .chat-icon { width: 40px; height: 40px; object-fit: contain; pointer-events: none; }

/* Chat Popup Window */
.chat-popup { position: fixed !important; bottom: 90px !important; right: 30px !important; width: 360px !important; height: 480px !important; background: #f7f8fa; border-radius: 12px; border: 1px solid #e5e7eb; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25); display: flex; flex-direction: column; overflow: hidden; animation: slideUp 0.3s ease-out; z-index: 99999998 !important; }

@keyframes slideUp {
  from { transform: translateY(40px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* Header */
.chat-header { background: #111827; color: white; padding: 14px 16px; display: flex; justify-content: space-between; align-items: center; font-weight: 600; }
.chat-header-left { display: flex; align-items: center; gap: 10px; }
.chat-logo { width: 28px; height: 28px; border-radius: 50%; background: #ffffff; padding: 2px; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2); }
.close-btn { background: none; border: none; color: white; font-size: 26px; cursor: pointer; line-height: 1; top: 27px; right: 10px; }

/* Chat Body */
.chat-body { flex: 1; padding: 16px; overflow-y: auto; background: #f7f8fa; }
.message-row { display: flex; margin-bottom: 14px; align-items: flex-start; }

/* USER MESSAGE */
.message-content.user { display: flex; width: 100%; justify-content: flex-end; align-items: flex-start; gap: 8px; }
.message-content.user .message-block { display: flex; flex-direction: column; align-items: flex-end; }
.message-content.user .bubble { background: #111827; color: #ffffff; border-radius: 12px 12px 4px 12px; padding: 10px 14px; max-width: 80%; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08); }

/* AI MESSAGE */
.avatar { width: 32px; height: 32px; border-radius: 50%; overflow: hidden; margin-right: 8px; }
.message-block { display: flex; flex-direction: column; }
.sender-label { font-size: 12px; font-weight: 600; color: #444; margin-bottom: 3px; }

/* Common Bubble Styles */
.bubble { 
  background: #f7f8fa; color: #111; border-radius: 14px; padding: 10px 14px; max-width: 90%; font-size: 14px; box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  white-space: normal; word-break: break-word; overflow-wrap: anywhere; box-sizing: content-box; 
}
.bubble ul, .bubble ol { margin: 2px 0; padding-left: 18px; max-width: 100%; box-sizing: border-box; }
.bubble p { margin: 2px 0 !important; padding: 0; }
.bubble li { list-style-position: outside; word-break: break-word; overflow-wrap: anywhere; margin-bottom: 3px; }
.bubble br { display: block; margin-bottom: 2px; }

.choose-module { text-align: center; font-weight: 600; color: #1a2a44; cursor: pointer; margin: 10px 0; }
.choose-module:hover { text-decoration: underline; }

/* Typing Indicator */
.ai-typing { width: 40px; height: 20px; background: #f3f3f3; border-radius: 10px; position: relative; display: inline-block; }
.ai-typing::before, .ai-typing::after, .ai-typing span { content: ''; width: 6px; height: 6px; background: #666; border-radius: 50%; position: absolute; top: 7px; animation: typingDots 1.4s infinite ease-in-out; }
.ai-typing::before { left: 6px; animation-delay: 0s; }
.ai-typing span { left: 16px; animation-delay: 0.2s; }
.ai-typing::after { left: 26px; animation-delay: 0.4s; }

@keyframes typingDots {
  0%, 80%, 100% { transform: scale(0); }
  40% { transform: scale(1); }
}

/* Footer Base */
.chat-footer { padding: 10px 12px; background: #fff; border-top: 1px solid #e5e7eb; display: flex; align-items: center; gap: 10px; box-sizing: border-box; }
.chat-footer button { flex-shrink: 0; }

/* Footer Action Buttons */
.chat-footer .send-btn {
  width: 44px; height: 44px; padding: 0; border-radius: 50%; border: none; cursor: pointer; display: flex; align-items: center; justify-content: center; box-shadow: 0px 4px 12px rgba(0,0,0,0.20); background: #111827; 
}
.chat-footer .send-btn i { color: #fff !important; font-size: 18px !important; }
.icon-img { width: 22px; height: 22px; object-fit: contain; filter: brightness(0) invert(1); }

/* Footer Input Area */
.footer-state { width: 100%; display: flex; align-items: center; border-radius: 25px; background: #f9f9f9; border: 1.5px solid #e5e5e5; padding: 6px 14px; box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.05); }
.footer-idle { width: 100%; display: flex; align-items: center; gap: 12px; padding: 8px 14px; border-radius: 25px; background: #f9f9f9; border: 1.5px solid #e5e5e5; }
.footer-idle textarea { flex: 1; border: none; background: transparent; resize: none; outline: none; font-size: 14px; min-height: 20px; max-height: 80px; line-height: 1.5; }

/* Suggestion Cards */
.suggestion-area { margin-top: 14px; display: flex; flex-wrap: wrap; gap: 10px; }
.suggestion-card { flex: 1 1 calc(100% - 5px); background: #ffffff; border: 1px solid #e4e6eb; border-radius: 12px; padding: 10px 12px; font-size: 14px; text-align: center; cursor: pointer; transition: all 0.2s ease; box-shadow: 0 1px 2px rgba(0,0,0,0.05); display: block; }
.suggestion-card:hover { background: #f1f3f5; border-color: #d8dbe0; transform: translateY(-1px); }
.more-btn { flex: 1 1 100%; text-align: center; font-size: 14px; font-weight: 600; padding: 6px; cursor: pointer; color: #0b0b3b; }

/* Responsive */
@media (max-width: 480px) {
  .chat-popup { width: 100%; height: 100vh; bottom: 0; right: 0; border-radius: 0; }
  .chat-body { height: calc(100vh - 120px); }
}