/* =========================================================
   Brandcepts Chatbot - Floating Widget Styles
   ========================================================= */

:root {
  --brandcepts-primary: #a855f7;
  --brandcepts-secondary: #ec4899;
  --brandcepts-dark: #060606;
  --brandcepts-dark2: #0f0f10;
  --brandcepts-surface: #141418;
  --brandcepts-border: rgba(255, 255, 255, 0.08);
  --brandcepts-text: #ffffff;
  --brandcepts-text-muted: #b5b5c3;
  --brandcepts-shadow: 0 25px 80px rgba(0, 0, 0, 0.65);
}

/* OVERLAY */
#brandcepts-chatbot-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(4px);
  z-index: 99998;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  pointer-events: none;
}

#brandcepts-chatbot-overlay.brandcepts-show {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

/* WRAPPER */
#brandcepts-chatbot-wrapper {
  position: fixed;
  bottom: 24px;
  z-index: 99999;
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* TOGGLE BUTTON */
#brandcepts-chatbot-toggle {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--brandcepts-primary), var(--brandcepts-secondary));
  box-shadow: 0 8px 28px rgba(168, 85, 247, 0.45);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.25s ease;
  position: relative;
  z-index: 2;
  border: none;
}

#brandcepts-chatbot-toggle:hover {
  transform: scale(1.06);
  box-shadow: 0 12px 36px rgba(236, 72, 153, 0.45);
}

#brandcepts-chatbot-toggle svg {
  width: 26px;
  height: 26px;
  color: #fff;
  transition: transform 0.3s ease;
}

.brandcepts-toggle-icon,
.brandcepts-close-icon {
  position: absolute;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.brandcepts-close-icon {
  opacity: 0;
  transform: rotate(-90deg);
}

.brandcepts-open .brandcepts-toggle-icon {
  opacity: 0;
  transform: rotate(90deg);
}

.brandcepts-open .brandcepts-close-icon {
  opacity: 1;
  transform: rotate(0deg);
}

/* PANEL (hidden by default) */
#brandcepts-chatbot-panel {
  position: absolute;
  bottom: 72px;
  width: 420px;
  height: 620px;
  background: rgba(18, 18, 22, 0.96);
  backdrop-filter: blur(16px);
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.04), 0 25px 80px rgba(0, 0, 0, 0.7), 0 0 50px rgba(168, 85, 247, 0.12);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transform: translateY(16px) scale(0.96);
  transform-origin: bottom right;
  transition: all 0.25s cubic-bezier(0.22, 1, 0.36, 1);
}

.brandcepts-open #brandcepts-chatbot-panel {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

/* =========================================================
   INLINE SHORTCODE VARIANT
   ========================================================= */
.brandcepts-chatbot-inline {
  margin: 20px 0;
  max-width: 100%;
}

.brandcepts-chatbot-panel-inline {
  width: 100%;
  max-width: 520px;
  height: 560px;
  background: rgba(18, 18, 22, 0.96);
  backdrop-filter: blur(16px);
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: 0 25px 80px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}

/* =========================================================
   HEADER
   ========================================================= */
.brandcepts-chatbot-header {
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.25), rgba(236, 72, 153, 0.22));
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  padding: 16px 20px 14px;
  display: flex;
  align-items: center;
  gap: 13px;
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(12px);
  flex-shrink: 0;
}

.brandcepts-chatbot-header::before {
  content: '🚀';
  position: absolute;
  right: -10px;
  top: -10px;
  font-size: 80px;
  opacity: 0.05;
  transform: rotate(-15deg);
}

.brandcepts-logo-ring {
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, #a855f7, #ec4899);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
  color: white;
  box-shadow: 0 8px 24px rgba(168, 85, 247, 0.35);
}

.brandcepts-header-text {
  flex: 1;
}

.brandcepts-header-text h2 {
  font-family: 'Playfair Display', 'Georgia', serif;
  font-size: 16px;
  color: #fff;
  font-weight: 700;
  letter-spacing: 0.3px;
  margin: 0;
}

.brandcepts-header-text p {
  font-size: 10.5px;
  color: rgba(255, 255, 255, 0.72);
  margin: 2px 0 0;
  font-weight: 400;
}

.brandcepts-online-pill {
  background: rgba(236, 72, 153, 0.12);
  border: 1px solid rgba(236, 72, 153, 0.3);
  color: #f9a8d4;
  border-radius: 20px;
  padding: 4px 10px;
  font-size: 10px;
  display: flex;
  align-items: center;
  gap: 5px;
  font-weight: 500;
  flex-shrink: 0;
}

.brandcepts-online-dot {
  width: 6px;
  height: 6px;
  background: #ec4899;
  border-radius: 50%;
  animation: brandcepts-pulse-dot 2s ease-in-out infinite;
}

@keyframes brandcepts-pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.8); }
}

/* QUICK CHIPS */
.brandcepts-quick-chips {
  padding: 8px 14px 7px;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  background: rgba(255, 255, 255, 0.02);
  flex-shrink: 0;
}

.brandcepts-chip {
  font-size: 10.5px;
  padding: 5px 11px;
  border: 1px solid rgba(168, 85, 247, 0.25);
  border-radius: 20px;
  color: #e9d5ff;
  background: rgba(168, 85, 247, 0.08);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.18s ease;
  font-weight: 500;
  user-select: none;
}

.brandcepts-chip:hover {
  background: rgba(236, 72, 153, 0.16);
  border-color: #ec4899;
  color: #fff;
  transform: translateY(-1px);
}

/* MESSAGES AREA */
.brandcepts-chatbot-messages {
  flex: 1;
  overflow-y: auto;
  padding: 14px 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  scroll-behavior: smooth;
}

.brandcepts-chatbot-messages::-webkit-scrollbar {
  width: 4px;
}

.brandcepts-chatbot-messages::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.08);
  border-radius: 4px;
}

/* MESSAGE BUBBLES */
.brandcepts-msg {
  display: flex;
  flex-direction: column;
  max-width: 84%;
  animation: brandcepts-msg-in 0.25s ease;
}

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

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

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

.brandcepts-msg-label {
  font-size: 9.5px;
  color: var(--brandcepts-text-muted);
  margin-bottom: 3px;
  padding: 0 4px;
  font-weight: 500;
}

.brandcepts-bubble {
  padding: 10px 14px;
  font-size: 13px;
  line-height: 1.6;
  word-break: break-word;
}

.brandcepts-msg.brandcepts-user .brandcepts-bubble {
  background: linear-gradient(135deg, var(--brandcepts-primary), #7c3aed);
  color: #fff;
  border-radius: 18px 18px 4px 18px;
  box-shadow: 0 6px 20px rgba(168, 85, 247, 0.25);
}

.brandcepts-msg.brandcepts-bot .brandcepts-bubble {
  background: rgba(255, 255, 255, 0.04);
  color: var(--brandcepts-text);
  border-radius: 18px 18px 18px 4px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.22);
  backdrop-filter: blur(10px);
}

.brandcepts-msg-time {
  font-size: 9.5px;
  color: rgba(255, 255, 255, 0.35);
  margin-top: 3px;
  padding: 0 4px;
}

/* TYPING INDICATOR */
.brandcepts-typing .brandcepts-bubble {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 18px 18px 18px 4px;
  padding: 14px 18px;
}

.brandcepts-typing-dots {
  display: flex;
  gap: 5px;
  align-items: center;
}

.brandcepts-typing-dots span {
  width: 7px;
  height: 7px;
  background: var(--brandcepts-secondary);
  border-radius: 50%;
  animation: brandcepts-bounce 1.3s ease-in-out infinite;
}

.brandcepts-typing-dots span:nth-child(2) {
  animation-delay: 0.18s;
}

.brandcepts-typing-dots span:nth-child(3) {
  animation-delay: 0.36s;
}

@keyframes brandcepts-bounce {
  0%, 60%, 100% { transform: translateY(0); }
  30% { transform: translateY(-7px); }
}

/* WELCOME CARD */
.brandcepts-welcome-card {
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.14), rgba(236, 72, 153, 0.10));
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px;
  padding: 20px;
  text-align: center;
  color: white;
  backdrop-filter: blur(10px);
}

.brandcepts-wc-icon {
  font-size: 34px;
  margin-bottom: 8px;
}

.brandcepts-welcome-card h3 {
  font-family: 'Playfair Display', 'Georgia', serif;
  font-size: 15px;
  margin: 0 0 6px;
  color: #fff;
}

.brandcepts-welcome-card p {
  font-size: 12.5px;
  line-height: 1.7;
  color: rgba(255, 255, 255, 0.72);
  margin: 0;
}

.brandcepts-services-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  margin-top: 12px;
}

.brandcepts-svc-badge {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #f5d0fe;
  border-radius: 20px;
  font-size: 10px;
  padding: 4px 10px;
  font-weight: 500;
}

/* ERROR TOAST */
.brandcepts-error-toast {
  display: none;
  background: rgba(239, 68, 68, 0.12);
  color: #fecaca;
  padding: 8px 16px;
  font-size: 11.5px;
  border-top: 1px solid rgba(239, 68, 68, 0.25);
  text-align: center;
  flex-shrink: 0;
}

.brandcepts-error-toast.brandcepts-show {
  display: block;
}

/* INPUT AREA */
.brandcepts-chatbot-input-area {
  padding: 10px 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  gap: 10px;
  align-items: flex-end;
  background: rgba(255, 255, 255, 0.02);
  flex-shrink: 0;
}

.brandcepts-chatbot-input-area textarea {
  flex: 1;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 22px;
  padding: 9px 16px;
  font-size: 13px;
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  resize: none;
  outline: none;
  max-height: 100px;
  line-height: 1.5;
  transition: all 0.2s ease;
  background: rgba(255, 255, 255, 0.04);
  color: #fff;
  backdrop-filter: blur(10px);
}

.brandcepts-chatbot-input-area textarea::placeholder {
  color: rgba(255, 255, 255, 0.4);
}

.brandcepts-chatbot-input-area textarea:focus {
  border-color: var(--brandcepts-primary);
  box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.15);
}

.brandcepts-send-btn {
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, var(--brandcepts-primary), var(--brandcepts-secondary));
  border: none;
  border-radius: 50%;
  cursor: pointer;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 8px 20px rgba(168, 85, 247, 0.35);
  transition: all 0.18s ease;
}

.brandcepts-send-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(236, 72, 153, 0.35);
}

.brandcepts-send-btn:active {
  transform: scale(0.92);
}

.brandcepts-send-btn svg {
  width: 17px;
  height: 17px;
}

/* FOOTER */
.brandcepts-chatbot-footer {
  padding: 6px 14px 8px;
  text-align: center;
  font-size: 9.5px;
  color: rgba(255, 255, 255, 0.45);
  background: rgba(255, 255, 255, 0.02);
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  flex-shrink: 0;
}

.brandcepts-chatbot-footer strong {
  color: #f5d0fe;
}

/* =========================================================
   RESPONSIVE
   ========================================================= */
@media (max-width: 480px) {
  #brandcepts-chatbot-panel {
    position: fixed;
    bottom: 0;
    right: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 0;
    border: none;
    max-height: 100vh;
  }

  #brandcepts-chatbot-wrapper {
    bottom: 16px;
  }

  #brandcepts-chatbot-toggle {
    width: 52px;
    height: 52px;
  }

  .brandcepts-chatbot-panel-inline {
    max-width: 100%;
    border-radius: 12px;
  }
}
