/* AI Tour Guide FAB & Chat Styles (Modern Luxury Premium) */

:root {
  --guide-gold: #d4af37;
  --guide-gold-light: #f3e5ab;
  --guide-gold-dark: #aa8c2c;
  --guide-dark: #121212;
  --guide-surface: rgba(28, 28, 30, 0.85);
  --guide-text: #f0f0f0;
  --guide-text-muted: #a0a0a0;
  --guide-border: rgba(212, 175, 55, 0.2);
}

.ai-guide-fab {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 64px;
  height: 64px;
  background: linear-gradient(135deg, var(--guide-dark), #2a2a2a);
  border: 1px solid var(--guide-border);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4), 0 0 20px rgba(212, 175, 55, 0.2);
  cursor: grab;
  z-index: 9999;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.ai-guide-fab:active {
  cursor: grabbing;
}

.ai-guide-fab__ring {
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  border-radius: 50%;
  border: 1px solid var(--guide-gold);
  opacity: 0;
  transform: scale(0.8);
  transition: all 0.4s ease;
}

.ai-guide-fab:hover {
  transform: scale(1.05) translateY(-4px);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.5), 0 0 25px rgba(212, 175, 55, 0.4);
}

.ai-guide-fab:hover .ai-guide-fab__ring {
  opacity: 1;
  transform: scale(1);
  animation: pulse-ring 2s infinite cubic-bezier(0.215, 0.61, 0.355, 1);
}

@keyframes pulse-ring {
  0% {
    transform: scale(1);
    opacity: 0.8;
  }

  50% {
    transform: scale(1.15);
    opacity: 0;
  }

  100% {
    transform: scale(1);
    opacity: 0;
  }
}

.ai-guide-fab__image {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  position: relative;
  z-index: 2;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

.ai-guide-chat {
  position: fixed;
  bottom: 100px;
  right: 24px;
  width: 380px;
  max-width: calc(100vw - 48px);
  height: 600px;
  max-height: calc(100vh - 120px);
  border-radius: 24px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5), 0 0 0 1px var(--guide-border);
  z-index: 9999;
  animation: slideUpChat 0.5s cubic-bezier(0.19, 1, 0.22, 1) forwards;
  color: var(--guide-text);
  font-family: 'Inter', 'Prompt', sans-serif;
  overflow: hidden;
}

.ai-guide-chat__glass-overlay {
  position: absolute;
  inset: 0;
  background: var(--guide-surface);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  z-index: 0;
}

.ai-guide-chat__content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  height: 100%;
}

@keyframes slideUpChat {
  from {
    opacity: 0;
    transform: translateY(40px) scale(0.95);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.ai-guide-chat__header {
  padding: 20px 24px;
  background: linear-gradient(to right, rgba(0, 0, 0, 0.4), rgba(0, 0, 0, 0.1));
  border-bottom: 1px solid var(--guide-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.ai-guide-chat__header-info {
  display: flex;
  align-items: center;
  gap: 16px;
}

.ai-guide-chat__avatar-wrap {
  position: relative;
}

.ai-guide-chat__avatar-image {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--guide-border);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

.ai-guide-chat__status-dot {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 12px;
  height: 12px;
  background-color: #2ecc71;
  border: 2px solid var(--guide-dark);
  border-radius: 50%;
  box-shadow: 0 0 8px rgba(46, 204, 113, 0.6);
}

.ai-guide-chat__title {
  margin: 0;
  font-size: 16px;
  font-weight: 500;
  letter-spacing: 0.5px;
  color: var(--guide-gold-light);
}

.ai-guide-chat__status {
  margin: 4px 0 0 0;
  font-size: 12px;
  color: var(--guide-text-muted);
  font-weight: 300;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.ai-guide-chat__close {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--guide-text-muted);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
}

.ai-guide-chat__close:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  transform: rotate(90deg);
}

.ai-guide-chat__messages {
  flex: 1;
  padding: 24px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Custom Scrollbar for messages */
.ai-guide-chat__messages::-webkit-scrollbar {
  width: 6px;
}

.ai-guide-chat__messages::-webkit-scrollbar-track {
  background: transparent;
}

.ai-guide-chat__messages::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
}

.ai-guide-chat__messages::-webkit-scrollbar-thumb:hover {
  background: rgba(212, 175, 55, 0.5);
}

.ai-guide-chat__message {
  display: flex;
  flex-direction: column;
  max-width: 88%;
  animation: messageFadeIn 0.4s ease forwards;
}

@keyframes messageFadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.ai-guide-chat__message--bot {
  align-self: flex-start;
}

.ai-guide-chat__message--user {
  align-self: flex-end;
}

.ai-guide-chat__bubble {
  padding: 14px 18px;
  font-size: 14px;
  line-height: 1.6;
  word-break: break-word;
  font-weight: 300;
  letter-spacing: 0.3px;
}

.ai-guide-chat__message--bot .ai-guide-chat__bubble {
  background: rgba(255, 255, 255, 0.03);
  color: var(--guide-text);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 4px 16px 16px 16px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.ai-guide-chat__message--user .ai-guide-chat__bubble {
  background: linear-gradient(135deg, var(--guide-gold), var(--guide-gold-dark));
  color: #fff;
  border-radius: 16px 4px 16px 16px;
  box-shadow: 0 4px 15px rgba(212, 175, 55, 0.15);
  font-weight: 400;
}

.ai-guide-chat__message--bot .ai-guide-chat__bubble pre {
  background: rgba(0, 0, 0, 0.3);
  padding: 12px;
  border-radius: 8px;
  overflow-x: auto;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.ai-guide-chat__message--bot .ai-guide-chat__bubble strong {
  color: var(--guide-gold-light);
  font-weight: 500;
}

.ai-guide-chat__message--bot .ai-guide-chat__bubble a {
  color: var(--guide-gold);
  text-decoration: none;
  border-bottom: 1px solid var(--guide-gold);
  transition: color 0.2s, border-color 0.2s;
}

.ai-guide-chat__message--bot .ai-guide-chat__bubble a:hover {
  color: #fff;
  border-color: #fff;
}

.ai-guide-chat__input-area {
  padding: 20px 24px;
  background: rgba(0, 0, 0, 0.2);
  border-top: 1px solid var(--guide-border);
  display: flex;
  align-items: center;
  gap: 12px;
}

.ai-guide-chat__input {
  flex: 1;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--guide-text);
  border-radius: 24px;
  padding: 12px 20px;
  font-family: inherit;
  font-size: 14px;
  resize: none;
  outline: none;
  transition: all 0.3s ease;
  font-weight: 300;
}

.ai-guide-chat__input::placeholder {
  color: rgba(255, 255, 255, 0.3);
}

.ai-guide-chat__input:focus {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--guide-gold);
  box-shadow: 0 0 0 2px rgba(212, 175, 55, 0.1);
}

.ai-guide-chat__send {
  background: linear-gradient(135deg, var(--guide-gold), var(--guide-gold-dark));
  color: #fff;
  border: none;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 10px rgba(212, 175, 55, 0.2);
}

.ai-guide-chat__send:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 15px rgba(212, 175, 55, 0.3);
}

.ai-guide-chat__send:active {
  transform: scale(0.95);
}

.ai-guide-chat__send:disabled {
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.3);
  box-shadow: none;
  cursor: not-allowed;
  transform: none;
}

/* Loading dots */
.ai-guide-loading {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 12px 18px !important;
}

.ai-guide-loading span {
  width: 6px;
  height: 6px;
  background: var(--guide-gold);
  border-radius: 50%;
  animation: bounce 1.4s infinite ease-in-out both;
  box-shadow: 0 0 6px rgba(212, 175, 55, 0.5);
}

.ai-guide-loading span:nth-child(1) {
  animation-delay: -0.32s;
}

.ai-guide-loading span:nth-child(2) {
  animation-delay: -0.16s;
}

@keyframes bounce {

  0%,
  80%,
  100% {
    transform: scale(0);
    opacity: 0.3;
  }

  40% {
    transform: scale(1);
    opacity: 1;
  }
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .ai-guide-chat__header {
    padding: 16px;
  }

  .ai-guide-chat__title {
    font-size: 15px;
  }

  .ai-guide-chat__messages {
    padding: 16px;
    gap: 16px;
  }

  .ai-guide-chat__bubble {
    padding: 12px 16px;
    font-size: 13.5px;
  }

  .ai-guide-chat__input-area {
    padding: 14px 16px;
  }
}

/* ---- Mobile-specific: FAB + Chat placement ---- */
html.mnx-is-mobile .ai-guide-fab {
  bottom: auto;
  top: 76px;
  left: 16px;
  right: auto;
  width: 50px;
  height: 50px;
  z-index: 499;
}

/* ---- Hide Chatbot on Specific Pages (Mobile) ---- */
html.mnx-is-mobile body.page-profile .ai-guide-fab,
html.mnx-is-mobile body.page-profile .ai-guide-chat,
html.mnx-is-mobile body.page-checkin .ai-guide-fab,
html.mnx-is-mobile body.page-checkin .ai-guide-chat {
  display: none !important;
}

html.mnx-is-mobile .ai-guide-chat {
  bottom: auto;
  top: 60px;
  right: 12px;
  left: 12px;
  width: auto;
  max-width: none;
  height: calc(100dvh - 60px - 90px);
  max-height: none;
  border-radius: 20px;
  z-index: 499;
}