/* ==========================================================================
   Falles360 Chatbot - Modern SaaS Style (Apple / Linear / Stripe Aesthetics)
   ========================================================================== */

/* Font Family Fallback */
:root {
  --f360-bg: #09090b;
  --f360-card-bg: rgba(18, 18, 22, 0.92);
  --f360-border: rgba(255, 255, 255, 0.1);
  --f360-primary: #dc6a47;
  --f360-primary-hover: #ea8311;
  --f360-text-main: #f4f4f5;
  --f360-text-muted: #a1a1aa;
  --f360-user-msg: linear-gradient(135deg, #cf630c 0%, #dc6a47 100%);
  --f360-bot-msg: rgba(255, 255, 255, 0.06);
  --f360-shadow: 0 20px 50px rgba(0, 0, 0, 0.6), 0 0 2px rgba(220, 106, 71, 0.3);
  --f360-font: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Base Reset for Chatbot Components */
.f360-chatbot-root * {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: var(--f360-font);
}

.f360-chatbot-root {
  position: fixed !important;
  bottom: 24px !important;
  right: 24px !important;
  z-index: 999999 !important;
  margin: 0 !important;
  padding: 0 !important;
  line-height: normal;
}

/* --------------------------------------------------------------------------
   Floating Trigger Button (Sleek Formatted Pill FAB)
   -------------------------------------------------------------------------- */
.f360-chat-trigger {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 8px !important;
  padding: 12px 20px !important;
  height: 48px !important;
  border-radius: 9999px !important;
  background: linear-gradient(135deg, #dc6a47 0%, #ea8311 100%) !important;
  color: #ffffff !important;
  border: 1px solid rgba(255, 255, 255, 0.3) !important;
  font-size: 14px !important;
  font-weight: 700 !important;
  letter-spacing: 0.2px !important;
  cursor: pointer !important;
  box-shadow: 0 8px 24px rgba(220, 106, 71, 0.5), 0 2px 8px rgba(0, 0, 0, 0.4) !important;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1) !important;
  outline: none !important;
  text-decoration: none !important;
  white-space: nowrap !important;
  position: relative !important;
}

.f360-chat-trigger:hover {
  transform: scale(1.05) translateY(-2px) !important;
  box-shadow: 0 12px 30px rgba(220, 106, 71, 0.7), 0 4px 12px rgba(0, 0, 0, 0.5) !important;
  border-color: rgba(255, 255, 255, 0.6) !important;
}

.f360-chat-trigger:active {
  transform: scale(0.96) !important;
}

.f360-chat-trigger:focus-visible {
  outline: 2px solid #ffffff !important;
  outline-offset: 3px !important;
}

.f360-trigger-icon-chat,
.f360-trigger-icon-close {
  width: 20px !important;
  height: 20px !important;
  stroke: #ffffff !important;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.2s ease !important;
  flex-shrink: 0 !important;
}

.f360-trigger-icon-close {
  display: none !important;
}

.f360-chat-trigger.active .f360-trigger-icon-chat,
.f360-chatbot-root.is-open .f360-trigger-icon-chat {
  display: none !important;
}

.f360-chat-trigger.active .f360-trigger-icon-close,
.f360-chatbot-root.is-open .f360-trigger-icon-close {
  display: block !important;
}

.f360-trigger-text {
  font-size: 14px !important;
  font-weight: 700 !important;
  color: #ffffff !important;
}

/* Online status dot badge */
.f360-badge-dot {
  width: 9px !important;
  height: 9px !important;
  background-color: #10b981 !important;
  border: 1.5px solid #09090b !important;
  border-radius: 50% !important;
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.9) !important;
  flex-shrink: 0 !important;
}

/* --------------------------------------------------------------------------
   Chatbot Window
   -------------------------------------------------------------------------- */
.f360-chat-window {
  display: none !important;
  position: absolute !important;
  bottom: 64px !important;
  right: 0 !important;
  width: 380px !important;
  height: 560px !important;
  max-height: calc(100vh - 100px) !important;
  background: var(--f360-card-bg) !important;
  backdrop-filter: blur(28px) !important;
  -webkit-backdrop-filter: blur(28px) !important;
  border: 1px solid var(--f360-border) !important;
  border-radius: 24px !important;
  box-shadow: var(--f360-shadow) !important;
  flex-direction: column !important;
  overflow: hidden !important;
  opacity: 0 !important;
  visibility: hidden !important;
  transform: scale(0.92) translateY(12px) !important;
  transform-origin: bottom right !important;
  pointer-events: none !important;
  transition: opacity 250ms cubic-bezier(0.16, 1, 0.3, 1),
    transform 250ms cubic-bezier(0.16, 1, 0.3, 1),
    visibility 250ms cubic-bezier(0.16, 1, 0.3, 1) !important;
  z-index: 999998 !important;
}

.f360-chat-window.active {
  display: flex !important;
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: auto !important;
  transform: scale(1) translateY(0) !important;
}

/* Responsive Window */
@media (max-width: 480px) {
  .f360-chatbot-root {
    right: 14px !important;
    bottom: 14px !important;
  }

  .f360-chat-trigger {
    height: 44px !important;
    padding: 10px 16px !important;
    font-size: 13px !important;
  }

  .f360-trigger-icon-chat,
  .f360-trigger-icon-close {
    width: 18px !important;
    height: 18px !important;
  }

  .f360-chat-window {
    position: fixed !important;
    top: auto !important;
    bottom: 68px !important;
    left: 12px !important;
    right: 12px !important;
    width: calc(100vw - 24px) !important;
    max-width: calc(100% - 24px) !important;
    height: 75vh !important;
    max-height: 540px !important;
    border-radius: 20px !important;
  }
}

/* --------------------------------------------------------------------------
   Header
   -------------------------------------------------------------------------- */
.f360-chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid var(--f360-border);
}

.f360-header-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.f360-header-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--f360-text-main);
  display: flex;
  align-items: center;
  gap: 6px;
}

.f360-header-sub {
  font-size: 12px;
  color: var(--f360-text-muted);
  display: flex;
  align-items: center;
  gap: 8px;
}

.f360-online-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: #10b981;
  font-weight: 600;
  font-size: 11px;
}

.f360-online-dot {
  width: 7px;
  height: 7px;
  background-color: #10b981;
  border-radius: 50%;
  box-shadow: 0 0 10px #10b981;
}

.f360-close-btn {
  background: transparent;
  border: none;
  color: var(--f360-text-muted);
  cursor: pointer;
  padding: 6px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.f360-close-btn:hover {
  color: var(--f360-text-main);
  background: rgba(255, 255, 255, 0.08);
}

.f360-close-btn svg {
  width: 18px;
  height: 18px;
}

/* --------------------------------------------------------------------------
   Messages Body
   -------------------------------------------------------------------------- */
.f360-chat-body {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Custom Scrollbar */
.f360-chat-body::-webkit-scrollbar {
  width: 6px;
}

.f360-chat-body::-webkit-scrollbar-track {
  background: transparent;
}

.f360-chat-body::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 99px;
}

.f360-chat-body::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.25);
}

/* Message Item */
.f360-msg {
  display: flex;
  flex-direction: column;
  max-width: 85%;
  font-size: 13.5px;
  line-height: 1.55;
  animation: f360-slide-up 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.f360-msg-bot {
  align-self: flex-start;
  background: var(--f360-bot-msg);
  border: 1px solid var(--f360-border);
  color: var(--f360-text-main);
  padding: 12px 16px;
  border-radius: 18px 18px 18px 4px;
  white-space: pre-wrap;
}

.f360-msg-user {
  align-self: flex-end;
  background: var(--f360-user-msg);
  color: #ffffff;
  padding: 12px 16px;
  border-radius: 18px 18px 4px 18px;
  box-shadow: 0 4px 15px rgba(220, 106, 71, 0.2);
  white-space: pre-wrap;
}

/* Chips Container */
.f360-chips-wrapper {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
}

.f360-chip {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--f360-text-main);
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.f360-chip:hover {
  background: rgba(220, 106, 71, 0.25);
  border-color: rgba(220, 106, 71, 0.5);
  color: #ffffff;
  transform: translateY(-1px);
}

/* Inline Lead Form inside Chat Stream */
.f360-chat-inline-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(220, 106, 71, 0.3);
  padding: 14px;
  border-radius: 16px;
  animation: f360-slide-up 0.25s ease forwards;
}

.f360-chat-inline-form input {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--f360-border);
  color: var(--f360-text-main);
  font-size: 12px;
  padding: 8px 12px;
  border-radius: 10px;
  outline: none;
}

.f360-chat-inline-form input:focus {
  border-color: var(--f360-primary);
}

.f360-chat-inline-form button {
  background: var(--f360-primary);
  color: #ffffff;
  font-size: 12px;
  font-weight: 700;
  padding: 9px;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.2s ease;
}

.f360-chat-inline-form button:hover {
  background: var(--f360-primary-hover);
}

/* Typing Indicator */
.f360-typing-indicator {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 12px 16px;
  background: var(--f360-bot-msg);
  border: 1px solid var(--f360-border);
  border-radius: 18px 18px 18px 4px;
  width: fit-content;
  align-self: flex-start;
}

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

.f360-dot:nth-child(1) {
  animation-delay: -0.32s;
}

.f360-dot:nth-child(2) {
  animation-delay: -0.16s;
}

/* --------------------------------------------------------------------------
   Input Footer
   -------------------------------------------------------------------------- */
.f360-chat-input-area {
  padding: 16px;
  background: rgba(0, 0, 0, 0.2);
  border-top: 1px solid var(--f360-border);
}

.f360-input-form {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--f360-border);
  border-radius: 16px;
  padding: 6px 8px 6px 16px;
  transition: border-color 0.2s ease;
}

.f360-input-form:focus-within {
  border-color: rgba(220, 106, 71, 0.5);
  box-shadow: 0 0 0 2px rgba(220, 106, 71, 0.15);
}

.f360-chat-input {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--f360-text-main);
  font-size: 13.5px;
  outline: none;
}

.f360-chat-input::placeholder {
  color: #71717a;
}

.f360-send-btn {
  background: var(--f360-primary);
  border: none;
  color: #ffffff;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.f360-send-btn:hover {
  background: var(--f360-primary-hover);
  transform: scale(1.05);
}

.f360-send-btn svg {
  width: 16px;
  height: 16px;
}

/* Keyframes */
@keyframes f360-slide-up {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

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

@keyframes f360-bounce {

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

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