/* Algolia Agent Studio chat — theme overrides */

#algolia-chat-trigger {
  --aws-agent-btn-bg: radial-gradient(ellipse at 50% 0%, rgba(255, 255, 255, 0.42), transparent 38%), radial-gradient(ellipse at 20% 20%, rgba(255, 255, 255, 0.32), transparent 34%), linear-gradient(180deg, #5876ff 0%, #365dff 42%, #2f56ff 68%, #2146e8 100%);
  --aws-agent-btn-border: 1px solid #4c61c0;
  --aws-agent-btn-shadow: inset 0 2px 2px rgba(255, 255, 255, 0.45), inset 0 -10px 20px rgba(0, 0, 0, 0.18), inset 0 -1px 0 rgba(255, 255, 255, 0.18), 0 18px 38px rgba(47, 86, 255, 0.3), 0 8px 18px rgba(0, 0, 0, 0.12);
  --aws-agent-btn-shadow-hover: inset 0 2px 2px rgba(255, 255, 255, 0.65), inset 0 -12px 22px rgba(0, 0, 0, 0.17), 0 24px 28px rgba(47, 86, 255, 0.38), 0 10px 22px rgba(0, 0, 0, 0.14);
  z-index: calc(var(--ais-z-index-chat) + 1);
}

#algolia-chat {
  z-index: var(--ais-z-index-chat);
}

#algolia-chat-trigger .aws-agent-chat-trigger {
  border: var(--aws-agent-btn-border);
  cursor: pointer;
  color: #fff;
  font-family: inherit;
  overflow: hidden;
  isolation: isolate;
  background: var(--aws-agent-btn-bg);
  box-shadow: var(--aws-agent-btn-shadow);
  transition: transform 0.25s ease, box-shadow 0.25s ease, filter 0.25s ease;
}

#algolia-chat-trigger .aws-agent-chat-trigger:hover,
#algolia-chat-trigger .aws-agent-chat-trigger:focus {
  transform: translateY(-2px) scale(1.012);
  filter: saturate(1.08);
  box-shadow: var(--aws-agent-btn-shadow-hover);
}

#algolia-chat-trigger .aws-agent-chat-trigger--ask {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: auto;
  height: 42px;
  min-height: 42px;
  padding: 0 22px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 400;
  line-height: 1;
}

#algolia-chat-trigger .aws-agent-chat-trigger__label {
  font-weight: 600;
}

#algolia-chat-trigger .aws-agent-chat-trigger__icon {
  display: inline-flex;
  width: 16px;
  height: 16px;
}

#algolia-chat-trigger .aws-agent-chat-trigger__icon svg {
  width: 100%;
  height: 100%;
}

#algolia-chat-trigger .aws-agent-chat-trigger--close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  padding: 0;
  border-radius: 50%;
  transform: none;
}

#algolia-chat-trigger .aws-agent-chat-trigger--close:hover,
#algolia-chat-trigger .aws-agent-chat-trigger--close:focus {
  transform: translateY(-2px) scale(1.012);
}

#algolia-chat-trigger .aws-agent-chat-trigger__chevron {
  display: inline-flex;
  width: 20px;
  height: 20px;
}

#algolia-chat-trigger .aws-agent-chat-trigger__chevron svg {
  width: 100%;
  height: 100%;
}

#algolia-chat .ais-ChatOverlayLayout {
  --ais-chat-width: 35rem;
}

/* Taller Ask pill needs a bit more clearance above the trigger (desktop only). */
@media (min-width: 681px) {
  body:has(#algolia-chat-trigger .ais-ChatToggleButton--floating) #algolia-chat .ais-ChatOverlayLayout {
    bottom: calc(var(--ais-chat-margin) + 56px);
  }
}

/* Maximized chat uses height:100% anchored to bottom, which pushes the header off-screen. */
#algolia-chat .ais-ChatOverlayLayout--maximized {
  top: var(--ais-chat-margin);
  height: auto;
  max-height: none;
}

#algolia-chat .aws-agent-chat-header__title {
  gap: 0;
}

.aws-agent-chat-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.aws-agent-chat-brand__icon {
  display: inline-flex;
  flex-shrink: 0;
  color: #2f56ff;
}

.aws-agent-chat-brand__icon svg {
  width: 20px;
  height: auto;
}

.aws-agent-chat-brand__copy {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
  line-height: 1.1;
}

.aws-agent-chat-brand__title {
  font-size: 16px; /* same as the previous default "Chat" label */
  font-weight: 600;
  color: #111;
}

.aws-agent-chat-brand__subtitle {
  font-size: 10px; /* previous AW Concierge size (was 1rem on this theme) */
  font-weight: 600;
  color: #111;
}

#algolia-chat .aws-agent-chat-footer {
  font-size: 12px;
  line-height: 1.4;
  color: #111;
  text-align: center;
}

#algolia-chat .aws-agent-chat-footer__link {
  color: #2f56ff;
  text-decoration: underline;
}

#algolia-chat .aws-agent-chat-footer__link:hover,
#algolia-chat .aws-agent-chat-footer__link:focus {
  color: #2f56ff;
  text-decoration: underline;
}

#algolia-chat .ais-ChatMessage-tool {
  display: none;
}

.aws-agent-hit {
  display: block;
  color: inherit;
  text-decoration: none;
}

.aws-agent-hit:hover,
.aws-agent-hit:focus {
  text-decoration: underline;
}

.aws-agent-hit__title {
  font-weight: 600;
}

/* Algolia sets position:relative on the floating trigger ≤680px, which drops it into the footer. */
@media (max-width: 680px) {
  #algolia-chat-trigger {
    position: fixed;
    right: 0;
    bottom: 0;
    left: auto;
    margin: 0;
    padding: 0;
    pointer-events: none;
  }

  #algolia-chat-trigger .ais-ChatToggleButton--floating {
    position: fixed !important;
    right: var(--ais-chat-margin);
    bottom: var(--ais-chat-margin);
    left: auto !important;
    margin: 0;
    pointer-events: auto;
    z-index: calc(var(--ais-z-index-chat) + 1);
  }

  #algolia-chat-trigger .ais-ChatToggleButton--floating.ais-ChatToggleButton--open {
    display: inline-flex !important;
    transform: none;
  }

  body:has(#algolia-chat-trigger .ais-ChatToggleButton--floating) #algolia-chat .ais-ChatOverlayLayout {
    inset: 0 !important;
    bottom: 0 !important;
  }
}
