/*
 * DCS empty-chat treatment for LibreChat v0.8.8-rc1.
 *
 * ConversationStarters is rendered only on an empty chat. Keying off its
 * version-pinned class list keeps the background out of active conversations
 * without patching LibreChat's compiled JavaScript. Re-audit this selector
 * whenever the upstream image changes.
 */
.relative.flex.h-full.w-full.flex-col:has(
    .mb-8.mt-2.flex.w-full.flex-wrap.items-stretch.justify-center.gap-2.px-4
  ) {
  isolation: isolate;
}

.relative.flex.h-full.w-full.flex-col:has(
    .mb-8.mt-2.flex.w-full.flex-wrap.items-stretch.justify-center.gap-2.px-4
  )::before {
  position: absolute;
  inset: 0;
  z-index: -1;
  --dcs-home-art-opacity: 1;
  background-image: url('/assets/dcs-routing-background.svg');
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
  content: '';
  opacity: var(--dcs-home-art-opacity);
  pointer-events: none;
}

/* Give the native starter cards a restrained DCS interaction state. */
.mb-8.mt-2.flex.w-full.flex-wrap.items-stretch.justify-center.gap-2.px-4 > button:hover {
  border-color: #ffcd00;
  box-shadow: 0 8px 22px rgb(38 38 38 / 10%);
}

.mb-8.mt-2.flex.w-full.flex-wrap.items-stretch.justify-center.gap-2.px-4 > button:focus-visible {
  outline: 3px solid rgb(255 205 0 / 45%);
  outline-offset: 2px;
}

.dark
  .relative.flex.h-full.w-full.flex-col:has(
    .mb-8.mt-2.flex.w-full.flex-wrap.items-stretch.justify-center.gap-2.px-4
  )::before {
  --dcs-home-art-opacity: 0.9;
}

@media (max-width: 767px) {
  .relative.flex.h-full.w-full.flex-col:has(
      .mb-8.mt-2.flex.w-full.flex-wrap.items-stretch.justify-center.gap-2.px-4
    )::before {
    --dcs-home-art-opacity: 0.72;
    background-size: auto 100%;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .relative.flex.h-full.w-full.flex-col:has(
      .mb-8.mt-2.flex.w-full.flex-wrap.items-stretch.justify-center.gap-2.px-4
    )::before {
    animation: dcs-routing-arrive 700ms ease-out both;
  }
}

@keyframes dcs-routing-arrive {
  from {
    opacity: 0;
    transform: scale(1.015);
  }

  to {
    opacity: var(--dcs-home-art-opacity);
    transform: scale(1);
  }
}
