/* Premium Glassmorphism Chatbot Stylesheet */

:root {
  --chat-primary: var(--text-primary, #2c2523);
  --chat-accent: var(--accent-gold, #006666);
  --chat-bg: rgba(255, 255, 255, 0.85);
  --chat-border: rgba(0, 102, 102, 0.12);
  --chat-shadow: 0 12px 40px rgba(0, 102, 102, 0.08);
  --chat-font: 'Outfit', sans-serif;
  --chat-serif: 'Playfair Display', serif;
}

/* Floating Chat Trigger Button */
.chatbot-trigger {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--chat-accent);
  color: #fff;
  border: none;
  box-shadow: 0 8px 30px rgba(0, 102, 102, 0.3);
  cursor: pointer;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  outline: none;
}

.chatbot-trigger::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  box-shadow: 0 0 0 0 rgba(0, 102, 102, 0.5);
  animation: pulse-glow 2s infinite;
}

.chatbot-trigger:hover {
  transform: translateY(-4px) scale(1.05);
  box-shadow: 0 12px 35px rgba(0, 102, 102, 0.4);
}

.chatbot-trigger i {
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.chatbot-trigger.open i {
  transform: rotate(90deg);
}

/* Chat Widget Window Container */
.chatbot-window {
  position: fixed;
  bottom: 105px;
  right: 30px;
  width: 400px;
  height: 600px;
  max-height: calc(100vh - 140px);
  background: var(--chat-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--chat-border);
  border-radius: 24px;
  box-shadow: var(--chat-shadow);
  z-index: 999;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  transform: translateY(20px) scale(0.95);
  pointer-events: none;
  transition: opacity 0.4s cubic-bezier(0.16, 1, 0.3, 1), transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.chatbot-window.open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: all;
}

/* Header styling */
.chatbot-header {
  padding: 24px;
  background: linear-gradient(135deg, var(--chat-primary) 0%, #4e423e 100%);
  color: #fff;
  display: flex;
  align-items: center;
  gap: 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.chatbot-avatar-container {
  position: relative;
  width: 44px;
  height: 44px;
}

.chatbot-avatar {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  border: 1.5px solid var(--chat-accent);
}

.chatbot-status-dot {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 10px;
  height: 10px;
  background-color: #2ec4b6;
  border: 2px solid var(--chat-primary);
  border-radius: 50%;
}

.chatbot-info h4 {
  font-family: var(--chat-serif);
  font-size: 1.15rem;
  font-weight: 500;
  margin-bottom: 2px;
}

.chatbot-info span {
  font-family: var(--chat-font);
  font-size: 0.75rem;
  opacity: 0.7;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

/* Chat Messages Area */
.chatbot-messages {
  flex-grow: 1;
  padding: 24px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
  scroll-behavior: smooth;
}

.chatbot-msg {
  max-width: 80%;
  padding: 12px 18px;
  border-radius: 16px;
  font-size: 0.95rem;
  line-height: 1.5;
  animation: fade-up 0.3s ease;
  word-wrap: break-word;
}

.chatbot-msg.bot {
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid rgba(0, 0, 0, 0.03);
  color: var(--chat-primary);
  align-self: flex-start;
  border-bottom-left-radius: 4px;
}

.chatbot-msg.user {
  background: var(--chat-accent);
  color: #fff;
  align-self: flex-end;
  border-bottom-right-radius: 4px;
  box-shadow: 0 4px 15px rgba(0, 102, 102, 0.15);
}

/* Quick Replies Chips */
.chatbot-quick-replies {
  display: flex;
  gap: 8px;
  padding: 0 24px 16px 24px;
  overflow-x: auto;
  flex-wrap: nowrap;
  scrollbar-width: none;
}

.chatbot-quick-replies::-webkit-scrollbar {
  display: none;
}

.chatbot-chip {
  flex-shrink: 0;
  padding: 8px 16px;
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid var(--chat-border);
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--chat-primary);
  cursor: pointer;
  transition: all 0.3s ease;
}

.chatbot-chip:hover {
  background: var(--chat-accent);
  color: #fff;
  border-color: var(--chat-accent);
  transform: translateY(-1px);
}

/* Chat Input Bar */
.chatbot-input-area {
  padding: 16px 24px 24px 24px;
  border-top: 1px solid var(--chat-border);
  display: flex;
  gap: 12px;
  background: rgba(255, 255, 255, 0.3);
}

.chatbot-input {
  flex-grow: 1;
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid var(--chat-border);
  border-radius: 12px;
  padding: 12px 16px;
  outline: none;
  font-family: var(--chat-font);
  font-size: 0.95rem;
  color: var(--chat-primary);
  transition: border-color 0.3s ease;
}

.chatbot-input:focus {
  border-color: var(--chat-accent);
}

.chatbot-send {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  background: var(--chat-accent);
  color: #fff;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(0, 102, 102, 0.2);
}

.chatbot-send:hover {
  background: var(--chat-primary);
  transform: translateY(-2px);
}

/* Typing Indicator Animation */
.chatbot-typing {
  align-self: flex-start;
  display: flex;
  gap: 4px;
  padding: 12px 18px;
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid rgba(0, 0, 0, 0.03);
  border-radius: 16px;
  border-bottom-left-radius: 4px;
}

.chatbot-typing span {
  width: 8px;
  height: 8px;
  background-color: var(--chat-primary);
  opacity: 0.4;
  border-radius: 50%;
  animation: typing-bounce 1.4s infinite ease-in-out both;
}

.chatbot-typing span:nth-child(2) { animation-delay: 0.2s; }
.chatbot-typing span:nth-child(3) { animation-delay: 0.4s; }

/* Lead Form container inside bubble */
.chatbot-lead-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  margin-top: 8px;
}

.chatbot-lead-form input {
  padding: 10px;
  border: 1px solid var(--chat-border);
  border-radius: 8px;
  outline: none;
  font-size: 0.85rem;
  background: rgba(255, 255, 255, 0.8);
}

.chatbot-lead-form input:focus {
  border-color: var(--chat-accent);
}

.chatbot-lead-btn {
  background: var(--chat-accent);
  color: #fff;
  border: none;
  padding: 10px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  font-size: 0.85rem;
  transition: background 0.3s;
}

.chatbot-lead-btn:hover {
  background: var(--chat-primary);
}

/* Animations */
@keyframes pulse-glow {
  0% { box-shadow: 0 0 0 0 rgba(0, 102, 102, 0.4); }
  70% { box-shadow: 0 0 0 15px rgba(0, 102, 102, 0); }
  100% { box-shadow: 0 0 0 0 rgba(0, 102, 102, 0); }
}

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

@keyframes fade-up {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Responsive adjustments */
@media (max-width: 480px) {
  .chatbot-window {
    bottom: 0;
    right: 0;
    width: 100%;
    height: 100%;
    max-height: 100%;
    border-radius: 0;
    border: none;
  }
  
  .chatbot-trigger {
    bottom: 20px;
    right: 20px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
  }
  
  .chatbot-trigger.open {
    display: none; /* Hide floating trigger when open on mobile */
  }
  
  .chatbot-window-close-mobile {
    display: block !important;
    background: none;
    border: none;
    color: #fff;
    font-size: 1.5rem;
    cursor: pointer;
    margin-left: auto;
  }
}

.chatbot-window-close-mobile {
  display: none;
}
