/* MKT SEO Floating Chatbot CSS */

/* Variables matching MKT SEO Theme */
:root {
  --cb-bg-primary: #0a0a0a;
  --cb-bg-secondary: #121212;
  --cb-bg-card: #181818;
  --cb-border-color: rgba(212, 175, 55, 0.15);
  --cb-border-focus: rgba(212, 175, 55, 0.4);
  --cb-text-primary: #ffffff;
  --cb-text-secondary: #b3b3b3;
  --cb-text-muted: #707070;
  --cb-gold: #d4af37;
  --cb-gold-hover: #f3e5ab;
  --cb-gold-light: rgba(212, 175, 55, 0.1);
  --cb-whatsapp: #25d366;
  --cb-whatsapp-hover: #20ba5a;
  --cb-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --cb-font-heading: 'Poppins', sans-serif;
  --cb-font-body: 'Inter', sans-serif;
}

/* Chatbot Launcher Button */
.mkt-chatbot-launcher {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background-color: var(--cb-gold);
  color: var(--cb-bg-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 99999;
  box-shadow: 0 8px 24px rgba(212, 175, 55, 0.3);
  transition: var(--cb-transition);
  border: none;
  outline: none;
  animation: mkt-launcher-pulse 2s infinite;
}

.mkt-chatbot-launcher:hover {
  transform: scale(1.08) rotate(5deg);
  background-color: var(--cb-gold-hover);
  box-shadow: 0 10px 28px rgba(212, 175, 55, 0.45);
}

.mkt-chatbot-launcher i {
  font-size: 24px;
  transition: var(--cb-transition);
}

.mkt-chatbot-launcher.active i {
  transform: rotate(90deg);
}

/* Notification badge on launcher */
.mkt-chatbot-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  width: 14px;
  height: 14px;
  background-color: #e74c3c;
  border: 2px solid var(--cb-gold);
  border-radius: 50%;
  animation: mkt-badge-bounce 1s infinite alternate;
}

/* Chat Window Container */
.mkt-chatbot-window {
  position: fixed;
  bottom: 100px;
  right: 24px;
  width: 380px;
  height: 600px;
  max-height: calc(100vh - 140px);
  background-color: var(--cb-bg-card);
  border: 1px solid var(--cb-border-color);
  border-radius: 16px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.6);
  z-index: 99998;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  font-family: var(--cb-font-body);
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px) scale(0.95);
  transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1),
              transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
              visibility 0.3s;
  pointer-events: none;
}

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

/* Chat Header */
.mkt-chatbot-header {
  background-color: var(--cb-bg-secondary);
  border-bottom: 1px solid var(--cb-border-color);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.mkt-chatbot-profile {
  display: flex;
  align-items: center;
  gap: 12px;
}

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

.mkt-chatbot-avatar {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: var(--cb-gold-light);
  border: 1px solid var(--cb-gold);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--cb-gold);
  font-size: 18px;
}

.mkt-chatbot-status-dot {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 11px;
  height: 11px;
  background-color: #2ecc71;
  border: 2px solid var(--cb-bg-secondary);
  border-radius: 50%;
}

.mkt-chatbot-info {
  display: flex;
  flex-direction: column;
}

.mkt-chatbot-title {
  font-family: var(--cb-font-heading);
  font-weight: 600;
  font-size: 15px;
  color: var(--cb-text-primary);
  margin: 0;
  line-height: 1.2;
}

.mkt-chatbot-status-text {
  font-size: 11px;
  color: #2ecc71;
  margin: 2px 0 0 0;
  font-weight: 500;
}

.mkt-chatbot-close {
  background: transparent;
  border: none;
  color: var(--cb-text-secondary);
  font-size: 18px;
  cursor: pointer;
  padding: 4px;
  transition: var(--cb-transition);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  width: 28px;
  height: 28px;
}

.mkt-chatbot-close:hover {
  color: var(--cb-gold);
  background-color: rgba(255, 255, 255, 0.05);
}

/* Chat Messages Area */
.mkt-chatbot-body {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
  background-image: radial-gradient(rgba(212, 175, 55, 0.02) 1px, transparent 0);
  background-size: 24px 24px;
}

/* Scrollbar styles */
.mkt-chatbot-body::-webkit-scrollbar {
  width: 6px;
}

.mkt-chatbot-body::-webkit-scrollbar-track {
  background: transparent;
}

.mkt-chatbot-body::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
}

.mkt-chatbot-body::-webkit-scrollbar-thumb:hover {
  background: rgba(212, 175, 55, 0.2);
}

/* Message Bubbles */
.mkt-message {
  max-width: 85%;
  padding: 12px 16px;
  font-size: 14px;
  line-height: 1.5;
  letter-spacing: 0.1px;
  word-wrap: break-word;
  animation: mkt-bubble-fade 0.3s ease forwards;
}

.mkt-message-bot {
  background-color: #1c1c1c;
  color: #f3f3f3;
  border-radius: 14px 14px 14px 4px;
  align-self: flex-start;
  border: 1px solid rgba(255, 255, 255, 0.03);
}

.mkt-message-user {
  background-color: var(--cb-gold);
  color: var(--cb-bg-primary);
  border-radius: 14px 14px 4px 14px;
  align-self: flex-end;
  font-weight: 500;
  box-shadow: 0 4px 12px rgba(212, 175, 55, 0.15);
}

/* Links inside bot messages */
.mkt-message-bot a {
  color: var(--cb-gold);
  text-decoration: underline;
  font-weight: 600;
}

.mkt-message-bot a:hover {
  color: var(--cb-gold-hover);
}

/* Typing Indicator */
.mkt-typing-indicator {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background-color: #1c1c1c;
  padding: 12px 18px;
  border-radius: 14px 14px 14px 4px;
  align-self: flex-start;
  border: 1px solid rgba(255, 255, 255, 0.03);
}

.mkt-typing-dot {
  width: 7px;
  height: 7px;
  background-color: var(--cb-text-muted);
  border-radius: 50%;
  animation: mkt-dot-bounce 1.4s infinite ease-in-out both;
}

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

/* Interactive Container (Quick Replies & Forms) */
.mkt-chatbot-interactive-area {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 6px;
  padding-bottom: 4px;
}

/* Quick Reply Option Buttons */
.mkt-option-button {
  background-color: rgba(212, 175, 55, 0.04);
  border: 1px solid var(--cb-border-color);
  color: var(--cb-text-primary);
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 13.5px;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition: var(--cb-transition);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
}

.mkt-option-button:hover {
  background-color: var(--cb-gold-light);
  border-color: var(--cb-gold);
  transform: translateX(4px);
}

.mkt-option-button::after {
  content: "→";
  color: var(--cb-gold);
  font-weight: bold;
  opacity: 0.7;
  transition: var(--cb-transition);
}

.mkt-option-button:hover::after {
  transform: translateX(2px);
  opacity: 1;
}

/* Custom Interactive Form */
.mkt-chatbot-form {
  display: flex;
  gap: 8px;
  background-color: var(--cb-bg-secondary);
  border: 1px solid var(--cb-border-color);
  padding: 8px 12px;
  border-radius: 12px;
  margin-top: 8px;
  transition: var(--cb-transition);
}

.mkt-chatbot-form:focus-within {
  border-color: var(--cb-gold);
  box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.1);
}

.mkt-chatbot-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: #ffffff;
  font-size: 14px;
  font-family: var(--cb-font-body);
  padding: 4px 0;
}

.mkt-chatbot-input::placeholder {
  color: var(--cb-text-muted);
}

.mkt-chatbot-send-btn {
  background-color: var(--cb-gold);
  color: var(--cb-bg-primary);
  border: none;
  outline: none;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--cb-transition);
}

.mkt-chatbot-send-btn:hover {
  background-color: var(--cb-gold-hover);
  transform: scale(1.05);
}

.mkt-chatbot-send-btn i {
  font-size: 14px;
}

/* Special Call To Actions (e.g. WhatsApp button) */
.mkt-cta-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 12px 18px;
  border-radius: 10px;
  font-size: 14.5px;
  font-weight: 600;
  text-decoration: none;
  transition: var(--cb-transition);
  cursor: pointer;
  border: none;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.25);
  margin-top: 8px;
}

.mkt-cta-whatsapp {
  background-color: var(--cb-whatsapp);
  color: #ffffff;
}

.mkt-cta-whatsapp:hover {
  background-color: var(--cb-whatsapp-hover);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(37, 211, 102, 0.35);
}

.mkt-cta-whatsapp i {
  font-size: 18px;
}

/* Chatbot Footer Copyright / Note */
.mkt-chatbot-footer {
  padding: 10px 20px;
  background-color: var(--cb-bg-secondary);
  border-top: 1px solid var(--cb-border-color);
  font-size: 11px;
  color: var(--cb-text-muted);
  text-align: center;
}

/* Animations */
@keyframes mkt-launcher-pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(212, 175, 55, 0.5);
  }
  70% {
    box-shadow: 0 0 0 12px rgba(212, 175, 55, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(212, 175, 55, 0);
  }
}

@keyframes mkt-badge-bounce {
  0% {
    transform: translateY(0);
  }
  100% {
    transform: translateY(-3px);
  }
}

@keyframes mkt-bubble-fade {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes mkt-dot-bounce {
  0%, 80%, 100% { 
    transform: scale(0);
  } 40% { 
    transform: scale(1.0);
  }
}

/* Mobile responsive styles (< 480px) */
@media (max-width: 480px) {
  .mkt-chatbot-window {
    width: 100%;
    height: 100% !important;
    max-height: 100% !important;
    bottom: 0;
    right: 0;
    border-radius: 0;
    border: none;
    z-index: 100000;
  }
  
  .mkt-chatbot-launcher {
    bottom: 16px;
    right: 16px;
  }

  .mkt-chatbot-window.open ~ .mkt-chatbot-launcher {
    display: none;
  }
}
