@use "sass:color";

// Custom Support Button for Freshworks Widget
.bpp-support-button {
  position: fixed;
  bottom: 30px;
  right: 30px;
  z-index: 9999;

  // Button styling
  background-color: $primary-color;
  color: white;
  border: none;
  border-radius: 50px;
  padding: 15px 20px;
  font-size: 18px;
  font-weight: bold;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  transition: all 0.3s ease;
  min-width: 60px;
  text-align: center;

  // Content containers
  .button-content {
    position: relative;
    display: inline-block;
  }

  // Default state - showing symbols
  .support-symbols {
    display: inline-block;
    opacity: 1;
    transition: opacity 0.3s ease;
    letter-spacing: 1px;
  }

  // Hover state - showing text
  .support-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    opacity: 0;
    transition: opacity 0.3s ease;
    white-space: nowrap;
    pointer-events: none;
  }

  // Hover effects
  &:hover {
    background-color: color.adjust($primary-color, $lightness: -10%);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
    padding: 15px 46px;  // Increased width on hover by ~15%

    .support-symbols {
      opacity: 0;
    }

    .support-text {
      opacity: 1;
      font-size: 16px;  // Normal font size instead of inheriting 18px
    }
  }

  // Active state
  &:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  }

  // Focus state for accessibility
  &:focus {
    outline: 2px solid color.adjust($primary-color, $lightness: 20%);
    outline-offset: 2px;
  }

  // Mobile responsive adjustments
  @media screen and (max-width: 640px) {
    bottom: 20px;
    right: 20px;
    font-size: 16px;
    padding: 12px 16px;

    &:hover {
      padding: 12px 37px;  // Wider on mobile hover too (increased by ~15%)

      .support-text {
        font-size: 14px;  // Slightly smaller on mobile
      }
    }
  }
}

// Hide when printing
@media print {
  .bpp-support-button {
    display: none;
  }
}
