/* ==========================================================================
   AI Brand Assistant Widget Styles (Pure Brand Representation)
   Phòng khám Răng Hàm Mặt - BS Chuyên Khoa Trịnh Công Vương
   ========================================================================== */

/* 1. Floating Action Button (FAB Launcher) */
.brand-fab-launcher {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9990;
  display: flex;
  align-items: center;
  gap: 12px;
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
  color: #ffffff;
  padding: 8px 18px 8px 10px;
  border-radius: 9999px;
  cursor: pointer;
  box-shadow: 0 10px 25px -5px rgba(2, 132, 199, 0.4), 0 8px 10px -6px rgba(2, 132, 199, 0.2);
  border: 2px solid rgba(255, 255, 255, 0.4);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  user-select: none;
}

.brand-fab-launcher:hover {
  transform: translateY(-4px) scale(1.02);
  box-shadow: 0 16px 32px -4px rgba(2, 132, 199, 0.55);
  border-color: #ffffff;
}

.brand-fab-icon-box {
  position: relative;
  width: 44px;
  height: 44px;
  background: #ffffff;
  color: #dc2626;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
  flex-shrink: 0;
}

.brand-fab-pulse {
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 2px solid #38bdf8;
  animation: fabPulseRing 2s cubic-bezier(0.24, 0, 0.38, 1) infinite;
}

@keyframes fabPulseRing {
  0% { transform: scale(0.9); opacity: 1; }
  70% { transform: scale(1.4); opacity: 0; }
  100% { transform: scale(1.4); opacity: 0; }
}

.brand-fab-text {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
}

.brand-fab-title {
  font-size: 0.96rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: #ffffff;
}

.brand-fab-sub {
  font-size: 0.74rem;
  color: #e0f2fe;
  font-weight: 500;
}

.brand-fab-badge {
  background: #10b981;
  color: #ffffff;
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 3px 8px;
  border-radius: 9999px;
  box-shadow: 0 2px 6px rgba(16, 185, 129, 0.4);
}

/* 2. Chat Window */
.brand-chat-window {
  position: fixed;
  bottom: 96px;
  right: 24px;
  width: 390px;
  max-width: calc(100vw - 32px);
  height: 580px;
  max-height: calc(100vh - 120px);
  background: #ffffff;
  border-radius: 22px;
  box-shadow: 0 25px 50px -12px rgba(15, 23, 42, 0.28), 0 0 0 1px rgba(226, 232, 240, 0.9);
  display: flex;
  flex-direction: column;
  z-index: 9995;
  overflow: hidden;
  opacity: 0;
  transform: translateY(20px) scale(0.95);
  pointer-events: none;
  transition: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.brand-chat-window.open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

/* Chat Header */
.brand-chat-header {
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
  color: #ffffff;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
}

.brand-chat-profile {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-avatar {
  position: relative;
  width: 44px;
  height: 44px;
  background: #ffffff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  color: #dc2626;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.brand-online-dot {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 12px;
  height: 12px;
  background: #10b981;
  border: 2px solid #ffffff;
  border-radius: 50%;
}

.brand-profile-meta {
  display: flex;
  flex-direction: column;
}

.brand-title {
  font-size: 1rem;
  font-weight: 800;
  line-height: 1.2;
  color: #ffffff;
}

.brand-status-text {
  font-size: 0.76rem;
  color: #e0f2fe;
}

.brand-header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.brand-icon-btn {
  background: rgba(255, 255, 255, 0.15);
  border: none;
  color: #ffffff;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1rem;
  transition: all 0.2s;
}

.brand-icon-btn:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: scale(1.05);
}

/* Chat Body */
.brand-chat-body {
  flex-grow: 1;
  overflow-y: auto;
  padding: 16px;
  background: #f8fafc;
  display: flex;
  flex-direction: column;
  gap: 14px;
  scroll-behavior: smooth;
}

.brand-msg {
  display: flex;
  gap: 10px;
  max-width: 86%;
  animation: msgFadeIn 0.3s ease-out;
}

@keyframes msgFadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.brand-msg.bot {
  align-self: flex-start;
}

.brand-msg.user {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.brand-msg-avatar {
  width: 32px;
  height: 32px;
  background: #e0f2fe;
  color: #dc2626;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  flex-shrink: 0;
  margin-top: 2px;
}

.brand-msg-bubble {
  padding: 12px 16px;
  border-radius: 18px;
  font-size: 0.92rem;
  line-height: 1.5;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
  word-break: break-word;
}

.brand-msg.bot .brand-msg-bubble {
  background: #ffffff;
  color: #1e293b;
  border: 1px solid #e2e8f0;
  border-top-left-radius: 4px;
}

.brand-msg.user .brand-msg-bubble {
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
  color: #ffffff;
  border-top-right-radius: 4px;
}

.brand-msg-bubble strong {
  color: #dc2626;
  font-weight: 700;
}
.brand-msg.user .brand-msg-bubble strong {
  color: #fef08a;
}

.brand-msg-bubble ul, .brand-msg-bubble ol {
  padding-left: 18px;
  margin: 6px 0;
}

.brand-msg-bubble li {
  margin-bottom: 4px;
}

/* Quick Suggestion Chips */
.brand-chips-container {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px 16px;
  background: #ffffff;
  border-top: 1px solid #f1f5f9;
}

.brand-chip {
  background: #f1f5f9;
  color: #0369a1;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 9999px;
  border: 1px solid #e2e8f0;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
}

.brand-chip:hover {
  background: #e0f2fe;
  border-color: #38bdf8;
  transform: translateY(-1px);
}

/* Chat Footer & Input */
.brand-chat-footer {
  padding: 12px 16px 10px;
  background: #ffffff;
  border-top: 1px solid #e2e8f0;
}

.brand-input-form {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #f8fafc;
  border: 1.5px solid #cbd5e1;
  border-radius: 24px;
  padding: 4px 6px 4px 14px;
  transition: all 0.2s;
}

.brand-input-form:focus-within {
  border-color: #0284c7;
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.15);
}

.brand-input-field {
  flex-grow: 1;
  border: none;
  background: transparent;
  outline: none;
  font-size: 0.92rem;
  resize: none;
  color: #0f172a;
  max-height: 80px;
  font-family: inherit;
  padding: 6px 0;
}

.brand-send-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
  color: #ffffff;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.95rem;
  transition: all 0.2s;
  flex-shrink: 0;
}

.brand-send-btn:hover {
  transform: scale(1.06);
  background: #dc2626;
}

.brand-footer-note {
  text-align: center;
  font-size: 0.7rem;
  color: #94a3b8;
  margin-top: 6px;
}

/* Mobile responsive */
@media (max-width: 480px) {
  .brand-chat-window {
    right: 12px;
    left: 12px;
    width: auto;
    bottom: 84px;
    height: 75vh;
  }
  .brand-fab-launcher {
    right: 16px;
    bottom: 16px;
    padding: 6px 14px 6px 8px;
  }
  .brand-fab-icon-box {
    width: 38px;
    height: 38px;
    font-size: 1.1rem;
  }
}
