/* ALTERRA VR NEON GLASS CHAT V2 */

.av-chat,
.av-chat * {
  box-sizing: border-box;
}

.av-chat {
  --av-cyan: #32e4f6;
  --av-blue: #328dff;
  --av-violet: #8c58ff;
  --av-ink: #061322;
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 2147482000;
  font-family: Inter, Arial, system-ui, sans-serif;
  color: #edfaff;
  isolation: isolate;
}

/* Glowing signal button */

.av-chat__launcher {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 60px;
  margin-left: auto;
  padding: 14px 25px;
  border: 1px solid rgba(70,232,255,.85);
  border-radius: 100px;
  background:
    radial-gradient(circle at 5% 10%,rgba(56,225,255,.28),transparent 45%),
    linear-gradient(115deg,#062d47,#092044 58%,#342069);
  color: #f5fdff;
  font: 750 14px/1.3 Inter,Arial,system-ui,sans-serif;
  letter-spacing: .025em;
  cursor: pointer;
  isolation: isolate;
  box-shadow:
    0 0 0 1px rgba(94,231,255,.14),
    0 0 20px rgba(31,217,255,.35),
    0 0 55px rgba(39,141,255,.26),
    inset 0 1px rgba(255,255,255,.23);
  text-shadow: 0 0 14px rgba(103,236,255,.35);
  transition: transform .25s,box-shadow .25s;
  animation: av-energy-breathe 3.6s ease-in-out infinite;
}

.av-chat__launcher::before {
  content: "";
  position: absolute;
  inset: -6px;
  border: 1px solid rgba(65,225,255,.4);
  border-radius: inherit;
  pointer-events: none;
  animation: av-energy-ring 3s ease-out infinite;
}

.av-chat__launcher::after {
  content: "✦";
  display: inline-flex;
  align-items: center;
  justify-content: center;
  order: -1;
  width: 25px;
  height: 25px;
  border-radius: 50%;
  background: rgba(42,225,255,.13);
  color: #6cf5ff;
  font-size: 18px;
  box-shadow: 0 0 16px rgba(39,227,255,.25);
  animation: av-spark 3s ease-in-out infinite;
}

.av-chat__launcher:hover {
  transform: translateY(-3px);
  box-shadow:
    0 0 25px rgba(41,238,255,.65),
    0 0 75px rgba(39,136,255,.4),
    inset 0 1px rgba(255,255,255,.35);
}

/* Glass panel */

.av-chat__panel {
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  width: min(410px,calc(100vw - 32px));
  height: min(620px,calc(100dvh - 105px));
  min-height: 240px;
  margin-bottom: 18px;
  overflow: hidden;
  border: 1px solid rgba(76,222,255,.5);
  border-radius: 24px;
  background:
    radial-gradient(ellipse at 100% 0%,rgba(45,133,239,.20),transparent 48%),
    radial-gradient(ellipse at 0% 100%,rgba(77,39,176,.15),transparent 55%),
    rgba(4,14,32,.92);
  -webkit-backdrop-filter: blur(26px) saturate(145%);
  backdrop-filter: blur(26px) saturate(145%);
  box-shadow:
    0 0 0 1px rgba(65,207,255,.10),
    0 0 28px rgba(30,203,255,.22),
    0 0 95px rgba(43,106,240,.18),
    0 25px 70px rgba(0,0,0,.65),
    inset 0 1px rgba(255,255,255,.13);
  animation: av-panel-arrive .32s ease-out both;
}

.av-chat__panel[hidden] {
  display: none !important;
}

.av-chat__panel::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    linear-gradient(rgba(70,176,255,.025) 1px,transparent 1px),
    linear-gradient(90deg,rgba(70,176,255,.025) 1px,transparent 1px);
  background-size: 28px 28px;
  mask-image: linear-gradient(to bottom,black,transparent 85%);
}

.av-chat__panel::after {
  content: "";
  position: absolute;
  left: 14%;
  right: 14%;
  top: 0;
  height: 2px;
  z-index: 3;
  pointer-events: none;
  background: linear-gradient(90deg,transparent,#70f8ff,transparent);
  box-shadow: 0 0 17px 4px rgba(37,218,255,.4);
}

/* Header */

.av-chat__header {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 21px 19px;
  background:
    radial-gradient(ellipse at 25% 0%,rgba(51,209,250,.13),transparent 70%),
    linear-gradient(110deg,rgba(8,36,68,.94),rgba(21,26,69,.8));
  border-bottom: 1px solid rgba(76,218,255,.24);
  box-shadow: 0 5px 24px rgba(0,0,0,.15);
}

.av-chat__title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  font-size: 19px;
  font-weight: 800;
  letter-spacing: .015em;
  color: #fff;
  text-shadow: 0 0 20px rgba(79,221,255,.25);
}

.av-chat__title::before {
  content: "✦";
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  border: 1px solid rgba(78,228,255,.55);
  border-radius: 11px;
  background: linear-gradient(145deg,rgba(39,202,255,.23),rgba(94,68,232,.18));
  color: #6af1ff;
  font-size: 23px;
  box-shadow: 0 0 21px rgba(49,209,255,.18);
}

.av-chat__subtitle {
  margin-top: 7px;
  color: #a8cee2;
  font-size: 12px;
  letter-spacing: .02em;
}

.av-chat__close {
  width: 37px;
  height: 37px;
  flex-shrink: 0;
  border: 1px solid rgba(117,197,240,.30);
  border-radius: 11px;
  background: rgba(78,153,229,.1);
  color: #d7edff;
  font-size: 17px;
  cursor: pointer;
  transition: background .2s,border-color .2s;
}

.av-chat__close:hover {
  background: rgba(57,205,255,.18);
  border-color: rgba(76,227,255,.65);
}

/* Chat messages */

.av-chat__messages {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 14px;
  min-height: 0;
  overflow-y: auto;
  padding: 22px 16px;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(63,193,236,.42) transparent;
}

.av-chat__message {
  max-width: 88%;
  padding: 12px 15px;
  border-radius: 16px;
  font-size: 13px;
  line-height: 1.65;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
  box-shadow: 0 6px 22px rgba(0,0,0,.16);
}

.av-chat__message--assistant {
  align-self: flex-start;
  border: 1px solid rgba(74,198,242,.22);
  border-bottom-left-radius: 5px;
  background: linear-gradient(145deg,rgba(26,56,83,.85),rgba(15,31,61,.9));
  color: #e5f6ff;
}

.av-chat__message--admin {
  align-self: flex-start;
  border: 1px solid rgba(157,120,255,.5);
  border-bottom-left-radius: 5px;
  background: linear-gradient(135deg,rgba(61,38,111,.75),rgba(17,33,66,.94));
  color: #f2ebff;
}

.av-chat__message--user {
  align-self: flex-end;
  border: 1px solid rgba(121,244,255,.5);
  border-bottom-right-radius: 5px;
  background: linear-gradient(120deg,#1283b0,#235ac4);
  color: #fff;
  box-shadow: 0 5px 24px rgba(25,136,255,.19);
}

.av-chat__message-label {
  display: block;
  margin-bottom: 5px;
  color: #cdb5ff;
  font-size: 11px;
  font-weight: 750;
  letter-spacing: .02em;
}

/* Input area */

.av-chat__status {
  min-height: 29px;
  padding: 7px 17px;
  color: #9dbbd4;
  font-size: 11px;
  background: rgba(7,19,40,.4);
}

.av-chat__form {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  padding: 13px;
  border-top: 1px solid rgba(78,193,255,.18);
  background: rgba(6,19,39,.88);
}

.av-chat__input {
  flex: 1;
  min-width: 0;
  min-height: 46px;
  max-height: 130px;
  padding: 12px 14px;
  resize: none;
  border: 1px solid rgba(85,159,206,.37);
  border-radius: 13px;
  outline: none;
  background: rgba(15,37,65,.72);
  color: #fff;
  font: 13px/1.5 Inter,Arial,system-ui,sans-serif;
  box-shadow: inset 0 2px 12px rgba(0,0,0,.18);
  transition: border-color .2s,box-shadow .2s;
}

.av-chat__input::placeholder {
  color: #92adc2;
}

.av-chat__input:focus {
  border-color: #51e5ff;
  box-shadow: 0 0 0 3px rgba(52,215,255,.13);
}

.av-chat__send {
  min-width: 46px;
  height: 46px;
  padding: 0 12px;
  border: 1px solid rgba(103,241,255,.5);
  border-radius: 13px;
  background: linear-gradient(140deg,#1dbeda,#276af0);
  color: #fff;
  font-size: 18px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 0 18px rgba(25,182,249,.25);
  transition: filter .2s,transform .2s;
}

.av-chat__send:hover:not(:disabled) {
  filter: brightness(1.17);
  transform: translateY(-1px);
}

.av-chat__send:disabled {
  opacity: .45;
  cursor: not-allowed;
}

.av-chat__launcher:focus-visible,
.av-chat__close:focus-visible,
.av-chat__send:focus-visible {
  outline: 3px solid #7bf4ff;
  outline-offset: 3px;
}

/* Animation */

@keyframes av-energy-breathe {
  0%,100% {
    box-shadow: 0 0 17px rgba(31,217,255,.29),
                0 0 44px rgba(39,141,255,.17);
  }
  50% {
    box-shadow: 0 0 28px rgba(31,229,255,.56),
                0 0 68px rgba(51,124,255,.32);
  }
}

@keyframes av-energy-ring {
  0% { opacity: .65; transform: scale(.97); }
  75%,100% { opacity: 0; transform: scale(1.13); }
}

@keyframes av-spark {
  0%,100% { opacity: .65; transform: scale(.92); }
  50% { opacity: 1; transform: scale(1.12); }
}

@keyframes av-panel-arrive {
  from { opacity: 0; transform: translateY(12px) scale(.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Mobile */

@media (max-width:600px) {
  .av-chat {
    right: 12px;
    bottom: 12px;
    left: 12px;
  }

  .av-chat__panel {
    width: 100%;
    height: min(680px,calc(100dvh - 95px));
    border-radius: 20px;
  }

  .av-chat__launcher {
    min-height: 56px;
    padding: 13px 19px;
  }
}

@media (max-height:520px) {
  .av-chat__panel {
    height: calc(100dvh - 82px);
    min-height: 0;
  }
}

@media (prefers-reduced-motion:reduce) {
  .av-chat__launcher,
  .av-chat__launcher::before,
  .av-chat__launcher::after,
  .av-chat__panel {
    animation: none !important;
  }

  .av-chat__launcher,
  .av-chat__close,
  .av-chat__send,
  .av-chat__input {
    transition: none !important;
  }
}


/* STEP 1362: Return to AI button */
.av-chat .av-chat__return-ai {
  display: block;
  width: calc(100% - 26px);
  min-height: 42px;
  margin: 8px 13px;
  padding: 10px 14px;
  border: 1px solid rgba(103,241,255,.5);
  border-radius: 11px;
  background: rgba(32,121,194,.18);
  color: #d7edff;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background .2s, border-color .2s;
}

.av-chat .av-chat__return-ai[hidden] {
  display: none !important;
}

.av-chat .av-chat__return-ai:hover:not(:disabled) {
  background: rgba(57,205,255,.22);
  border-color: #51e5ff;
}

.av-chat .av-chat__return-ai:disabled {
  opacity: .5;
  cursor: not-allowed;
}

.av-chat .av-chat__return-ai:focus-visible {
  outline: 3px solid #7bf4ff;
  outline-offset: 3px;
}
