@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=Kumbh+Sans:wght@100;200;300;400;500;600;700;800;900&display=swap');

@tailwind base;
@tailwind components;
@tailwind utilities;

@layer base {
  :root {
    --background: 0 0% 100%;
    --foreground: 0 0% 3.9%;
    --card: 0 0% 100%;
    --card-foreground: 0 0% 3.9%;
    --popover: 0 0% 100%;
    --popover-foreground: 0 0% 3.9%;
    --primary: 0 0% 9%;
    --primary-foreground: 0 0% 98%;
    --secondary: 0 0% 96.1%;
    --secondary-foreground: 0 0% 9%;
    --muted: 0 0% 96.1%;
    --muted-foreground: 0 0% 45.1%;
    --accent: 0 0% 96.1%;
    --accent-foreground: 0 0% 9%;
    --destructive: 0 84.2% 60.2%;
    --destructive-foreground: 0 0% 98%;
    --border: 0 0% 89.8%;
    --input: 0 0% 89.8%;
    --ring: 0 0% 3.9%;
    --chart-1: 12 76% 61%;
    --chart-2: 173 58% 39%;
    --chart-3: 197 37% 24%;
    --chart-4: 43 74% 66%;
    --chart-5: 27 87% 67%;
    --radius: 0.5rem;
    --transition: 0.25s;
    --spark: 1.8s;
  }

  .dark {
    --background: 0 0% 3.9%;
    --foreground: 0 0% 98%;
    --card: 0 0% 3.9%;
    --card-foreground: 0 0% 98%;
    --popover: 0 0% 3.9%;
    --popover-foreground: 0 0% 98%;
    --primary: 0 0% 98%;
    --primary-foreground: 0 0% 9%;
    --secondary: 0 0% 14.9%;
    --secondary-foreground: 0 0% 98%;
    --muted: 0 0% 14.9%;
    --muted-foreground: 0 0% 63.9%;
    --accent: 0 0% 14.9%;
    --accent-foreground: 0 0% 98%;
    --destructive: 0 62.8% 30.6%;
    --destructive-foreground: 0 0% 98%;
    --border: 0 0% 14.9%;
    --input: 0 0% 14.9%;
    --ring: 0 0% 83.1%;
    --chart-1: 220 70% 50%;
    --chart-2: 160 60% 45%;
    --chart-3: 30 80% 55%;
    --chart-4: 280 65% 60%;
    --chart-5: 340 75% 55%;
  }
}

@layer base {
  * {
    @apply border-border;
  }
  body {
    @apply m-0 min-h-dvh w-full bg-background text-foreground;
    font-family: 'Inter', sans-serif;
  }
}

input::placeholder {
  transition: color 150ms ease-out;
}

@keyframes gradient-x {
  0%,
  100% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
}

@keyframes pulse-glow {
  0%,
  100% {
    opacity: 0.3;
    transform: scale(1);
  }
  50% {
    opacity: 0.5;
    transform: scale(1.02);
  }
}

/* Hide scrollbar for Chrome, Safari and Opera */
.hide-scrollbar::-webkit-scrollbar {
  display: none;
}

/* Hide scrollbar for IE, Edge and Firefox */
.hide-scrollbar {
  -ms-overflow-style: none; /* IE and Edge */
  scrollbar-width: none; /* Firefox */
}

.glass-effect {
  backdrop-filter: blur(12px);
  background: linear-gradient(
    135deg,
    rgba(26, 26, 26, 0.9) 0%,
    rgba(26, 26, 26, 0.8) 100%
  );
}

.text-shadow-glow {
  text-shadow: 0 0 10px rgba(255, 45, 146, 0.3);
}

.shadow-adam {
  box-shadow:
    0px 2px 4px 0px rgba(255, 85, 167, 0.25),
    0px 1px 2px 0px rgba(255, 255, 255, 0.15) inset,
    0px 1px 3px 0px rgba(255, 255, 255, 0.25) inset;
}
.shadow-adam-card {
  box-shadow:
    0px 1px 2px 0px rgba(255, 255, 255, 0.15) inset,
    0px 1px 3px 0px rgba(255, 255, 255, 0.25) inset;
}

@layer utilities {
  .pb-safe {
    padding-bottom: env(safe-area-inset-bottom);
  }
  .pt-safe {
    padding-top: env(safe-area-inset-top);
  }
  .mb-safe {
    margin-bottom: env(safe-area-inset-bottom);
  }
  .mt-safe {
    margin-top: env(safe-area-inset-top);
  }

  /* -------------------------------------------------------------------------
   *  Model Selector – Flip Clock Animations
   *  These keyframes & utility classes power the old flip-style transition
   *  where the previous label flips upward and the new one flips down into
   *  place (similar to a mechanical split-flap clock).
   *  Currently not used but kept for possible future UI variants.
   * ---------------------------------------------------------------------- */
  @keyframes flip-out-up {
    0% {
      transform: rotateX(0deg);
      opacity: 1;
    }
    100% {
      transform: rotateX(90deg) translateY(-4px);
      opacity: 0;
    }
  }

  @keyframes flip-in-down {
    0% {
      transform: rotateX(-90deg) translateY(4px);
      opacity: 0;
    }
    70% {
      transform: rotateX(10deg);
    }
    100% {
      transform: rotateX(0deg);
      opacity: 1;
    }
  }

  .flip-out-up {
    transform-origin: top;
    animation: flip-out-up 0.6s cubic-bezier(0.55, 0.12, 0.35, 1.36) forwards;
  }

  .flip-in-down {
    transform-origin: bottom;
    animation: flip-in-down 0.6s cubic-bezier(0.55, 0.12, 0.35, 1.36) forwards;
  }

  .flip-perspective {
    perspective: 800px;
  }

  .loader path {
    stroke: #f8248a;
    stroke-width: 0.6px;
    animation:
      dashArray 6s ease-in-out infinite,
      dashOffset 6s linear infinite;
  }

  /* -------------------------------------------------------------------------
   *  Model Selector – Wheel/Slide Animations
   *  The following keyframes & utility classes are used by the <ModelSelector>
   *  component to create a scroll-wheel effect when the model changes.  
   *
   *  Direction is applied at runtime:
   *    • slide-in-up / slide-out-up   → content moves UP (new model appears)
   *    • slide-in-down / slide-out-down → content moves DOWN
   *
   *  Animation timing & easing can be tweaked in one place here.
   * ---------------------------------------------------------------------- */
  @keyframes slide-out-up {
    0% {
      transform: translateY(0%);
      opacity: 1;
    }
    100% {
      transform: translateY(-100%);
      opacity: 0;
    }
  }

  @keyframes slide-in-up {
    0% {
      transform: translateY(100%);
      opacity: 0;
    }
    80% {
      transform: translateY(-4%);
    }
    100% {
      transform: translateY(0%);
      opacity: 1;
    }
  }

  .slide-out-up {
    animation: slide-out-up 0.55s cubic-bezier(0.25, 0.46, 0.45, 1) forwards;
  }

  .slide-in-up {
    animation: slide-in-up 0.55s cubic-bezier(0.25, 0.46, 0.45, 1) forwards;
  }

  @keyframes slide-out-down {
    0% {
      transform: translateY(0%);
      opacity: 1;
    }
    100% {
      transform: translateY(100%);
      opacity: 0;
    }
  }

  @keyframes slide-in-down {
    0% {
      transform: translateY(-100%);
      opacity: 0;
    }
    80% {
      transform: translateY(4%);
    }
    100% {
      transform: translateY(0%);
      opacity: 1;
    }
  }

  .slide-out-down {
    animation: slide-out-down 0.55s cubic-bezier(0.25, 0.46, 0.45, 1) forwards;
  }

  .slide-in-down {
    animation: slide-in-down 0.55s cubic-bezier(0.25, 0.46, 0.45, 1) forwards;
  }

  /* -------------------------------------------------------------------------
   *  Greeting Text – Horizontal Slide Animations
   *  These keyframes & utility classes power the horizontal slide transition
   *  where the previous text slides out to the left/right and the new text
   *  slides in from the opposite direction.
   * ---------------------------------------------------------------------- */
  @keyframes slide-out-left {
    0% {
      transform: translateX(0%);
      opacity: 1;
    }
    100% {
      transform: translateX(-100%);
      opacity: 0;
    }
  }

  @keyframes slide-in-right {
    0% {
      transform: translateX(100%);
      opacity: 0;
    }
    80% {
      transform: translateX(-4%);
    }
    100% {
      transform: translateX(0%);
      opacity: 1;
    }
  }

  @keyframes slide-out-right {
    0% {
      transform: translateX(0%);
      opacity: 1;
    }
    100% {
      transform: translateX(100%);
      opacity: 0;
    }
  }

  @keyframes slide-in-left {
    0% {
      transform: translateX(-100%);
      opacity: 0;
    }
    80% {
      transform: translateX(4%);
    }
    100% {
      transform: translateX(0%);
      opacity: 1;
    }
  }

  .slide-out-left {
    animation: slide-out-left 0.55s cubic-bezier(0.25, 0.46, 0.45, 1) forwards;
  }

  .slide-in-right {
    animation: slide-in-right 0.55s cubic-bezier(0.25, 0.46, 0.45, 1) forwards;
  }

  .slide-out-right {
    animation: slide-out-right 0.55s cubic-bezier(0.25, 0.46, 0.45, 1) forwards;
  }

  .slide-in-left {
    animation: slide-in-left 0.55s cubic-bezier(0.25, 0.46, 0.45, 1) forwards;
  }
}

/* Sparkle Button Styles */
@keyframes bounce {
  35%,
  65% {
    scale: var(--scale);
  }
}

@keyframes flip {
  to {
    rotate: 360deg;
  }
}

@keyframes rotate {
  to {
    transform: rotate(90deg);
  }
}

@keyframes float-out {
  to {
    rotate: 360deg;
  }
}

.sparkle-button {
  position: relative;
}

.sparkle-button button {
  --cut: 0.1em;
  --active: 0;
  --bg:
    radial-gradient(
      40% 50% at center 100%,
      hsl(330 calc(var(--active) * 97%) 72% / var(--active)),
      transparent
    ),
    radial-gradient(
      80% 100% at center 120%,
      hsl(340 calc(var(--active) * 97%) 70% / var(--active)),
      transparent
    ),
    hsl(335 calc(var(--active) * 97%) calc((var(--active) * 44%) + 12%));
  background: var(--bg);
  font-size: 1rem;
  font-weight: 500;
  border: 0;
  cursor: pointer;
  padding: 0.9em 1.3em;
  display: flex;
  align-items: center;
  gap: 0.25em;
  white-space: nowrap;
  border-radius: 100px;
  position: relative;
  box-shadow:
    0 0 calc(var(--active) * 6em) calc(var(--active) * 3em)
      hsl(330 97% 61% / 0.75),
    0 0.05em 0 0
      hsl(330 calc(var(--active) * 97%) calc((var(--active) * 50%) + 30%)) inset,
    0 -0.05em 0 0 hsl(330 calc(var(--active) * 97%) calc(var(--active) * 60%))
      inset;
  transition:
    box-shadow var(--transition),
    scale var(--transition),
    background var(--transition);
  scale: calc(1 + (var(--active) * 0.1));
}

.sparkle-button button:is(:hover, :focus-visible) {
  --active: 1;
}

.sparkle-button button:active {
  scale: 1;
}

.sparkle-button button:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.sparkle-button button:disabled:is(:hover, :focus-visible) {
  --active: 0;
  scale: 1;
}

.sparkle-button .spark {
  position: absolute;
  inset: 0;
  border-radius: 100px;
  rotate: 0deg;
  overflow: hidden;
  mask: linear-gradient(white, transparent 50%);
  -webkit-mask: linear-gradient(white, transparent 50%);
  animation: flip calc(var(--spark) * 2) infinite steps(2, end);
  animation-play-state: paused;
}

.sparkle-button button:is(:hover, :focus-visible) .spark {
  animation-play-state: running;
}

.sparkle-button .spark:before {
  content: '';
  position: absolute;
  width: 200%;
  aspect-ratio: 1;
  top: 0%;
  left: 50%;
  z-index: -1;
  translate: -50% -15%;
  rotate: 0;
  transform: rotate(-90deg);
  opacity: calc((var(--active)) + 0.4);
  background: conic-gradient(from 0deg, transparent 0 340deg, white 360deg);
  transition: opacity var(--transition);
  animation: rotate var(--spark) linear infinite both;
  animation-play-state: paused;
}

.sparkle-button button:is(:hover, :focus-visible) .spark:before {
  animation-play-state: running;
}

.sparkle-button .spark:after {
  content: '';
  position: absolute;
  inset: var(--cut);
  border-radius: 100px;
}

.sparkle-button .backdrop {
  position: absolute;
  inset: var(--cut);
  background: var(--bg);
  border-radius: 100px;
  transition: background var(--transition);
}

.sparkle-button svg {
  overflow: visible !important;
  width: 1.25em;
  height: 1.25em;
  translate: -25% -5%;
}

.sparkle-button svg path {
  color: hsl(0 0% calc((var(--active, 0) * 70%) + var(--base)));
  transform-box: fill-box;
  transform-origin: center;
  fill: currentColor;
  stroke: currentColor;
  animation-delay: calc((var(--transition) * 1.5) + (var(--delay) * 1s));
  animation-duration: 0.6s;
  transition: color var(--transition);
}

.sparkle-button button:is(:hover, :focus-visible) path {
  animation-name: bounce;
}

.sparkle-button svg path:nth-of-type(1) {
  --scale: 0.5;
  --delay: 0.1;
  --base: 40%;
}

.sparkle-button svg path:nth-of-type(2) {
  --scale: 1.5;
  --delay: 0.2;
  --base: 20%;
}

.sparkle-button svg path:nth-of-type(3) {
  --scale: 2.5;
  --delay: 0.35;
  --base: 30%;
}

.sparkle-button button:before {
  content: '';
  position: absolute;
  inset: -0.25em;
  z-index: -1;
  border: 0.25em solid hsl(330 97% 50% / 0.5);
  border-radius: 100px;
  opacity: var(--active, 0);
  transition: opacity var(--transition);
}

.sparkle-button .text {
  translate: 2% -6%;
  letter-spacing: 0.01ch;
  background: linear-gradient(
    90deg,
    hsl(0 0% calc((var(--active) * 100%) + 65%)),
    hsl(0 0% calc((var(--active) * 100%) + 26%))
  );
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  transition: background var(--transition);
}

/* Body Drop */
.sparkle-button .bodydrop {
  background: hsl(335 97% 6%);
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: 100px;
  opacity: var(--active, 0);
  transition: opacity var(--transition);
}

/* Particle Pen */
.sparkle-button .particle-pen {
  position: absolute;
  width: 200%;
  aspect-ratio: 1;
  top: 50%;
  left: 50%;
  translate: -50% -50%;
  -webkit-mask: radial-gradient(white, transparent 65%);
  mask: radial-gradient(white, transparent 65%);
  z-index: -1;
  opacity: var(--active, 0);
  transition: opacity var(--transition);
}

.sparkle-button .particle {
  fill: white;
  width: calc(var(--size, 0.25) * 1rem);
  aspect-ratio: 1;
  position: absolute;
  top: calc(var(--y) * 1%);
  left: calc(var(--x) * 1%);
  opacity: var(--alpha, 1);
  animation: float-out calc(var(--duration, 1) * 1s) calc(var(--delay) * -1s)
    infinite linear;
  transform-origin: var(--origin-x, 1000%) var(--origin-y, 1000%);
  z-index: -1;
  animation-play-state: var(--play-state, paused);
}

.sparkle-button button:is(:hover, :focus-visible) ~ .particle-pen {
  --play-state: running;
}

.sparkle-button .particle:nth-of-type(even) {
  animation-direction: reverse;
}

.sparkle-button .particle path {
  fill: hsl(0 0% 90%);
  stroke: none;
}

/* Add loading state styles to the sparkle button */
.sparkle-button .loading-text {
  color: white !important;
  background: transparent !important;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Hide animations on disabled buttons */
.sparkle-button button:disabled {
  --active: 0 !important;
  scale: 1 !important;
  opacity: 0.7;
  cursor: not-allowed;
  background: hsl(0, 0%, 13%) !important;
  box-shadow: none !important;
}

.sparkle-button button:disabled .text {
  background: transparent !important;
  color: hsl(0, 0%, 80%);
}

/* Ensure loading state has proper styling */
.sparkle-button button:disabled.loading-text {
  opacity: 1;
}

/* Keyframes for TrialBanner animations */
@keyframes float {
  0%,
  100% {
    transform: translateY(0) translateX(0);
  }
  50% {
    transform: translateY(-15px) translateX(5px);
  }
}

@keyframes shine {
  0% {
    background-position: -100% 0;
  }
  100% {
    background-position: 200% 0;
  }
}

/* Loader Animations */
@keyframes dashArray {
  0% {
    stroke-dasharray: 0 1 359 0;
  }

  50% {
    stroke-dasharray: 0 359 1 0;
  }

  100% {
    stroke-dasharray: 359 1 0 0;
  }
}

@keyframes dashOffset {
  0% {
    stroke-dashoffset: 365;
  }

  100% {
    stroke-dashoffset: 5;
  }
}

.resize-handle {
  width: 4px;
  background-color: #3b3b3b;
  transition: background-color 150ms ease;
  position: relative;
}

.resize-handle::before {
  content: '';
  position: absolute;
  top: 0;
  left: -8px;
  right: -8px;
  bottom: 0;
  z-index: 1;
  cursor: col-resize;
}

.resize-handle:hover,
.resize-handle[data-resize-handle-state='hover'] {
  background-color: #5a5a5a;
}

.resize-handle[data-resize-handle-state='drag'] {
  background-color: #676767;
}
.glow-layer-1 {
  background: conic-gradient(
    from 0deg,
    #ff7c7c,
    #f47dff,
    #ff3ea2,
    #ffa62a,
    #ff7c7c
  );
  animation: rotate-glow 12s linear infinite;
  filter: blur(60px);
  opacity: 0.8;
  transform: scale(1);
}

.glow-layer-2 {
  background: conic-gradient(
    from 45deg,
    #ff7c7c,
    #f47dff,
    #ff3ea2,
    #ffa62a,
    #ff7c7c
  );
  animation: rotate-glow 10s linear infinite reverse;
  filter: blur(30px);
  opacity: 0.6;
  transform: scale(1);
}

.blur-transition-layer {
  background: conic-gradient(
    from 90deg,
    #ff7c7c,
    #f47dff,
    #ff3ea2,
    #ffa62a,
    #ff7c7c
  );
  animation: rotate-glow 8s linear infinite;
  filter: blur(100px);
  opacity: 0.4;
  transform: scale(1);
}

@keyframes rotate-glow {
  0% {
    transform: rotate(0deg) scale(1);
  }
  100% {
    transform: rotate(360deg) scale(1);
  }
}

.logo-container {
  position: relative;
  width: 300px;
  height: 95px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.small-logo {
  position: absolute;
  transition: all 1.5s cubic-bezier(0.4, 0, 0.2, 1);
  transform: scale(1);
  opacity: 1;
  image-rendering: crisp-edges;
  shape-rendering: crispEdges;
}

.small-logo.hidden {
  transform: scale(0.8);
  opacity: 0;
}

.full-logo {
  position: absolute;
  transition: all 1.5s cubic-bezier(0.4, 0, 0.2, 1);
  transform: scale(0.8) translateY(20px);
  opacity: 0;
  image-rendering: crisp-edges;
  shape-rendering: crispEdges;
}

.full-logo.visible {
  transform: scale(1) translateY(0);
  opacity: 1;
}

.full-logo.hidden {
  transform: scale(0.8);
  opacity: 0;
}

.typewriter-container {
  position: absolute;
  width: 300px;
  height: 95px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 1s cubic-bezier(0.4, 0, 0.2, 1);
  transform: scale(0.8) translateY(20px);
  opacity: 0;
}

.typewriter-container.visible {
  transform: scale(1) translateY(0);
  opacity: 1;
}

.typewriter-text {
  font-size: 32px;
  font-weight: 300;
  font-family: 'Kumbh Sans', sans-serif;
  color: #e5e5e5;
  text-align: center;
  white-space: nowrap;
}

.typewriter-cursor {
  display: inline-block;
  width: 2px;
  height: 32px;
  background-color: #e5e5e5;
  margin-left: 2px;
  animation: blink 1s infinite;
}

.typewriter-cursor.hidden {
  animation: none;
  opacity: 0;
}

@keyframes blink {
  0%,
  50% {
    opacity: 1;
  }
  51%,
  100% {
    opacity: 0;
  }
}

.next-button {
  transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  transform: translateY(20px);
  opacity: 0;
}

.next-button.visible {
  transform: translateY(0);
  opacity: 1;
}

.page-transition {
  transition: all 0.7s ease-out;
}

.page-transition.transitioning {
  transform: scale(1.1) translateY(10px);
}

.loading-button {
  position: relative;
  overflow: hidden;
}

.loading-button::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.1),
    transparent
  );
  transition: left 0.5s ease;
}

.loading-button.loading::before {
  left: 100%;
  animation: loading-shimmer 1.5s infinite;
}

@keyframes loading-shimmer {
  0% {
    left: -100%;
  }
  100% {
    left: 100%;
  }
}
