/* ================================
   Vee Companion Blocks
   Reusable page CTA for Vee as a signal companion
================================ */

.vee-companion-section {
  position: relative;
}

.vee-companion-card {
  position: relative;
  display: grid;
  grid-template-columns: 0.95fr 1.05fr;
  gap: clamp(20px, 4vw, 42px);
  align-items: center;
  padding: clamp(24px, 4vw, 42px);
  border-radius: var(--radius-xl);
  overflow: hidden;
  isolation: isolate;
  background:
    radial-gradient(circle at 14% 18%, rgba(82, 255, 224, 0.20), transparent 28%),
    radial-gradient(circle at 82% 72%, rgba(185, 150, 255, 0.22), transparent 34%),
    linear-gradient(135deg, rgba(255,255,255,.105), rgba(255,255,255,.04));
  border: 1px solid rgba(255,255,255,.14);
  box-shadow: 0 24px 80px rgba(0,0,0,.28);
}

.vee-companion-card::before {
  content: "";
  position: absolute;
  inset: 18px;
  border-radius: calc(var(--radius-xl) - 10px);
  border: 1px solid rgba(82, 255, 224, 0.10);
  pointer-events: none;
  z-index: -1;
}

.vee-companion-copy h2 {
  margin-bottom: 14px;
}

.vee-companion-copy p {
  max-width: 720px;
}

.vee-companion-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 22px;
}

.vee-companion-orb {
  position: relative;
  min-height: 340px;
  display: grid;
  place-items: center;
  padding-bottom: 98px;
}

.vee-companion-orb::before,
.vee-companion-orb::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 42%;
  width: min(420px, 88%);
  height: 160px;
  border: 1.8px solid rgba(244, 251, 255, 0.62);
  border-radius: 50%;
  transform: translate(-50%, -50%) rotate(22deg);
  box-shadow: 0 0 26px rgba(106, 242, 255, 0.16);
}

.vee-companion-orb::after {
  transform: translate(-50%, -50%) rotate(-28deg);
  border-color: rgba(185, 150, 255, 0.58);
}

.vee-companion-core {
  width: 136px;
  height: 136px;
  border-radius: 50%;
  position: absolute;
  left: 50%;
  top: 42%;
  transform: translate(-50%, -50%);
  z-index: 2;
  display: grid;
  place-items: center;
  overflow: visible;
  color: #07112c;
  font-weight: 950;
  font-size: 2rem;
  background:
    radial-gradient(circle at 34% 26%,
      rgba(255, 255, 255, 0.98) 0%,
      rgba(221, 251, 255, 0.98) 12%,
      rgba(106, 242, 255, 0.94) 31%,
      rgba(47, 109, 255, 0.92) 56%,
      rgba(138, 92, 255, 0.88) 77%,
      rgba(255, 123, 229, 0.84) 100%);
  box-shadow:
    0 0 42px rgba(106, 242, 255, 0.45),
    0 0 88px rgba(47, 109, 255, 0.36),
    0 0 128px rgba(138, 92, 255, 0.28),
    inset 0 0 28px rgba(255, 255, 255, 0.22);
  animation: veeCompanionPulse 4s ease-in-out infinite;
}

.vee-companion-avatar {
  width: 74px;
  max-width: 62%;
  height: auto;
  max-height: 118px;
  object-fit: contain;
  display: block;
  border-radius: 0;
  filter:
    drop-shadow(0 0 14px rgba(255, 255, 255, 0.28))
    drop-shadow(0 0 22px rgba(82, 255, 224, 0.18));
  transform: none;
}


.vee-companion-prompt {
  position: absolute;
  left: 50%;
  right: auto;
  bottom: 8px;
  transform: translateX(-50%);
  z-index: 3;
  width: min(360px, 88%);
  max-width: 360px;
  padding: 16px 18px;
  border-radius: 24px;
  background: rgba(5, 9, 25, 0.70);
  border: 1px solid rgba(82, 255, 224, 0.22);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 18px 50px rgba(0,0,0,.25);
}

.vee-companion-prompt strong {
  display: block;
  color: var(--text);
  margin-bottom: 5px;
}

.vee-companion-prompt span {
  display: block;
  color: var(--muted);
  line-height: 1.45;
  font-size: .95rem;
}

.vee-prompt-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.vee-prompt-chips span {
  padding: 9px 12px;
  border-radius: 999px;
  color: #dffef8;
  font-weight: 800;
  font-size: .88rem;
  background: rgba(82, 255, 224, 0.10);
  border: 1px solid rgba(82, 255, 224, 0.20);
}

@keyframes veeCompanionPulse {
  0%, 100% { transform: translate(-50%, -50%) scale(1); filter: brightness(1) saturate(1); }
  50% { transform: translate(-50%, -50%) scale(1.045); filter: brightness(1.13) saturate(1.18); }
}

@media (max-width: 860px) {
  .vee-companion-card {
    grid-template-columns: 1fr;
  }

  .vee-companion-orb {
    min-height: 330px;
    order: -1;
    padding-bottom: 100px;
  }

  .vee-companion-prompt {
    bottom: 8px;
    width: min(360px, 90%);
    max-width: 360px;
  }
}

@media (max-width: 560px) {
  .vee-companion-card {
    padding: 22px;
    border-radius: 28px;
  }

  .vee-companion-core {
    width: 118px;
    height: 118px;
    font-size: 1.65rem;
  }

  .vee-companion-avatar {
    width: 64px;
    max-height: 104px;
  }

  .vee-companion-orb::before,
  .vee-companion-orb::after {
    width: min(300px, 92vw);
    height: 120px;
  }

  .vee-companion-prompt {
    width: min(100%, 320px);
    padding: 14px 15px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .vee-companion-core {
    animation: none;
  }
}

.result-vee-prompt {
  margin-top: 16px;
  padding: 14px 16px;
  border-radius: 20px;
  background: rgba(82, 255, 224, 0.08);
  border: 1px solid rgba(82, 255, 224, 0.18);
}

.result-vee-prompt strong {
  display: block;
  color: var(--text);
  margin-bottom: 5px;
}

.result-vee-prompt span {
  display: block;
  color: var(--muted);
  line-height: 1.5;
}

/* ================================
   Floating Vee launcher + side panel
================================ */
body.vee-panel-open {
  overflow: hidden;
}

.vee-launcher {
  position: relative;
  z-index: 1200;
}

.vee-launcher__button {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 1203;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 62px;
  padding: 7px 16px 7px 8px;
  border: 1px solid rgba(106, 242, 255, .36);
  border-radius: 999px;
  background:
    linear-gradient(135deg, rgba(8, 18, 48, .96), rgba(22, 24, 74, .96));
  color: #f7fbff;
  box-shadow:
    0 18px 52px rgba(0, 0, 0, .38),
    0 0 32px rgba(82, 255, 224, .14);
  cursor: pointer;
  font: inherit;
  font-weight: 900;
  transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}

.vee-launcher__button:hover,
.vee-launcher__button:focus-visible {
  transform: translateY(-2px);
  border-color: rgba(106, 242, 255, .72);
  box-shadow:
    0 20px 58px rgba(0, 0, 0, .42),
    0 0 38px rgba(82, 255, 224, .24);
  outline: none;
}

.vee-launcher__avatar {
  position: relative;
  z-index: 2;
  width: 48px;
  height: 48px;
  object-fit: contain;
  animation: veeFloat 3.8s ease-in-out infinite;
}

.vee-launcher__glow {
  position: absolute;
  left: 13px;
  top: 50%;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  transform: translateY(-50%);
  background: radial-gradient(circle, rgba(106,242,255,.48), rgba(138,92,255,.18) 52%, transparent 72%);
  filter: blur(7px);
  animation: veeGlow 2.8s ease-in-out infinite;
}

.vee-launcher__label {
  white-space: nowrap;
}

.vee-panel {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 1205;
  width: min(420px, 100vw);
  height: 100dvh;
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr) auto auto;
  gap: 14px;
  padding: 20px;
  transform: translateX(105%);
  visibility: hidden;
  background:
    radial-gradient(circle at 18% 8%, rgba(82,255,224,.18), transparent 30%),
    radial-gradient(circle at 88% 72%, rgba(185,150,255,.18), transparent 34%),
    linear-gradient(180deg, rgba(7,12,34,.99), rgba(5,8,24,.99));
  border-left: 1px solid rgba(255,255,255,.14);
  box-shadow: -24px 0 80px rgba(0,0,0,.42);
  transition: transform .28s ease, visibility .28s ease;
}

.vee-panel.is-open {
  transform: translateX(0);
  visibility: visible;
}

.vee-panel__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.vee-panel__identity {
  display: flex;
  align-items: center;
  gap: 12px;
}

.vee-panel__avatar-wrap {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background:
    radial-gradient(circle at 34% 26%, #fff, #6af2ff 32%, #8a5cff 72%, #ff7be5);
  box-shadow:
    0 0 30px rgba(106,242,255,.32),
    inset 0 0 18px rgba(255,255,255,.26);
}

.vee-panel__avatar-wrap[data-vee-state="thinking"] {
  animation: veeThinking 1s ease-in-out infinite;
}

.vee-panel__avatar {
  width: 46px;
  height: 46px;
  object-fit: contain;
}

.vee-panel__eyebrow {
  margin: 0 0 3px;
  color: #52ffe0;
  font-size: .72rem;
  font-weight: 900;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.vee-panel__identity h2 {
  margin: 0;
  font-size: 1.45rem;
}

.vee-panel__close {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,.16);
  background: rgba(255,255,255,.07);
  color: #fff;
  cursor: pointer;
  font: inherit;
  font-size: 1.5rem;
}

.vee-panel__opening {
  margin: 0;
  padding: 13px 15px;
  border-radius: 18px;
  border: 1px solid rgba(82,255,224,.20);
  background: rgba(82,255,224,.08);
  color: #effcff;
  line-height: 1.45;
  font-weight: 750;
}

.vee-panel__prompts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.vee-panel__prompts button {
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 999px;
  background: rgba(255,255,255,.06);
  color: #eaf6ff;
  padding: 9px 12px;
  cursor: pointer;
  font: inherit;
  font-size: .86rem;
  font-weight: 800;
}

.vee-panel__prompts button:hover,
.vee-panel__prompts button:focus-visible {
  border-color: rgba(82,255,224,.54);
  background: rgba(82,255,224,.09);
  outline: none;
}

.vee-panel__messages {
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 4px 2px 10px;
}

.vee-panel .vee-message {
  max-width: 88%;
  padding: 11px 13px;
  border-radius: 17px;
  line-height: 1.45;
  white-space: pre-wrap;
}

.vee-panel .vee-message--vee {
  align-self: flex-start;
  background: linear-gradient(145deg, rgba(57,153,255,.15), rgba(120,91,255,.11));
  border: 1px solid rgba(106,242,255,.24);
  border-bottom-left-radius: 6px;
}

.vee-panel .vee-message--user {
  align-self: flex-end;
  color: #071426;
  background: linear-gradient(135deg, #6af2ff, #b9a2ff);
  border-bottom-right-radius: 6px;
  font-weight: 700;
}

.vee-panel__form {
  display: grid;
  gap: 8px;
}

.vee-panel__form label {
  font-size: .86rem;
  font-weight: 850;
}

.vee-panel__input-row {
  display: grid;
  grid-template-columns: minmax(0,1fr) auto;
  gap: 8px;
  padding: 7px;
  border-radius: 17px;
  border: 1px solid rgba(255,255,255,.15);
  background: rgba(255,255,255,.05);
}

.vee-panel__input-row:focus-within {
  border-color: rgba(106,242,255,.62);
  box-shadow: 0 0 0 2px rgba(106,242,255,.12);
}

#vee-input {
  width: 100%;
  min-height: 58px;
  max-height: 132px;
  height: 58px;
  resize: none;
  overflow-y: hidden;
  scrollbar-width: thin;
  border: 0;
  background: transparent;
  color: #fff;
  padding: 10px 12px;
  font: inherit;
  line-height: 1.45;
}

#vee-input:focus {
  outline: none;
}

.vee-panel__send {
  align-self: end;
  min-height: 46px;
  padding: 0 15px;
  border: 0;
  border-radius: 14px;
  background: linear-gradient(135deg, #52ffe0, #8be9ff, #d9c7ff);
  color: #07122d;
  cursor: pointer;
  font: inherit;
  font-weight: 950;
}

.vee-panel__reset {
  justify-self: end;
  border: 0;
  background: transparent;
  color: #8be9ff;
  cursor: pointer;
  font: inherit;
  font-size: .82rem;
  font-weight: 800;
}

.vee-panel__note {
  margin: 0;
  color: rgba(184,201,232,.72);
  font-size: .75rem;
  line-height: 1.35;
}

.vee-panel__backdrop {
  position: fixed;
  inset: 0;
  z-index: 1204;
  border: 0;
  background: rgba(3,6,18,.58);
  backdrop-filter: blur(4px);
  cursor: default;
}

.vee-panel__backdrop[hidden] {
  display: none;
}

@keyframes veeFloat {
  0%, 100% { transform: translateY(0) rotate(-1deg); }
  50% { transform: translateY(-4px) rotate(1deg); }
}

@keyframes veeGlow {
  0%, 100% { opacity: .65; transform: translateY(-50%) scale(.92); }
  50% { opacity: 1; transform: translateY(-50%) scale(1.08); }
}

@keyframes veeThinking {
  0%, 100% { transform: scale(1); filter: brightness(1); }
  50% { transform: scale(1.08); filter: brightness(1.18); }
}

@media (max-width: 640px) {
  .vee-launcher__button {
    right: 14px;
    bottom: 14px;
    min-height: 56px;
    padding-right: 13px;
  }

  .vee-launcher__avatar {
    width: 43px;
    height: 43px;
  }

  .vee-panel {
    width: 100vw;
    padding: 16px;
  }

  .vee-panel__input-row {
    grid-template-columns: 1fr;
  }

  .vee-panel__send {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .vee-launcher__avatar,
  .vee-launcher__glow,
  .vee-panel__avatar-wrap[data-vee-state="thinking"] {
    animation: none;
  }

  .vee-panel {
    transition: none;
  }
}

#vee-input::-webkit-scrollbar {
  width: 6px;
}

#vee-input::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(139, 233, 255, .38);
}

#vee-input::-webkit-scrollbar-track {
  background: transparent;
}

/* Mobile launcher visibility and safe-area guard */
@media (max-width: 640px) {
  .vee-launcher,
  .vee-launcher__button {
    visibility: visible !important;
    opacity: 1 !important;
  }

  .vee-launcher__button {
    display: inline-flex !important;
    right: max(14px, env(safe-area-inset-right));
    bottom: calc(14px + env(safe-area-inset-bottom));
    z-index: 2147483000;
    min-width: 58px;
    min-height: 58px;
    padding: 7px 12px 7px 7px;
  }

  .vee-launcher__label {
    display: none;
  }

  .vee-launcher__avatar {
    width: 44px;
    height: 44px;
  }

  .vee-launcher__glow {
    left: 10px;
  }

  .vee-panel {
    z-index: 2147483002;
    height: 100svh;
    min-height: 100dvh;
    padding:
      max(16px, env(safe-area-inset-top))
      16px
      max(16px, env(safe-area-inset-bottom));
  }

  .vee-panel__backdrop {
    z-index: 2147483001;
  }

  #vee-input {
    min-height: 64px;
    height: 64px;
    max-height: 144px;
  }
}
