/*
 * Rainbow underglow adapted for the Hangul input from Magic UI:
 * https://github.com/magicuidesign/magicui/blob/main/apps/www/registry/magicui/rainbow-button.tsx
 *
 * MIT License
 *
 * Copyright (c) Magic UI
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in all
 * copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
 * SOFTWARE.
 */

.liquid-composer {
  --composer-rainbow-gradient: linear-gradient(90deg,
    #ff6384 0%, #ffd166 20%, #75d9b1 40%, #62b6ff 60%, #b68aff 80%, #ff6384 100%);
  --composer-rainbow-duration: 10s;
}

@property --liquid-border-angle {
  syntax: "<angle>";
  inherits: false;
  initial-value: 0deg;
}

.liquid-composer::before,
.liquid-composer::after {
  content: "";
  position: absolute;
  box-sizing: border-box;
  pointer-events: none;
}

/* Restore the original thin pink-and-blue highlight around the grey border. */
.liquid-composer::before {
  inset: -1px;
  z-index: 1;
  border-radius: inherit;
  padding: calc(1px / .6);
  background: conic-gradient(from var(--liquid-border-angle),
    transparent 0deg 240deg, rgba(255, 105, 180, .15) 275deg,
    rgba(238, 65, 190, .8) 310deg, rgba(55, 135, 255, .95) 335deg,
    #fff 347deg, transparent 360deg);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask-composite: exclude;
  animation: liquid-border-orbit 6s linear infinite;
}

.liquid-composer::after {
  left: 50%;
  bottom: -11%;
  z-index: -1;
  width: 68%;
  height: 18%;
  transform: translateX(-50%);
  border-radius: 50%;
  background-image: var(--composer-rainbow-gradient);
  background-size: 200% 100%;
  background-repeat: repeat-x;
  filter: blur(14px);
  opacity: .24;
  animation: composer-rainbow-flow var(--composer-rainbow-duration) linear infinite;
  transition: opacity 240ms ease;
}

.liquid-composer:hover::after { opacity: .35; }
.liquid-composer:focus-within::after { opacity: .45; }

@keyframes liquid-border-orbit {
  from { --liquid-border-angle: 0deg; }
  to { --liquid-border-angle: 360deg; }
}

@keyframes composer-rainbow-flow {
  from { background-position: 0% 50%; }
  to { background-position: 200% 50%; }
}

@supports not ((mask-composite: exclude) or (-webkit-mask-composite: xor)) {
  .liquid-composer::before { content: none; }
}

@media (prefers-reduced-motion: reduce) {
  .liquid-composer::before,
  .liquid-composer::after {
    animation: none;
    transition: none;
  }
}
