/*--------------------------------------------------------------
# IGDS Assistant — scripted FAQ chat widget
# Loads after theme.css and reuses its custom properties.
--------------------------------------------------------------*/

/* Move the template's back-to-top clear of the launcher */
.back-to-top {
  bottom: 92px !important;
  right: 26px !important;
}

/*--------------------------------------------------------------
# Launcher
--------------------------------------------------------------*/
.igds-launcher {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 100000;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 60px;
  height: 60px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: var(--brand, #00B3A4);
  color: #fff;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(0, 179, 164, 0.42);
  transition: transform 0.25s ease, background-color 0.25s ease, box-shadow 0.25s ease;
}

.igds-launcher:hover {
  background: var(--brand-dark, #00897E);
  transform: translateY(-3px) scale(1.04);
  box-shadow: 0 12px 30px rgba(0, 179, 164, 0.5);
}

.igds-launcher:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 3px;
}

.igds-launcher svg {
  width: 27px;
  height: 27px;
  transition: transform 0.3s ease, opacity 0.2s ease;
}

.igds-launcher .igds-icon-close { display: none; }

.igds-launcher.is-open .igds-icon-chat  { display: none; }
.igds-launcher.is-open .igds-icon-close { display: block; }

/* Attention pulse — runs a few times, then stops */
.igds-launcher::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid var(--brand, #00B3A4);
  animation: igdsPulse 2.4s ease-out 3;
  pointer-events: none;
}

@keyframes igdsPulse {
  0%   { transform: scale(1);   opacity: 0.7; }
  100% { transform: scale(1.7); opacity: 0; }
}

/*--------------------------------------------------------------
# Panel
--------------------------------------------------------------*/
.igds-panel {
  position: fixed;
  right: 24px;
  bottom: 96px;
  z-index: 100000;
  display: flex;
  flex-direction: column;
  width: 376px;
  max-width: calc(100vw - 32px);
  height: 540px;
  max-height: calc(100vh - 140px);
  background: #fff;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 24px 64px rgba(10, 26, 47, 0.28);
  font-family: "Inter", system-ui, sans-serif;

  opacity: 0;
  visibility: hidden;
  transform: translateY(14px) scale(0.97);
  transform-origin: bottom right;
  transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s;
}

.igds-panel.is-open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

/*--------------------------------------------------------------
# Panel header
--------------------------------------------------------------*/
.igds-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 20px;
  background: var(--ink, #0A1A2F);
  color: #fff;
  flex-shrink: 0;
}

.igds-header .igds-avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--brand, #00B3A4);
  font-family: "Space Grotesk", sans-serif;
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.02em;
  flex-shrink: 0;
}

.igds-header h4 {
  margin: 0;
  font-family: "Space Grotesk", sans-serif;
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  line-height: 1.3;
}

.igds-header .igds-status {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 2px 0 0;
  font-size: 12.5px;
  color: #9DB2CA;
  line-height: 1.3;
}

.igds-header .igds-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #34D399;
}

.igds-header .igds-close {
  margin-left: auto;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.10);
  color: #fff;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.igds-header .igds-close:hover { background: rgba(255, 255, 255, 0.22); }

/*--------------------------------------------------------------
# Message log
--------------------------------------------------------------*/
.igds-log {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  background: var(--surface-alt, #F5F8FB);
  scroll-behavior: smooth;
}

.igds-log::-webkit-scrollbar { width: 7px; }
.igds-log::-webkit-scrollbar-thumb {
  background: #CBD7E4;
  border-radius: 4px;
}

.igds-msg {
  max-width: 84%;
  margin-bottom: 12px;
  padding: 12px 15px;
  font-size: 14.5px;
  line-height: 1.62;
  border-radius: 14px;
  animation: igdsMsgIn 0.32s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.igds-msg a { color: var(--brand-dark, #00897E); text-decoration: underline !important; }

.igds-msg-bot {
  background: #fff;
  color: #2C3E52;
  border-bottom-left-radius: 5px;
  box-shadow: 0 1px 3px rgba(10, 26, 47, 0.09);
}

.igds-msg-user {
  margin-left: auto;
  background: var(--brand, #00B3A4);
  color: #fff;
  border-bottom-right-radius: 5px;
}

.igds-msg strong { color: inherit; font-weight: 600; }

.igds-msg ul { margin: 8px 0 0; padding-left: 18px; }
.igds-msg li { margin-bottom: 4px; }

@keyframes igdsMsgIn {
  from { opacity: 0; transform: translateY(9px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Typing indicator */
.igds-typing {
  display: inline-flex;
  gap: 4px;
  align-items: center;
  padding: 14px 16px;
}

.igds-typing span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #A9BACE;
  animation: igdsBlink 1.4s infinite both;
}

.igds-typing span:nth-child(2) { animation-delay: 0.2s; }
.igds-typing span:nth-child(3) { animation-delay: 0.4s; }

@keyframes igdsBlink {
  0%, 80%, 100% { opacity: 0.3; transform: scale(0.8); }
  40%           { opacity: 1;   transform: scale(1); }
}

/*--------------------------------------------------------------
# Quick replies
--------------------------------------------------------------*/
.igds-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 20px 14px;
  background: var(--surface-alt, #F5F8FB);
  flex-shrink: 0;
}

.igds-chip {
  padding: 8px 14px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  color: var(--brand-dark, #00897E);
  background: #fff;
  border: 1px solid #D3E3E1;
  border-radius: 50px;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
}

.igds-chip:hover {
  background: var(--brand, #00B3A4);
  border-color: var(--brand, #00B3A4);
  color: #fff;
  transform: translateY(-1px);
}

/*--------------------------------------------------------------
# Composer
--------------------------------------------------------------*/
.igds-form {
  display: flex;
  gap: 9px;
  padding: 13px 14px;
  background: #fff;
  border-top: 1px solid var(--line, #E3EAF2);
  flex-shrink: 0;
}

.igds-form input {
  flex: 1;
  min-width: 0;
  padding: 11px 15px;
  font-family: inherit;
  font-size: 14.5px;
  color: #2C3E52;
  background: var(--surface-alt, #F5F8FB);
  border: 1px solid transparent;
  border-radius: 50px;
  outline: none;
  transition: border-color 0.2s ease, background-color 0.2s ease;
}

.igds-form input::placeholder { color: #8FA3B8; }

.igds-form input:focus {
  background: #fff;
  border-color: var(--brand, #00B3A4);
}

.igds-form button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  flex-shrink: 0;
  border: none;
  border-radius: 50%;
  background: var(--brand, #00B3A4);
  color: #fff;
  cursor: pointer;
  transition: background-color 0.2s ease, transform 0.15s ease;
}

.igds-form button:hover { background: var(--brand-dark, #00897E); transform: scale(1.06); }

.igds-form button svg { width: 18px; height: 18px; }

.igds-footnote {
  padding: 0 14px 11px;
  margin: 0;
  font-size: 11.5px;
  color: #8FA3B8;
  text-align: center;
  background: #fff;
}

/*--------------------------------------------------------------
# Mobile
--------------------------------------------------------------*/
@media (max-width: 480px) {
  .igds-panel {
    right: 12px;
    left: 12px;
    bottom: 88px;
    width: auto;
    max-width: none;
    height: calc(100vh - 130px);
  }

  .igds-launcher { right: 16px; bottom: 16px; }
  .back-to-top { bottom: 84px !important; right: 18px !important; }
}

/*--------------------------------------------------------------
# Reduced motion
--------------------------------------------------------------*/
@media (prefers-reduced-motion: reduce) {
  .igds-launcher,
  .igds-panel,
  .igds-msg,
  .igds-chip { transition: none; animation: none; }

  .igds-launcher::after { animation: none; display: none; }
}
