/* =========================================================
   Learning Rewired Lab
   Ask Andy Global Assistant
   File: /assets/css/ask-andy.css
   ========================================================= */

.lrl-ask-andy {
  --aa-ink: #07111f;
  --aa-navy: #0b1728;
  --aa-slate: #142237;
  --aa-paper: #f8fafc;
  --aa-panel: #ffffff;
  --aa-muted: #526174;
  --aa-line: rgba(7, 17, 31, 0.12);
  --aa-cyan: #16b8d9;
  --aa-cyan-dark: #0ea5c2;
  --aa-mint: #6ee7d8;
  --aa-shadow: 0 24px 70px rgba(7, 17, 31, 0.18);

  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 9000;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.lrl-ask-andy *,
.lrl-ask-andy *::before,
.lrl-ask-andy *::after {
  box-sizing: border-box;
}

.lrl-ask-andy-button {
  display: inline-flex;
  min-height: 54px;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 1px solid rgba(22, 184, 217, 0.56);
  border-radius: 999px;
  background:
    radial-gradient(circle at 18% 0%, rgba(110, 231, 216, 0.36), transparent 42%),
    var(--aa-cyan);
  color: #ffffff;
  padding: 0 20px;
  font-size: 0.92rem;
  font-weight: 900;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 18px 42px rgba(22, 184, 217, 0.28);
  transition:
    transform 180ms ease,
    box-shadow 180ms ease,
    background 180ms ease;
}

.lrl-ask-andy-button:hover {
  transform: translateY(-2px);
  background: var(--aa-cyan-dark);
  box-shadow: 0 22px 52px rgba(22, 184, 217, 0.34);
}

.lrl-ask-andy-button:focus-visible {
  outline: 3px solid rgba(22, 184, 217, 0.34);
  outline-offset: 4px;
}

.lrl-ask-andy-button-icon {
  display: inline-flex;
  width: 26px;
  height: 26px;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.22);
  font-size: 0.9rem;
}

.lrl-ask-andy-panel {
  position: absolute;
  right: 0;
  bottom: 70px;
  display: none;
  width: min(420px, calc(100vw - 28px));
  height: min(680px, calc(100vh - 112px));
  overflow: hidden;
  border: 1px solid rgba(7, 17, 31, 0.14);
  border-radius: 30px;
  background: #ffffff;
  box-shadow: var(--aa-shadow);
}

.lrl-ask-andy.is-open .lrl-ask-andy-panel {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
}

.lrl-ask-andy-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 18px 14px;
  background:
    radial-gradient(circle at 18% 0%, rgba(22, 184, 217, 0.18), transparent 34%),
    radial-gradient(circle at 82% 0%, rgba(110, 231, 216, 0.14), transparent 34%),
    #ffffff;
  border-bottom: 1px solid rgba(7, 17, 31, 0.08);
}

.lrl-ask-andy-title {
  display: flex;
  gap: 12px;
  align-items: center;
}

.lrl-ask-andy-avatar {
  display: inline-flex;
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  border-radius: 16px;
  background:
    radial-gradient(circle at 30% 18%, rgba(110, 231, 216, 0.62), transparent 44%),
    var(--aa-navy);
  color: #ffffff;
  font-size: 1.05rem;
  font-weight: 950;
}

.lrl-ask-andy-title strong {
  display: block;
  color: var(--aa-ink);
  font-size: 1rem;
  font-weight: 900;
  line-height: 1.1;
}

.lrl-ask-andy-title span {
  display: block;
  margin-top: 4px;
  color: var(--aa-muted);
  font-size: 0.78rem;
  font-weight: 650;
  line-height: 1.25;
}

.lrl-ask-andy-close {
  display: inline-flex;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(7, 17, 31, 0.1);
  border-radius: 999px;
  background: #ffffff;
  color: var(--aa-ink);
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  transition:
    background 180ms ease,
    border-color 180ms ease,
    transform 180ms ease;
}

.lrl-ask-andy-close:hover {
  transform: translateY(-1px);
  border-color: rgba(22, 184, 217, 0.42);
  background: rgba(22, 184, 217, 0.08);
}

.lrl-ask-andy-intro {
  padding: 14px 18px;
  border-bottom: 1px solid rgba(7, 17, 31, 0.08);
  background: #f8fafc;
}

.lrl-ask-andy-intro p {
  margin: 0;
  color: var(--aa-muted);
  font-size: 0.86rem;
  line-height: 1.45;
}

.lrl-ask-andy-frame-wrap {
  min-height: 0;
  background: #ffffff;
}

.lrl-ask-andy-frame-wrap iframe {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 460px;
  border: 0;
  background: #ffffff;
}

.lrl-ask-andy-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 16px;
  border-top: 1px solid rgba(7, 17, 31, 0.08);
  background: #ffffff;
}

.lrl-ask-andy-footer span {
  color: var(--aa-muted);
  font-size: 0.74rem;
  line-height: 1.25;
}

.lrl-ask-andy-footer a {
  flex: 0 0 auto;
  color: var(--aa-cyan-dark);
  font-size: 0.78rem;
  font-weight: 850;
  text-decoration: none;
}

.lrl-ask-andy-footer a:hover {
  text-decoration: underline;
}

.lrl-ask-andy-scrim {
  position: fixed;
  inset: 0;
  display: none;
  background: rgba(7, 17, 31, 0.36);
  z-index: 8999;
}

body.lrl-ask-andy-open .lrl-ask-andy-scrim {
  display: block;
}

body.lrl-ask-andy-open {
  overflow: hidden;
}

/* =========================================================
   Mobile
   ========================================================= */

@media (max-width: 760px) {
  .lrl-ask-andy {
    right: 14px;
    bottom: 86px;
  }

  .lrl-ask-andy-button {
    min-height: 52px;
    padding: 0 18px;
  }

  .lrl-ask-andy-panel {
    position: fixed;
    left: 12px;
    right: 12px;
    top: 82px;
    bottom: 86px;
    width: auto;
    height: auto;
    border-radius: 26px;
  }

  .lrl-ask-andy-frame-wrap iframe {
    min-height: 420px;
  }
}

@media (max-width: 420px) {
  .lrl-ask-andy-button span:last-child {
    display: none;
  }

  .lrl-ask-andy-button {
    width: 54px;
    padding: 0;
  }

  .lrl-ask-andy-button-icon {
    background: transparent;
  }

  .lrl-ask-andy-panel {
    left: 10px;
    right: 10px;
    top: 74px;
    bottom: 82px;
    border-radius: 22px;
  }

  .lrl-ask-andy-header {
    padding: 15px;
  }

  .lrl-ask-andy-intro {
    padding: 12px 15px;
  }
}
