/**
 * MM Chatbot Floating Widget Button
 *
 * Provides a fixed-position button that appears when the chatbot
 * is scrolled out of view, enabling quick navigation back to the chat.
 */

/* ==================== Base Button Styles ==================== */

.mm-chatbot-float-btn {
  /* Positioning */
  position: fixed;
  bottom: 32px;
  right: 32px;
  z-index: 9998;

  /* Dimensions */
  height: 72px;
  width: auto;
  min-width: 72px;
  padding: 12px 24px 12px 12px;

  /* Visual Design */
  background: linear-gradient(135deg, #ffffff 0%, #f9fafd 100%);
  border: 2px solid #2e3192;
  border-radius: 36px;
  box-shadow: 0 4px 16px rgba(46, 49, 146, 0.25);

  /* Layout */
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;

  /* Interaction */
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);

  /* Initial hidden state */
  opacity: 0;
  transform: translateY(100px) scale(0.9);
  pointer-events: none;
}

/* ==================== Visibility States ==================== */

.mm-chatbot-float-btn.mm-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: all;
}

/* ==================== Interaction States ==================== */

.mm-chatbot-float-btn:hover {
  transform: translateY(-4px) scale(1.03);
  box-shadow: 0 8px 24px rgba(46, 49, 146, 0.35);
  border-color: #1b235a;
  background: linear-gradient(135deg, #ffffff 0%, #f0f2f8 100%);
}

.mm-chatbot-float-btn:active {
  transform: translateY(-2px) scale(0.98);
  box-shadow: 0 4px 12px rgba(46, 49, 146, 0.3);
  transition: all 0.1s cubic-bezier(0.4, 0, 0.2, 1);
}

.mm-chatbot-float-btn:focus {
  outline: 3px solid rgba(46, 49, 146, 0.4);
  outline-offset: 4px;
}

.mm-chatbot-float-btn:focus:not(:focus-visible) {
  outline: none;
}

/* ==================== Icon Styles ==================== */

.mm-chatbot-float-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  transition: transform 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  border: 2px solid #fff;
}

.mm-chatbot-float-btn:hover .mm-chatbot-float-icon {
  transform: scale(1.1) rotate(5deg);
}

/* ==================== Label Styles ==================== */

.mm-chatbot-float-label {
  font-size: 16px;
  font-weight: 600;
  color: #2e3192;
  white-space: nowrap;
  letter-spacing: 0.01em;
  transition: color 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  text-shadow: 0 1px 2px rgba(30, 34, 54, 0.05);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.mm-chatbot-float-btn:hover .mm-chatbot-float-label {
  color: #1b235a;
}

/* ==================== Pulse Animation ==================== */

@keyframes mm-pulse {
  0%, 100% {
    box-shadow: 0 4px 16px rgba(46, 49, 146, 0.25);
  }
  50% {
    box-shadow: 0 4px 24px rgba(46, 49, 146, 0.45),
                0 0 0 8px rgba(46, 49, 146, 0.1),
                0 0 0 16px rgba(46, 49, 146, 0.05);
  }
}

.mm-chatbot-float-btn.mm-pulse {
  animation: mm-pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* ==================== Mobile Responsive ==================== */

@media (max-width: 768px) {
  .mm-chatbot-float-btn {
    bottom: 20px;
    right: 20px;
    height: 60px;
    padding: 8px 16px 8px 8px;
    gap: 8px;
  }

  .mm-chatbot-float-icon {
    width: 40px;
    height: 40px;
  }

  .mm-chatbot-float-label {
    font-size: 14px;
  }
}

/* ==================== Very Small Screens ==================== */

@media (max-width: 480px) {
  .mm-chatbot-float-label {
    display: none;
  }

  .mm-chatbot-float-btn {
    padding: 10px;
    min-width: 60px;
    width: 60px;
    height: 60px;
    justify-content: center;
  }
}

/* ==================== Reduced Motion Support ==================== */

@media (prefers-reduced-motion: reduce) {
  .mm-chatbot-float-btn,
  .mm-chatbot-float-icon,
  .mm-chatbot-float-label {
    transition: none;
    animation: none;
  }

  .mm-chatbot-float-btn.mm-pulse {
    animation: none;
  }
}

/* ==================== Print Styles ==================== */

@media print {
  .mm-chatbot-float-btn {
    display: none !important;
  }
}

/* ==================== High Contrast Mode ==================== */

@media (prefers-contrast: high) {
  .mm-chatbot-float-btn {
    border-width: 3px;
    border-color: #000;
  }

  .mm-chatbot-float-label {
    color: #000;
    text-shadow: none;
  }
}

/* ==================== Dark Mode Support (Future) ==================== */

@media (prefers-color-scheme: dark) {
  .mm-chatbot-float-btn {
    background: linear-gradient(135deg, #1a1a1a 0%, #2a2a2a 100%);
    border-color: #4a4ebf;
    box-shadow: 0 4px 16px rgba(74, 78, 191, 0.4);
  }

  .mm-chatbot-float-btn:hover {
    background: linear-gradient(135deg, #2a2a2a 0%, #3a3a3a 100%);
    border-color: #5b5fc7;
    box-shadow: 0 8px 24px rgba(74, 78, 191, 0.5);
  }

  .mm-chatbot-float-label {
    color: #5b5fc7;
  }

  .mm-chatbot-float-btn:hover .mm-chatbot-float-label {
    color: #7b7fd7;
  }
}