:root {
  --aubie-orange: #fd9800; /* Accent */
  --aubie-dark: #181818;   /* Background */
  --aubie-text: #ffffff;   /* Text color */
  --aubie-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

/* Container */
.aubie-container {
  position: fixed;
  bottom: 20px;
  z-index: 1002;
  font-family: "Open Sans", system-ui, sans-serif;
}

/* Placement modifiers */
.aubie-container.aubie-right { right: 20px; left: auto; }
.aubie-container.aubie-left  { left: 20px; right: auto; }

/* --- Chat trigger button --- */
.aubie-trigger {
  position: relative;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background-color: var(--aubie-dark);
  color: var(--aubie-orange);
  border: none;
  cursor: pointer;
  box-shadow: var(--aubie-shadow);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  transition: transform 0.25s ease, background-color 0.25s ease, color 0.25s ease;
}
.aubie-trigger:hover {
  transform: scale(1.1);
  background-color: var(--aubie-orange);
  color: #fff;
}

/* SVG fallback icon */
.aubie-trigger svg {
  position: relative;
  z-index: 2;
  width: 26px;
  height: 26px;
  fill: currentColor;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

/* Image-based icon */
.aubie-trigger.has-avatar::before {
  content: "";
  position: absolute;
  inset: 0;
  background: center/contain no-repeat;
  background-image: var(--aubie-icon-image, none);
  border-radius: 50%;
  opacity: 1;
  z-index: 1;
  transition: transform 0.3s ease, opacity 0.3s ease;
}
.aubie-trigger.has-avatar svg { opacity: 0; }

/* Thinking pulse */
@keyframes aubiePulse {
  0%,100% { box-shadow: 0 0 0 0 rgba(253,152,0,.5); }
  50%     { box-shadow: 0 0 12px 8px rgba(253,152,0,0); }
}
.aubie-trigger.thinking { animation: aubiePulse 2.2s ease-in-out infinite; }

/* --- Greeting Tooltip (horizontal popout) --- */
.aubie-greet-tooltip {
  position: absolute;
  bottom: 50%;
  transform: translateY(50%);
  min-width: 180px;
  max-width: 260px;
  padding: 12px 16px;
  border-radius: 18px;
  background: var(--aubie-dark);
  color: var(--aubie-text);
  border: 1px solid rgba(255,255,255,0.15);
  font-size: 14px;
  line-height: 1.5;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
  opacity: 0;
  pointer-events: none;
  white-space: normal;
  text-align: left;
  word-break: break-word;
  transition: all 0.3s ease;
}

/* Slide direction based on placement */
.aubie-container.aubie-right .aubie-greet-tooltip {
  right: 70px;
  left: auto;
  transform: translateY(50%) translateX(10px);
}
.aubie-container.aubie-left .aubie-greet-tooltip {
  left: 70px;
  right: auto;
  transform: translateY(50%) translateX(-10px);
}

/* Visible state */
.aubie-greet-tooltip.show {
  opacity: 1;
  transform: translateY(50%) translateX(0);
  pointer-events: auto;
}

/* Tooltip arrow */
.aubie-greet-tooltip::after {
  content: "";
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  border: 6px solid transparent;
}
.aubie-container.aubie-right .aubie-greet-tooltip::after {
  right: -12px;
  border-left-color: var(--aubie-dark);
}
.aubie-container.aubie-left .aubie-greet-tooltip::after {
  left: -12px;
  border-right-color: var(--aubie-dark);
}

/* --- Chat panel --- */
.aubie-panel {
  position: fixed;
  bottom: 90px;
  width: 380px;
  max-width: calc(100% - 40px);
  height: 600px;
  background-color: var(--aubie-dark);
  border-radius: 1rem;
  box-shadow: var(--aubie-shadow);
  overflow: hidden;
  opacity: 0;
  transform: translateY(20px);
  pointer-events: none;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

/* Panel side logic */
.aubie-container.aubie-right .aubie-panel { right: 20px; left: auto; }
.aubie-container.aubie-left  .aubie-panel { left: 20px; right: auto; }

.aubie-panel.open {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

/* --- Chat iframe --- */
.aubie-panel openai-chatkit {
  display: block;
  height: 100%;
  width: 100%;
}

/* --- Reinforce Aubie trigger styling (without nuking variables) --- */
#aubie-global-chat .aubie-trigger {
  all: unset; /* lighter reset that keeps variable inheritance */
  position: relative;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background-color: var(--aubie-dark);
  color: var(--aubie-orange);
  border: none;
  cursor: pointer;
  box-shadow: var(--aubie-shadow);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  transition: transform 0.25s ease, background-color 0.25s ease, color 0.25s ease;
  z-index: 10005;
}
#aubie-global-chat .aubie-trigger:hover {
  transform: scale(1.06);
  background-color: var(--aubie-orange);
  color: #fff;
}
#aubie-global-chat .aubie-trigger svg {
  width: 26px;
  height: 26px;
  fill: currentColor;
}

