/* Premium Chatbot Styles - Aligned with Homepage Aesthetic */

#chatbot-launcher {
  /* Removed fixed positioning - now handled by floating-actions-bar */
  position: relative;
  width: 60px;
  height: 60px;
  background: linear-gradient(
    135deg,
    var(--theme-brand-gold) 0%,
    var(--theme-brand-gold-dark) 100%
  );
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid rgba(255, 255, 255, 0.4);
  cursor: pointer;
  z-index: 1000;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: visible;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  color: #1a1a1a;
}

#chatbot-launcher:hover {
  transform: translateY(-6px) scale(1.12);
  background: linear-gradient(
    135deg,
    var(--theme-brand-gold-dark) 0%,
    var(--primary-dark) 100%
  );
  box-shadow: 0 12px 32px rgba(212, 175, 55, 0.4);
  border-color: rgba(255, 255, 255, 0.6);
}

#chatbot-launcher i {
  font-size: 24px;
}

.chatbot-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  object-fit: cover;
  object-position: center;
  border: none;
}

#chatbot-window {
  position: fixed;
  bottom: 110px;
  right: 30px;
  width: 380px;
  max-width: calc(100vw - 40px);
  height: 520px;
  max-height: calc(100vh - 140px);
  background: var(--bg-white);
  border-radius: 8px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.25);
  z-index: 99999;
  display: none;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--theme-border-accent);
  animation: chatbotSlideIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

#chatbot-window.show {
  display: flex;
}

#chatbot-window.hide {
  animation: chatbotSlideOut 0.3s ease-in forwards;
}

@keyframes chatbotSlideIn {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes chatbotSlideOut {
  from {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  to {
    opacity: 0;
    transform: translateY(20px) scale(0.95);
  }
}

#chatbot-header {
  background: linear-gradient(
    135deg,
    var(--theme-brand-gold) 0%,
    var(--theme-brand-gold-dark) 100%
  );
  color: #1a1a1a;
  padding: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 700;
  font-size: 14px;
  border-bottom: 1px solid var(--theme-border-accent);
  flex-shrink: 0;
  min-height: 56px;
}

#chatbot-header h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.3px;
}

#chatbot-close {
  background: none;
  border: none;
  color: #1a1a1a;
  font-size: 20px;
  font-weight: bold;
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  border-radius: 50%;
}
#chatbot-close:hover {
  background: rgba(212, 175, 55, 0.1);
}

#chat-log {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
  background: #fafaf9;
  font-size: 13px;
  line-height: 1.6;
  min-height: 250px;
  max-height: calc(100% - 140px);
  scrollbar-width: thin;
  scrollbar-color: rgba(212, 175, 55, 0.3) #fafaf9;
}

#chat-log::-webkit-scrollbar {
  width: 6px;
}

#chat-log::-webkit-scrollbar-track {
  background: #fafaf9;
}

#chat-log::-webkit-scrollbar-thumb {
  background: rgba(212, 175, 55, 0.3);
  border-radius: 3px;
}

#chat-log::-webkit-scrollbar-thumb:hover {
  background: rgba(212, 175, 55, 0.5);
}

.chat-message {
  margin-bottom: 12px;
  display: flex;
  animation: messageSlideIn 0.3s ease-out;
}

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

.chat-message.user {
  justify-content: flex-end;
}

.chat-message.user .message-bubble {
  background: linear-gradient(
    135deg,
    var(--theme-brand-gold) 0%,
    var(--theme-brand-gold-dark) 100%
  );
  color: #1a1a1a;
  border-radius: 12px 12px 4px 12px;
  font-weight: 500;
}

.chat-message.ai .message-bubble {
  background: var(--theme-neutral-100);
  color: var(--text-primary);
  border-radius: 12px 12px 12px 4px;
}

.message-bubble {
  padding: 10px 14px;
  max-width: 85%;
  word-wrap: break-word;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

#chatbot-input {
  padding: 12px 16px;
  background: var(--bg-white);
  border-top: 1px solid var(--theme-spotlight-gold-soft);
  display: flex;
  gap: 8px;
  border-bottom-left-radius: 8px;
  border-bottom-right-radius: 8px;
  flex-shrink: 0;
  min-height: 64px;
  align-items: center;
}

#user-message {
  flex: 1;
  padding: 10px 12px;
  border: 1px solid rgba(212, 175, 55, 0.3);
  border-radius: 6px;
  font-size: 13px;
  outline: none;
  background: var(--bg-white);
  font-family: inherit;
  transition: all 0.2s ease;
}

#user-message:focus {
  border-color: var(--theme-brand-gold);
  box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.15);
  background: var(--theme-brand-cream-strong);
}

#user-message::placeholder {
  color: var(--text-light);
}

#chatbot-input button {
  padding: 10px 14px;
  background: linear-gradient(
    135deg,
    var(--theme-brand-gold) 0%,
    var(--theme-brand-gold-dark) 100%
  );
  color: #1a1a1a;
  border: none;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 6px rgba(212, 175, 55, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
}

#chatbot-input button i {
  font-size: 16px;
}

#chatbot-input button:hover {
  background: linear-gradient(
    135deg,
    var(--theme-brand-gold-dark) 0%,
    var(--primary-dark) 100%
  );
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(212, 175, 55, 0.3);
}

#chatbot-input button:active {
  transform: translateY(0);
}

@media (max-width: 768px) {
  #chatbot-window {
    bottom: 80px;
    right: 10px;
    left: auto;
    width: calc(100vw - 20px);
    height: 380px;
  }

  #chatbot-input {
    padding: 10px 12px;
    min-height: 56px;
  }

  #chatbot-header {
    padding: 12px;
    min-height: 48px;
  }

  #chat-log {
    padding: 12px;
    font-size: 12px;
  }
}
