/* ==========================================================================
   BTH Virtual Tour — Chatbot AI Floating Widget Styles
   Aesthetic: Clean Modern Glassmorphism + BTH Brand Identity
   ========================================================================== */

:root {
  --bth-bot-primary: #0f2b5c;
  --bth-bot-primary-light: #1e3a8a;
  --bth-bot-accent: #f59e0b;
  --bth-bot-accent-hover: #d97706;
  --bth-bot-bg: #ffffff;
  --bth-bot-surface: #f8fafc;
  --bth-bot-border: #e2e8f0;
  --bth-bot-text-main: #0f172a;
  --bth-bot-text-muted: #64748b;
  --bth-bot-shadow: 0 20px 45px -10px rgba(15, 43, 92, 0.22), 0 10px 25px -5px rgba(0, 0, 0, 0.08);
}

/* Floating Launcher Button */
.bth-chatbot-launcher {
  position: fixed;
  bottom: 28px;
  right: 28px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--bth-bot-primary) 0%, #1e40af 100%);
  color: #ffffff;
  border: none;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(15, 43, 92, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  outline: none;
}

.bth-chatbot-launcher:hover {
  transform: scale(1.08) translateY(-2px);
  box-shadow: 0 14px 30px rgba(15, 43, 92, 0.45);
}

.bth-chatbot-launcher:active {
  transform: scale(0.96);
}

/* Pulsing Badge / Ring */
.bth-chatbot-pulse {
  position: absolute;
  top: -2px;
  right: -2px;
  width: 16px;
  height: 16px;
  background: #10b981;
  border: 2.5px solid #ffffff;
  border-radius: 50%;
  box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  animation: bth-bot-pulse 2s infinite;
}

@keyframes bth-bot-pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  }
  70% {
    box-shadow: 0 0 0 8px rgba(16, 185, 129, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
  }
}

.bth-chatbot-launcher svg {
  width: 28px;
  height: 28px;
  transition: transform 0.3s ease;
}

.bth-chatbot-launcher.is-open svg.icon-chat {
  display: none;
}

.bth-chatbot-launcher.is-open svg.icon-close {
  display: block;
}

.bth-chatbot-launcher svg.icon-close {
  display: none;
}

/* Launcher Tooltip */
.bth-chatbot-tooltip {
  position: absolute;
  right: 72px;
  bottom: 12px;
  background: rgba(15, 23, 42, 0.9);
  backdrop-filter: blur(8px);
  color: #ffffff;
  padding: 8px 14px;
  border-radius: 20px;
  font-size: 0.82rem;
  font-weight: 600;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transform: translateX(10px);
  transition: all 0.25s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  display: flex;
  align-items: center;
  gap: 6px;
}

.bth-chatbot-launcher:hover .bth-chatbot-tooltip {
  opacity: 1;
  transform: translateX(0);
}

/* Chat Widget Container */
.bth-chatbot-container {
  position: fixed;
  bottom: 100px;
  right: 28px;
  width: 390px;
  max-width: calc(100vw - 36px);
  height: 590px;
  max-height: calc(100vh - 120px);
  background: var(--bth-bot-bg);
  border-radius: 22px;
  box-shadow: var(--bth-bot-shadow);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 9998;
  border: 1px solid var(--bth-bot-border);
  opacity: 0;
  visibility: hidden;
  transform: translateY(24px) scale(0.96);
  transform-origin: bottom right;
  transition: all 0.32s cubic-bezier(0.16, 1, 0.3, 1);
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.bth-chatbot-container.is-active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

/* Widget Header */
.bth-chat-header {
  background: linear-gradient(135deg, var(--bth-bot-primary) 0%, #1e3a8a 100%);
  color: #ffffff;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 4px 16px rgba(15, 43, 92, 0.12);
}

.bth-chat-header-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.bth-chat-avatar {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  flex-shrink: 0;
}

.bth-chat-avatar svg {
  width: 24px;
  height: 24px;
  color: #ffffff;
}

.bth-chat-online-dot {
  position: absolute;
  bottom: -2px;
  right: -2px;
  width: 11px;
  height: 11px;
  background: #10b981;
  border: 2px solid var(--bth-bot-primary);
  border-radius: 50%;
}

.bth-chat-title h4 {
  font-size: 0.95rem;
  font-weight: 700;
  margin: 0;
  color: #ffffff;
  letter-spacing: -0.01em;
}

.bth-chat-title p {
  font-size: 0.74rem;
  color: rgba(255, 255, 255, 0.8);
  margin: 2px 0 0 0;
  display: flex;
  align-items: center;
  gap: 4px;
}

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

.bth-chat-btn-icon {
  background: rgba(255, 255, 255, 0.12);
  border: none;
  color: #ffffff;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.bth-chat-btn-icon:hover {
  background: rgba(255, 255, 255, 0.25);
}

.bth-chat-btn-icon.is-active {
  background: var(--bth-bot-accent);
  color: #0f172a;
}

/* Chat Messages Stream */
.bth-chat-messages {
  flex: 1;
  padding: 18px 16px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
  background: #f8fafc;
  scroll-behavior: smooth;
}

.bth-chat-messages::-webkit-scrollbar {
  width: 5px;
}

.bth-chat-messages::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 10px;
}

/* Message Bubble */
.bth-msg {
  display: flex;
  flex-direction: column;
  max-width: 84%;
  animation: bth-fade-in 0.25s ease forwards;
}

@keyframes bth-fade-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

.bth-msg-user {
  align-self: flex-end;
}

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

.bth-msg-bot .bth-msg-bubble {
  background: #ffffff;
  color: var(--bth-bot-text-main);
  border: 1px solid var(--bth-bot-border);
  border-bottom-left-radius: 4px;
}

.bth-msg-user .bth-msg-bubble {
  background: linear-gradient(135deg, var(--bth-bot-primary) 0%, #1e3a8a 100%);
  color: #ffffff;
  border-bottom-right-radius: 4px;
}

.bth-msg-time {
  font-size: 0.68rem;
  color: var(--bth-bot-text-muted);
  margin-top: 4px;
  padding: 0 4px;
}

.bth-msg-user .bth-msg-time {
  text-align: right;
}

/* Quick Suggestion Chips */
.bth-chat-suggestions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 4px;
}

.bth-suggestion-pill {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  color: var(--bth-bot-primary);
  padding: 8px 12px;
  border-radius: 12px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.bth-suggestion-pill:hover {
  background: #eff6ff;
  border-color: #93c5fd;
  color: #1d4ed8;
  transform: translateX(3px);
}

.bth-suggestion-pill svg {
  width: 14px;
  height: 14px;
  color: #94a3b8;
}

/* Room Navigation Card */
.bth-chat-nav-card {
  margin-top: 10px;
  background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
  border: 1px solid #bfdbfe;
  border-radius: 12px;
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.bth-chat-autonav-card {
  background: linear-gradient(135deg, #f0fdf4 0%, #e0f2fe 100%);
  border: 1.5px solid #7dd3fc;
  box-shadow: 0 4px 14px rgba(2, 132, 199, 0.12);
  position: relative;
  overflow: hidden;
}

.bth-autonav-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.bth-chat-nav-info {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--bth-bot-primary);
}

.bth-autonav-radar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(14, 165, 233, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  flex-shrink: 0;
}

.bth-radar-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #0284c7;
  animation: bth-radar-pulse 1.4s ease-out infinite;
}

@keyframes bth-radar-pulse {
  0% { transform: scale(0.8); opacity: 1; box-shadow: 0 0 0 0 rgba(2, 132, 199, 0.6); }
  70% { transform: scale(1.1); opacity: 0.9; box-shadow: 0 0 0 8px rgba(2, 132, 199, 0); }
  100% { transform: scale(0.8); opacity: 1; }
}

.bth-autonav-title {
  font-size: 0.84rem;
  font-weight: 700;
  color: #0f172a;
}

.bth-autonav-status {
  font-size: 0.73rem;
  color: #0284c7;
  font-weight: 600;
  margin-top: 2px;
}

/* Auto-Nav Progress Bar */
.bth-autonav-progress {
  width: 100%;
  height: 5px;
  background: rgba(14, 165, 233, 0.15);
  border-radius: 999px;
  overflow: hidden;
  margin: 2px 0;
}

.bth-autonav-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #0284c7 0%, #38bdf8 100%);
  border-radius: 999px;
  transition: width 0.1s linear;
}

.bth-autonav-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 2px;
}

.bth-autonav-btn-primary {
  flex: 1;
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
  color: #ffffff;
  border: none;
  padding: 7px 14px;
  border-radius: 8px;
  font-size: 0.76rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
  box-shadow: 0 2px 6px rgba(2, 132, 199, 0.25);
  text-decoration: none;
  display: inline-block;
}

.bth-autonav-btn-primary:hover {
  background: linear-gradient(135deg, #0369a1 0%, #075985 100%);
  transform: translateY(-1px);
}

.bth-autonav-btn-cancel {
  background: rgba(255, 255, 255, 0.7);
  color: #64748b;
  border: 1px solid #cbd5e1;
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 0.74rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.bth-autonav-btn-cancel:hover {
  background: #f1f5f9;
  color: #334155;
  border-color: #94a3b8;
}

.bth-chat-nav-btn {
  background: var(--bth-bot-accent);
  color: #0f172a;
  border: none;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 0.76rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  text-decoration: none;
  display: inline-block;
}

.bth-chat-nav-btn:hover {
  background: var(--bth-bot-accent-hover);
  transform: scale(1.04);
}

/* Typing Indicator */
.bth-typing-indicator {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 12px 16px;
  background: #ffffff;
  border: 1px solid var(--bth-bot-border);
  border-radius: 16px;
  border-bottom-left-radius: 4px;
  width: fit-content;
}

.bth-typing-dot {
  width: 7px;
  height: 7px;
  background: #94a3b8;
  border-radius: 50%;
  animation: bth-typing-bounce 1.4s infinite ease-in-out;
}

.bth-typing-dot:nth-child(1) { animation-delay: -0.32s; }
.bth-typing-dot:nth-child(2) { animation-delay: -0.16s; }

@keyframes bth-typing-bounce {
  0%, 80%, 100% {
    transform: scale(0.6);
    opacity: 0.4;
  }
  40% {
    transform: scale(1);
    opacity: 1;
  }
}

/* Chat Input Bar */
.bth-chat-input-bar {
  padding: 12px 16px 14px 16px;
  background: #ffffff;
  border-top: 1px solid var(--bth-bot-border);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.bth-chat-input-form {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  border-radius: 14px;
  padding: 4px 6px 4px 14px;
  transition: all 0.2s ease;
}

.bth-chat-input-form:focus-within {
  background: #ffffff;
  border-color: var(--bth-bot-primary);
  box-shadow: 0 0 0 3px rgba(15, 43, 92, 0.12);
}

.bth-chat-input {
  flex: 1;
  border: none;
  background: transparent;
  font-size: 0.88rem;
  color: var(--bth-bot-text-main);
  outline: none;
  font-family: inherit;
  padding: 6px 0;
}

.bth-chat-input::placeholder {
  color: #94a3b8;
}

.bth-chat-send-btn {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--bth-bot-primary);
  color: #ffffff;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.bth-chat-send-btn:hover:not(:disabled) {
  background: #1e3a8a;
  transform: scale(1.05);
}

.bth-chat-send-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.bth-chat-disclaimer {
  font-size: 0.68rem;
  color: #94a3b8;
  text-align: center;
  margin-top: 2px;
}

/* Mobile Responsiveness */
@media (max-width: 480px) {
  .bth-chatbot-container {
    bottom: 0;
    right: 0;
    width: 100vw;
    height: 100vh;
    max-width: 100vw;
    max-height: 100vh;
    border-radius: 0;
  }
  .bth-chatbot-launcher {
    bottom: 20px;
    right: 20px;
  }
}
