/* ==========================================================================
   Custom AI Chatbot - Hotel Prabhupada Luxury Design
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,400;0,500;0,600;0,700;1,400&family=Plus+Jakarta+Sans:wght@300;400;500;600;700&display=swap');

:root {
  --cb-navy-bg: #070F1A;
  --cb-navy-card: #0C1827;
  --cb-gold-primary: #C5A059;
  --cb-gold-bright: #E8A317;
  --cb-gold-dark: #B38E46;
  --cb-crimson: #8B1E1E;
  --cb-border: rgba(197, 160, 89, 0.35);
  --cb-border-subtle: rgba(197, 160, 89, 0.22);
  --cb-text-white: #FFFFFF;
  --cb-text-muted: rgba(255, 255, 255, 0.65);
  --cb-font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --cb-font-serif: 'Cormorant Garamond', Georgia, serif;
}

#custom-ai-chatbot-root * {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: var(--cb-font-sans);
  -webkit-font-smoothing: antialiased;
}

/* ==========================================================================
   1. Floating Trigger Button
   ========================================================================== */
.cb-trigger-btn {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--cb-navy-card);
  border: 2px solid rgba(232, 163, 23, 0.85);
  box-shadow: 0 10px 25px rgba(232, 163, 23, 0.35);
  cursor: pointer;
  z-index: 999990;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s ease, border-color 0.2s ease;
  outline: none;
  padding: 0;
}

.cb-trigger-btn:hover {
  transform: scale(1.08);
  border-color: var(--cb-gold-bright);
  box-shadow: 0 12px 32px rgba(232, 163, 23, 0.55);
}

.cb-trigger-btn-inner {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  overflow: hidden;
  background: var(--cb-navy-bg);
  display: flex;
  align-items: center;
  justify-content: center;
}

.cb-trigger-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.08);
}

/* Green online indicator */
.cb-trigger-ping {
  position: absolute;
  top: -2px;
  right: -2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background-color: #10B981;
  border: 2px solid var(--cb-navy-card);
  z-index: 20;
}

.cb-trigger-ping::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: #34D399;
  opacity: 0.75;
  animation: cb-ping 1.5s cubic-bezier(0, 0, 0.2, 1) infinite;
}

@keyframes cb-ping {
  75%, 100% {
    transform: scale(2.2);
    opacity: 0;
  }
}

/* Tooltip on hover */
.cb-trigger-tooltip {
  position: absolute;
  right: calc(100% + 12px);
  padding: 6px 12px;
  background: var(--cb-navy-card);
  color: #FFFFFF;
  font-size: 12px;
  font-weight: 500;
  border-radius: 9999px;
  border: 1px solid rgba(197, 160, 89, 0.4);
  box-shadow: 0 10px 25px rgba(0,0,0,0.5);
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transform: translateX(4px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.cb-trigger-btn:hover .cb-trigger-tooltip {
  opacity: 1;
  transform: translateX(0);
}

/* Mobile backdrop */
.cb-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 999995;
}

/* ==========================================================================
   2. Chat Window Modal
   ========================================================================== */
.cb-window {
  position: fixed;
  bottom: 96px;
  right: 24px;
  width: 410px;
  height: 580px;
  max-height: calc(100vh - 120px);
  background: var(--cb-navy-bg);
  color: var(--cb-text-white);
  border: 1px solid var(--cb-border);
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.85);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 999999;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px) scale(0.96);
  transition: all 0.26s cubic-bezier(0.16, 1, 0.3, 1);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.cb-window.cb-open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

/* ==========================================================================
   3. Header
   ========================================================================== */
.cb-header {
  background: var(--cb-navy-card);
  padding: 14px 18px;
  border-bottom: 1px solid var(--cb-border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.cb-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.cb-avatar-header {
  position: relative;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--cb-gold-bright), var(--cb-crimson));
  padding: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(0,0,0,0.4);
}

.cb-avatar-header-inner {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: var(--cb-navy-card);
  overflow: hidden;
  position: relative;
}

.cb-avatar-header-inner img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cb-header-online-dot {
  position: absolute;
  bottom: 0px;
  right: 0px;
  width: 10px;
  height: 10px;
  background-color: #34D399;
  border: 2px solid var(--cb-navy-card);
  border-radius: 50%;
  z-index: 10;
}

.cb-header-title {
  font-family: var(--cb-font-serif);
  color: var(--cb-gold-bright);
  font-size: 17px;
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: 0.3px;
}

.cb-header-sub {
  color: rgba(255, 255, 255, 0.6);
  font-size: 11px;
  font-weight: 400;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 3px;
}

.cb-pulse-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: #34D399;
  animation: cb-pulse 1.8s ease-in-out infinite;
}

@keyframes cb-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.85); }
}

.cb-header-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.cb-icon-btn {
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.7);
  padding: 8px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s ease, background 0.15s ease;
}

.cb-icon-btn:hover {
  color: var(--cb-gold-bright);
  background: rgba(255, 255, 255, 0.06);
}

.cb-icon-btn.cb-close-btn:hover {
  color: #E57373;
}

.cb-icon-btn svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
}

/* ==========================================================================
   4. Messages Area (Clean Dark Canvas, No Distracting Watermarks)
   ========================================================================== */
.cb-messages {
  flex: 1;
  overflow-y: auto;
  padding: 18px 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.1) transparent;
}

.cb-messages::-webkit-scrollbar {
  width: 4px;
}

.cb-messages::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.12);
  border-radius: 4px;
}

/* ==========================================================================
   5. Message Rows & Bubbles
   ========================================================================== */
.cb-msg-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  width: 100%;
}

.cb-msg-row.cb-user {
  flex-direction: row-reverse;
}

/* Avatar Icons */
.cb-msg-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  overflow: hidden;
  position: relative;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cb-msg-row.cb-bot .cb-msg-avatar {
  background: var(--cb-navy-card);
  border: 1px solid rgba(197, 160, 89, 0.4);
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.cb-msg-row.cb-bot .cb-msg-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cb-msg-row.cb-user .cb-msg-avatar {
  background: linear-gradient(135deg, var(--cb-gold-primary), var(--cb-crimson));
  border: 1px solid rgba(232, 163, 23, 0.5);
  color: #FFFFFF;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.cb-msg-row.cb-user .cb-msg-avatar svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
}

/* Message Bubble */
.cb-msg-bubble {
  position: relative;
  max-width: 82%;
  padding: 12px 16px;
  border-radius: 18px;
  font-size: 13.5px;
  line-height: 1.6;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
  word-break: break-word;
}

/* Bot Bubble: Luxury Dark Navy with Delicate Golden Border */
.cb-msg-row.cb-bot .cb-msg-bubble {
  background: var(--cb-navy-card);
  color: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(197, 160, 89, 0.25);
  border-top-left-radius: 4px;
  font-weight: 300;
}

/* User Bubble: Warm Gold Gradient with Crisp Dark Ink Text */
.cb-msg-row.cb-user .cb-msg-bubble {
  background: linear-gradient(135deg, var(--cb-gold-primary), var(--cb-gold-dark));
  color: #070F1A;
  font-weight: 500;
  border-top-right-radius: 4px;
}

/* Typography inside bubbles */
.cb-msg-bubble p {
  margin-bottom: 6px;
}
.cb-msg-bubble p:last-child {
  margin-bottom: 0;
}
.cb-msg-bubble strong {
  font-weight: 600;
}
.cb-msg-row.cb-bot .cb-msg-bubble strong {
  color: #FFFFFF;
}
.cb-msg-row.cb-user .cb-msg-bubble strong {
  color: #000000;
  font-weight: 700;
}

/* Links inside Bot Messages */
.cb-msg-row.cb-bot .cb-msg-bubble a {
  color: var(--cb-gold-bright);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
  background: rgba(232, 163, 23, 0.1);
  padding: 2px 7px;
  border-radius: 4px;
  border: 1px solid rgba(232, 163, 23, 0.3);
  display: inline-flex;
  align-items: center;
  gap: 3px;
  margin: 3px 0;
  transition: all 0.2s ease;
}

.cb-msg-row.cb-bot .cb-msg-bubble a:hover {
  background: rgba(232, 163, 23, 0.22);
  color: #FFFFFF;
}

/* Lists */
.cb-msg-bubble ul, .cb-msg-bubble ol {
  padding-left: 20px;
  margin: 6px 0;
}
.cb-msg-bubble li {
  margin-bottom: 4px;
}

/* Footer inside Bot Bubble (Timestamp & Copy Button) */
.cb-bubble-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 8px;
  margin-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 10.5px;
  color: rgba(255, 255, 255, 0.4);
}

.cb-copy-btn {
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.4);
  font-size: 10.5px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  transition: color 0.15s ease, background 0.15s ease;
  padding: 2px 6px;
  border-radius: 4px;
}

.cb-copy-btn:hover {
  color: var(--cb-gold-bright);
  background: rgba(255, 255, 255, 0.05);
}

.cb-copy-btn svg {
  width: 12px;
  height: 12px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
}

/* ==========================================================================
   6. Suggested Quick Questions (Refined Pill Buttons)
   ========================================================================== */
.cb-suggestions {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cb-suggestions-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--cb-gold-primary);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
  padding-left: 2px;
}

.cb-suggestions-label svg {
  width: 13px;
  height: 13px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
}

.cb-chips-container {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.cb-chip {
  background: rgba(12, 24, 39, 0.85);
  border: 1px solid rgba(197, 160, 89, 0.3);
  color: rgba(255, 255, 255, 0.9);
  padding: 6px 13px;
  border-radius: 9999px;
  font-size: 12px;
  font-weight: 400;
  cursor: pointer;
  text-align: left;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  outline: none;
  box-shadow: 0 2px 6px rgba(0,0,0,0.25);
}

.cb-chip:hover {
  background: rgba(197, 160, 89, 0.18);
  border-color: var(--cb-gold-bright);
  color: #FFFFFF;
  transform: translateY(-1px);
}

/* ==========================================================================
   7. Typing Indicator
   ========================================================================== */
.cb-typing-container {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 4px 0 8px 4px;
}

.cb-typing-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--cb-navy-card);
  border: 1px solid rgba(197, 160, 89, 0.3);
  overflow: hidden;
  position: relative;
  flex-shrink: 0;
}

.cb-typing-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cb-typing-bubble {
  display: flex;
  align-items: center;
  gap: 4px;
  background: var(--cb-navy-card);
  border: 1px solid rgba(197, 160, 89, 0.2);
  padding: 8px 12px;
  border-radius: 16px;
  border-top-left-radius: 2px;
}

.cb-dot {
  width: 5px;
  height: 5px;
  background: var(--cb-gold-bright);
  border-radius: 50%;
  animation: cb-bounce 1.4s infinite ease-in-out both;
}

.cb-dot:nth-child(1) { animation-delay: -0.3s; }
.cb-dot:nth-child(2) { animation-delay: -0.15s; }

@keyframes cb-bounce {
  0%, 80%, 100% { transform: scale(0.2); opacity: 0.3; }
  40% { transform: scale(1.0); opacity: 1; }
}

/* ==========================================================================
   8. Input Area
   ========================================================================== */
.cb-input-area {
  background: var(--cb-navy-card);
  border-top: 1px solid rgba(197, 160, 89, 0.2);
  padding: 12px 14px 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-shrink: 0;
}

.cb-input-box {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  background: var(--cb-navy-bg);
  border: 1px solid rgba(197, 160, 89, 0.3);
  border-radius: 12px;
  padding: 8px 10px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.4);
}

.cb-input-box:focus-within {
  border-color: var(--cb-gold-bright);
  box-shadow: 0 0 0 1px rgba(232, 163, 23, 0.3), inset 0 2px 4px rgba(0,0,0,0.4);
}

.cb-textarea {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--cb-text-white);
  font-size: 13.5px;
  line-height: 1.4;
  resize: none;
  max-height: 90px;
  min-height: 22px;
  padding: 2px 0;
}

.cb-textarea::placeholder {
  color: rgba(255, 255, 255, 0.4);
}

.cb-send-btn {
  background: linear-gradient(135deg, #D4AF61, #C5A059);
  border: none;
  color: #070F1A;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
  outline: none;
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

.cb-send-btn:hover:not(:disabled) {
  background: linear-gradient(135deg, #F0D78C, #D4AF61);
  transform: scale(0.96);
}

.cb-send-btn:disabled {
  background: rgba(255, 255, 255, 0.05);
  color: rgba(255, 255, 255, 0.2);
  cursor: not-allowed;
  box-shadow: none;
}

.cb-send-btn svg {
  width: 15px;
  height: 15px;
  stroke: currentColor;
  stroke-width: 2.2;
  fill: none;
}

/* Powered by label */
.cb-powered-by {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding-top: 6px;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.5);
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  letter-spacing: 0.5px;
}

.cb-powered-by svg {
  width: 14px;
  height: 14px;
  color: var(--cb-gold-bright);
}

.cb-powered-brand {
  font-weight: 600;
  color: rgba(255, 255, 255, 0.85);
  letter-spacing: 1px;
}

/* ==========================================================================
   9. Mobile Responsiveness (< 640px)
   ========================================================================== */
@media (max-width: 640px) {
  .cb-backdrop {
    display: block;
  }
  .cb-window {
    right: 12px;
    left: 12px;
    bottom: 84px;
    width: auto;
    height: 78vh;
    max-height: 640px;
  }
  .cb-msg-bubble {
    max-width: 85%;
  }
}
