.beeuptech-chatbot {
  position: fixed;
  right: 28px;
  bottom: 128px;
  z-index: 9999;
  font-family: inherit;
  color: #0f172a;

  /* Brand-driven tokens (fallbacks if brand.css is not loaded) */
  --b-orange: var(--beeup-orange, #F69011);
  --b-orange-700: var(--beeup-orange-700, #D9790A);
  --b-navy: var(--beeup-navy, #08284F);
  --b-navy-900: var(--beeup-navy-900, #061E3A);
  --b-cyan: var(--beeup-cyan, #0BAEE1);
  --b-cyan-200: var(--beeup-cyan-200, #AEEAF7);

  /* Surface */
  --panel-bg: rgba(255, 255, 255, 0.78);
  --panel-border: rgba(11, 174, 225, 0.18);
  --panel-shadow: 0 24px 70px rgba(6, 30, 58, 0.24);
  --panel-glow: 0 0 0 1px rgba(246, 144, 17, 0.10), 0 18px 40px rgba(11, 174, 225, 0.10);

  /* Motion */
  --shader-speed: 10s;
  --shader-speed-fast: 3.6s;
}

.beeuptech-chatbot__toggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border: none;
  border-radius: 999px;
  padding: 12px 18px;
  background:
    radial-gradient(120% 160% at 18% 10%, rgba(255, 255, 255, 0.35) 0%, rgba(255, 255, 255, 0) 55%),
    linear-gradient(120deg, var(--b-navy) 0%, var(--b-cyan) 42%, var(--b-orange) 78%, var(--b-navy) 100%);
  background-size: 100% 100%, 320% 320%;
  background-position: 0 0, 0% 50%;
  color: #ffffff;
  font-weight: 600;
  box-shadow:
    0 18px 34px rgba(6, 30, 58, 0.20),
    0 12px 26px rgba(246, 144, 17, 0.18),
    0 0 0 1px rgba(255, 255, 255, 0.16) inset;
  transition: transform 0.18s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.22s ease, filter 0.22s ease;
  position: relative;
  overflow: hidden;
  isolation: isolate;
  will-change: transform, box-shadow, filter;
  animation:
    beeuptech-chatbot-scale 3.8s ease-in-out infinite,
    beeuptech-chatbot-toggle-gradient var(--shader-speed) linear infinite,
    beeuptech-chatbot-toggle-glow 2.8s ease-in-out infinite;
}

/* Animated “shader” sheen + border glow */
.beeuptech-chatbot__toggle::before {
  content: "";
  position: absolute;
  inset: -2px;
  border-radius: 999px;
  background:
    conic-gradient(
      from 180deg,
      rgba(11, 174, 225, 0.0) 0deg,
      rgba(11, 174, 225, 0.55) 85deg,
      rgba(246, 144, 17, 0.55) 160deg,
      rgba(8, 40, 79, 0.45) 240deg,
      rgba(11, 174, 225, 0.0) 360deg
    );
  filter: blur(10px);
  opacity: 0.55;
  transform: translateZ(0);
  animation: beeuptech-chatbot-conic var(--shader-speed-fast) linear infinite;
  pointer-events: none;
  z-index: -1;
}

.beeuptech-chatbot__toggle::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background:
    linear-gradient(110deg, rgba(255, 255, 255, 0) 35%, rgba(255, 255, 255, 0.38) 48%, rgba(255, 255, 255, 0) 60%);
  transform: translateX(-120%);
  opacity: 0.85;
  mix-blend-mode: overlay;
  animation: beeuptech-chatbot-sheen 2.8s ease-in-out infinite;
  pointer-events: none;
}

.beeuptech-chatbot__toggle:focus-visible,
.beeuptech-chatbot__close:focus-visible,
.beeuptech-chatbot__send:focus-visible {
  outline: 2px solid var(--b-cyan);
  outline-offset: 2px;
}

.beeuptech-chatbot__toggle:hover {
  transform: translateY(-3px) scale(1.01);
  filter: saturate(1.05) contrast(1.02);
  box-shadow:
    0 22px 44px rgba(6, 30, 58, 0.24),
    0 18px 34px rgba(246, 144, 17, 0.22),
    0 0 0 1px rgba(255, 255, 255, 0.20) inset;
}

.beeuptech-chatbot__toggle:active {
  transform: translateY(-1px) scale(0.995);
  box-shadow:
    0 12px 26px rgba(6, 30, 58, 0.20),
    0 10px 22px rgba(246, 144, 17, 0.18),
    0 0 0 1px rgba(255, 255, 255, 0.18) inset;
}

.beeuptech-chatbot__toggle-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
  box-shadow: 0 10px 20px rgba(6, 30, 58, 0.16);
}

.beeuptech-chatbot__panel {
  position: absolute;
  right: 0;
  bottom: 64px;
  width: 360px;
  max-width: calc(100vw - 40px);
  background: var(--panel-bg);
  border-radius: 18px;
  border: 1px solid var(--panel-border);
  box-shadow: var(--panel-shadow), var(--panel-glow);
  opacity: 0;
  transform: translateY(14px) scale(0.98);
  pointer-events: none;
  transition: opacity 0.22s ease, transform 0.26s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
  will-change: transform, opacity;
}

.beeuptech-chatbot__panel::before {
  content: "";
  position: absolute;
  inset: -2px;
  background:
    radial-gradient(140% 140% at 0% 0%, rgba(11, 174, 225, 0.18) 0%, rgba(11, 174, 225, 0) 55%),
    radial-gradient(130% 140% at 100% 0%, rgba(246, 144, 17, 0.18) 0%, rgba(246, 144, 17, 0) 58%),
    radial-gradient(160% 160% at 50% 110%, rgba(8, 40, 79, 0.14) 0%, rgba(8, 40, 79, 0) 55%);
  opacity: 0.9;
  pointer-events: none;
  transform: translate3d(0, 0, 0);
  animation: beeuptech-chatbot-panel-shift 14s ease-in-out infinite;
}

.beeuptech-chatbot__panel::after {
  /* subtle “noise” texture without images */
  content: "";
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.022) 0px, rgba(255, 255, 255, 0.022) 1px, rgba(0, 0, 0, 0) 2px, rgba(0, 0, 0, 0) 4px);
  opacity: 0.45;
  mix-blend-mode: overlay;
  pointer-events: none;
}

@supports ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .beeuptech-chatbot__panel {
    backdrop-filter: blur(18px) saturate(140%);
    -webkit-backdrop-filter: blur(18px) saturate(140%);
  }
}

.beeuptech-chatbot[data-open="true"] .beeuptech-chatbot__panel {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.beeuptech-chatbot__header,
.beeuptech-chatbot__messages,
.beeuptech-chatbot__suggestions,
.beeuptech-chatbot__form {
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.22s ease, transform 0.26s cubic-bezier(0.16, 1, 0.3, 1);
}

.beeuptech-chatbot[data-open="true"] .beeuptech-chatbot__header {
  opacity: 1;
  transform: translateY(0);
  transition-delay: 0.04s;
}

.beeuptech-chatbot[data-open="true"] .beeuptech-chatbot__messages {
  opacity: 1;
  transform: translateY(0);
  transition-delay: 0.08s;
}

.beeuptech-chatbot[data-open="true"] .beeuptech-chatbot__suggestions {
  opacity: 1;
  transform: translateY(0);
  transition-delay: 0.11s;
}

.beeuptech-chatbot[data-open="true"] .beeuptech-chatbot__form {
  opacity: 1;
  transform: translateY(0);
  transition-delay: 0.14s;
}

.beeuptech-chatbot__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px;
  background:
    radial-gradient(120% 140% at 0% 0%, rgba(11, 174, 225, 0.12) 0%, rgba(11, 174, 225, 0) 60%),
    radial-gradient(120% 140% at 100% 0%, rgba(246, 144, 17, 0.12) 0%, rgba(246, 144, 17, 0) 60%),
    rgba(248, 250, 252, 0.72);
  border-bottom: 1px solid rgba(226, 232, 240, 0.85);
  position: relative;
  z-index: 1;
}

.beeuptech-chatbot__title h4 {
  margin: 0 0 4px;
  font-size: 16px;
  font-weight: 700;
}

.beeuptech-chatbot__title p {
  margin: 0;
  font-size: 12px;
  color: #64748b;
}

.beeuptech-chatbot__close {
  border: none;
  background: transparent;
  color: #64748b;
  font-size: 18px;
  padding: 6px;
  border-radius: 10px;
  transition: transform 0.2s ease, color 0.2s ease, background-color 0.2s ease;
}

.beeuptech-chatbot__close:hover {
  transform: rotate(90deg);
  color: var(--b-cyan);
  background: rgba(11, 174, 225, 0.12);
}

.beeuptech-chatbot__messages {
  padding: 16px 18px 8px;
  max-height: 320px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: relative;
  z-index: 1;
  background:
    radial-gradient(120% 90% at 10% 0%, rgba(11, 174, 225, 0.08) 0%, rgba(11, 174, 225, 0) 55%),
    radial-gradient(120% 90% at 90% 0%, rgba(246, 144, 17, 0.06) 0%, rgba(246, 144, 17, 0) 60%);
}

.beeuptech-chatbot__messages::-webkit-scrollbar {
  width: 10px;
}
.beeuptech-chatbot__messages::-webkit-scrollbar-track {
  background: rgba(15, 23, 42, 0.06);
  border-radius: 999px;
}
.beeuptech-chatbot__messages::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(11, 174, 225, 0.55), rgba(246, 144, 17, 0.55));
  border-radius: 999px;
  border: 2px solid rgba(255, 255, 255, 0.55);
}

.beeuptech-chatbot__bubble {
  padding: 10px 12px;
  border-radius: 14px;
  font-size: 13px;
  line-height: 1.5;
  max-width: 85%;
  will-change: transform, opacity;
  position: relative;
  box-shadow: 0 10px 22px rgba(6, 30, 58, 0.10);
}

.beeuptech-chatbot__bubble--enter {
  animation: beeuptech-chatbot-pop 0.26s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.beeuptech-chatbot__bubble--bot {
  background:
    radial-gradient(120% 140% at 0% 0%, rgba(11, 174, 225, 0.18) 0%, rgba(11, 174, 225, 0) 55%),
    rgba(239, 246, 255, 0.9);
  color: #0f172a;
  align-self: flex-start;
  border-top-left-radius: 4px;
  border: 1px solid rgba(11, 174, 225, 0.14);
}

.beeuptech-chatbot__bubble--typing::after {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-left: 6px;
  background: var(--b-cyan);
  border-radius: 999px;
  box-shadow:
    10px 0 0 rgba(11, 174, 225, 0.35),
    20px 0 0 rgba(11, 174, 225, 0.18);
  animation: beeuptech-chatbot-dots 1.15s ease-in-out infinite;
  vertical-align: middle;
}

.beeuptech-chatbot__bubble--user {
  background:
    radial-gradient(120% 150% at 0% 0%, rgba(255, 255, 255, 0.30) 0%, rgba(255, 255, 255, 0) 55%),
    linear-gradient(135deg, var(--b-orange) 0%, #FFC06B 60%, var(--b-orange-700) 100%);
  color: #ffffff;
  align-self: flex-end;
  border-top-right-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.10);
}

.beeuptech-chatbot__bubble--user::after {
  /* subtle moving highlight for “premium” feel */
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(115deg, rgba(255, 255, 255, 0) 30%, rgba(255, 255, 255, 0.26) 48%, rgba(255, 255, 255, 0) 66%);
  transform: translateX(-110%);
  opacity: 0.7;
  mix-blend-mode: overlay;
  pointer-events: none;
  animation: beeuptech-chatbot-sheen 4.2s ease-in-out infinite;
}

.beeuptech-chatbot__bubble a {
  color: inherit;
  text-decoration: underline;
}

.beeuptech-chatbot__suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 18px 12px;
  position: relative;
  z-index: 1;
}

.beeuptech-chatbot__suggestion {
  border: 1px solid rgba(226, 232, 240, 0.85);
  background:
    radial-gradient(120% 200% at 10% 0%, rgba(11, 174, 225, 0.08) 0%, rgba(11, 174, 225, 0) 55%),
    rgba(255, 255, 255, 0.92);
  color: #1f2937;
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12px;
  transition: border-color 0.2s ease, color 0.2s ease, transform 0.2s ease, background-color 0.2s ease, box-shadow 0.25s ease, filter 0.25s ease;
}

.beeuptech-chatbot__suggestion:hover {
  border-color: rgba(11, 174, 225, 0.55);
  color: var(--b-navy);
  transform: translateY(-2px);
  background-color: rgba(217, 244, 251, 0.7);
  filter: saturate(1.05);
  box-shadow: 0 12px 24px rgba(6, 30, 58, 0.10);
}

.beeuptech-chatbot__suggestion:active {
  transform: translateY(-1px);
}

.beeuptech-chatbot__form {
  display: flex;
  gap: 8px;
  padding: 12px 16px 16px;
  border-top: 1px solid rgba(226, 232, 240, 0.85);
  position: relative;
  z-index: 1;
}

.beeuptech-chatbot__form input {
  flex: 1;
  border: 1px solid rgba(226, 232, 240, 0.95);
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 13px;
  background: rgba(255, 255, 255, 0.92);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.beeuptech-chatbot__form input:focus {
  outline: none;
  border-color: rgba(11, 174, 225, 0.85);
  box-shadow: 0 0 0 4px rgba(11, 174, 225, 0.16);
  transform: translateY(-1px);
}

.beeuptech-chatbot__send {
  border: none;
  border-radius: 12px;
  background:
    radial-gradient(140% 180% at 20% 0%, rgba(255, 255, 255, 0.18) 0%, rgba(255, 255, 255, 0) 55%),
    linear-gradient(120deg, var(--b-navy) 0%, #0B315E 55%, var(--b-cyan) 120%);
  background-size: 100% 100%, 260% 260%;
  background-position: 0 0, 0% 50%;
  color: #ffffff;
  padding: 0 14px;
  font-size: 14px;
  box-shadow: 0 14px 28px rgba(6, 30, 58, 0.20);
  transition: transform 0.15s ease, box-shadow 0.2s ease, filter 0.2s ease;
  animation: beeuptech-chatbot-toggle-gradient 8s linear infinite;
}

.beeuptech-chatbot__send:hover {
  transform: translateY(-1px);
  box-shadow: 0 18px 36px rgba(6, 30, 58, 0.22);
  filter: brightness(1.02);
}

.beeuptech-chatbot__send:active {
  transform: translateY(0);
  filter: brightness(0.98);
}

.beeuptech-chatbot__hidden {
  display: none;
}

@media (max-width: 767px) {
  .beeuptech-chatbot {
    right: 16px;
    bottom: 104px;
  }

  .beeuptech-chatbot__panel {
    width: min(360px, calc(100vw - 24px));
  }

  .beeuptech-chatbot__toggle-text {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .beeuptech-chatbot__toggle,
  .beeuptech-chatbot__panel,
  .beeuptech-chatbot__toggle::before,
  .beeuptech-chatbot__toggle::after,
  .beeuptech-chatbot__panel::before,
  .beeuptech-chatbot__panel::after,
  .beeuptech-chatbot__header,
  .beeuptech-chatbot__messages,
  .beeuptech-chatbot__suggestions,
  .beeuptech-chatbot__form,
  .beeuptech-chatbot__bubble--enter,
  .beeuptech-chatbot__bubble--user::after,
  .beeuptech-chatbot__bubble--typing::after {
    transition: none;
    animation: none;
  }
}

@keyframes beeuptech-chatbot-pop {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes beeuptech-chatbot-dots {
  0% {
    opacity: 0.25;
    box-shadow:
      10px 0 0 rgba(11, 174, 225, 0.25),
      20px 0 0 rgba(11, 174, 225, 0.25);
  }
  30% {
    opacity: 1;
    box-shadow:
      10px 0 0 rgba(11, 174, 225, 0.25),
      20px 0 0 rgba(11, 174, 225, 0.25);
  }
  55% {
    opacity: 0.25;
    box-shadow:
      10px 0 0 rgba(11, 174, 225, 1),
      20px 0 0 rgba(11, 174, 225, 0.25);
  }
  80% {
    opacity: 0.25;
    box-shadow:
      10px 0 0 rgba(11, 174, 225, 0.25),
      20px 0 0 rgba(11, 174, 225, 1);
  }
  100% {
    opacity: 0.25;
    box-shadow:
      10px 0 0 rgba(11, 174, 225, 0.25),
      20px 0 0 rgba(11, 174, 225, 0.25);
  }
}

@keyframes beeuptech-chatbot-pulse {
  0% {
    transform: scale(0.92);
    opacity: 0.8;
  }
  70% {
    transform: scale(1.05);
    opacity: 0;
  }
  100% {
    opacity: 0;
  }
}

@keyframes beeuptech-chatbot-scale {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.04);
  }
}

@keyframes beeuptech-chatbot-toggle-gradient {
  0% {
    background-position: 0 0, 0% 50%;
  }
  50% {
    background-position: 0 0, 100% 50%;
  }
  100% {
    background-position: 0 0, 0% 50%;
  }
}

@keyframes beeuptech-chatbot-toggle-glow {
  0%,
  100% {
    filter: drop-shadow(0 10px 18px rgba(6, 30, 58, 0.10));
  }
  50% {
    filter: drop-shadow(0 14px 24px rgba(11, 174, 225, 0.16)) drop-shadow(0 12px 20px rgba(246, 144, 17, 0.12));
  }
}

@keyframes beeuptech-chatbot-sheen {
  0% {
    transform: translateX(-120%);
    opacity: 0.0;
  }
  35% {
    opacity: 0.8;
  }
  55% {
    transform: translateX(120%);
    opacity: 0.0;
  }
  100% {
    transform: translateX(120%);
    opacity: 0.0;
  }
}

@keyframes beeuptech-chatbot-conic {
  to {
    transform: rotate(360deg);
  }
}

@keyframes beeuptech-chatbot-panel-shift {
  0% {
    transform: translate3d(-8px, -6px, 0) scale(1.02);
    opacity: 0.85;
  }
  50% {
    transform: translate3d(10px, 8px, 0) scale(1.03);
    opacity: 0.95;
  }
  100% {
    transform: translate3d(-8px, -6px, 0) scale(1.02);
    opacity: 0.85;
  }
}
