/* Ben Chat — Atmospheric integration layer
 *
 * Supplements ben-chat-widget.css when Ben is embedded in WordPress.
 * Provides the highlight animation Ben can trigger via highlight_element,
 * corrects positioning for the WordPress admin bar, and styles the
 * ben-chat-trigger pattern and header button.
 */

/* Scroll highlight */
@keyframes cirrusly-ben-highlight-pulse {
  0% {
    outline: 3px solid transparent;
    box-shadow: none;
  }
  25% {
    outline: 3px solid var(--wp--preset--color--sun, #f9d13e);
    box-shadow: 0 0 0 6px rgba(249, 209, 62, 0.22);
  }
  100% {
    outline: 3px solid transparent;
    box-shadow: none;
  }
}

.cirrusly-ben-highlight {
  animation: cirrusly-ben-highlight-pulse 2s ease forwards;
  border-radius: 4px;
  outline-offset: 4px;
}

.cirrusly-ben-launcher-hidden .ben-floating-btn {
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
}

/* Admin bar offset */
@media screen and (max-width: 782px) {
  .admin-bar .ben-floating-btn {
    bottom: 64px;
  }

  .admin-bar .ben-chat-window {
    bottom: 132px;
  }
}

.cirrusly-ben-trigger__inner {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  justify-content: center;
  text-align: center;
}

.cirrusly-ben-trigger__icon {
  display: flex;
  align-items: center;
  color: var(--wp--preset--color--primary, #0945c8);
  flex-shrink: 0;
}

.cirrusly-ben-trigger__text {
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--wp--preset--color--primary-dark, #12123f);
}

.cirrusly-ben-trigger__btn {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.5rem 1.125rem;
  background: var(--wp--preset--color--primary, #0945c8);
  color: #fff;
  border: none;
  border-radius: 999px;
  font-size: 0.875rem;
  font-weight: 600;
  font-family: var(--wp--preset--font-family--primary, inherit);
  cursor: pointer;
  transition: background 0.15s ease;
  text-decoration: none;
}

.cirrusly-ben-trigger__btn:hover,
.cirrusly-ben-trigger__btn:focus-visible {
  background: var(--wp--preset--color--primary-dark, #12123f);
  outline: 2px solid var(--wp--preset--color--primary, #0945c8);
  outline-offset: 2px;
}

.cirrusly-header__ben-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 36px;
  padding: 0.25rem 0.875rem 0.25rem 0.3rem;
  background: var(--wp--preset--color--primary, #0945c8);
  border: 0;
  border-radius: 8px;
  color: #fff;
  font-size: 0.8125rem;
  font-weight: 700;
  font-family: var(--wp--preset--font-family--primary, inherit);
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(9, 69, 200, 0.18);
  transition: background 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
  white-space: nowrap;
  flex-shrink: 0;
}

.cirrusly-header__ben-tooltip {
  position: absolute;
  top: calc(100% + 0.55rem);
  right: 0;
  width: max-content;
  max-width: 220px;
  padding: 0.45rem 0.6rem;
  border-radius: 8px;
  background: var(--wp--preset--color--primary-dark, #12123f);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.25;
  opacity: 0;
  pointer-events: none;
  text-align: left;
  transform: translateY(-3px);
  transition: opacity 0.15s ease, transform 0.15s ease;
  z-index: 1001;
}

.cirrusly-header__ben-tooltip::before {
  content: "";
  position: absolute;
  top: -5px;
  right: 1rem;
  width: 10px;
  height: 10px;
  background: inherit;
  transform: rotate(45deg);
}

.cirrusly-header__ben-btn:hover .cirrusly-header__ben-tooltip,
.cirrusly-header__ben-btn:focus-visible .cirrusly-header__ben-tooltip {
  opacity: 1;
  transform: translateY(0);
}

.cirrusly-header__ben-btn:hover,
.cirrusly-header__ben-btn:focus-visible {
  background: var(--wp--preset--color--primary-dark, #12123f);
  color: #fff;
  box-shadow: 0 10px 22px rgba(18, 18, 63, 0.2);
  outline: 2px solid rgba(9, 69, 200, 0.22);
  outline-offset: 2px;
  transform: translateY(-1px);
}

.cirrusly-header__ben-avatar {
  width: 28px;
  height: 28px;
  border: 2px solid rgba(255, 255, 255, 0.75);
  border-radius: 999px;
  object-fit: cover;
}

@media (max-width: 600px) {
  .cirrusly-header__ben-btn__label {
    display: none;
  }

  .cirrusly-header__ben-btn {
    padding: 0.25rem;
  }

  .cirrusly-header__ben-tooltip {
    right: -0.35rem;
    max-width: 190px;
  }
}
