/* ============================================
   Custom CSS - Animations, Gradients, Effects
   (Extracted from app/globals.css)
   ============================================ */

/* Smooth scrolling */
html {
  scroll-behavior: smooth;
}

/* Base border color */
* {
  border-color: var(--color-border);
}

/* Base border color */
* {
  border-color: var(--color-border);
}

/* ============================================
   Header Scroll Animation
   ============================================ */
.header-animate {
  max-width: 100%;
  border-radius: 0;
  top: 0;
  border-bottom: 1px solid var(--color-border);
  transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-animate {
  transition: height 0.4s cubic-bezier(0.4, 0, 0.2, 1),
    padding 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.logo-img-animate {
  transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.logo-text-animate {
  transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Scrolled state - floating pill with glassmorphism */
.header-scrolled {
  max-width: 900px;
  margin-left: auto;
  margin-right: auto;
  border-radius: 9999px;
  top: 10px;
  border: 1px solid rgba(255, 255, 255, 0.25) !important;
  background-color: rgba(255, 255, 255, 0.65) !important;
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  backdrop-filter: blur(24px) saturate(180%);
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.08),
    0 2px 8px rgba(0, 0, 0, 0.04),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

/* Dark mode support for scrolled header */
@media (prefers-color-scheme: dark) {
  .header-scrolled {
    background-color: rgba(10, 10, 10, 0.7) !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    box-shadow:
      0 8px 32px rgba(0, 0, 0, 0.25),
      0 2px 8px rgba(0, 0, 0, 0.15),
      inset 0 1px 0 rgba(255, 255, 255, 0.05);
  }
}

/* ============================================
   Liquid Navigation Bar
   ============================================ */

/* Hide the SVG filter element */
.liquid-svg-filter {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
  pointer-events: none;
}

/* Wrapper positions both layers */
.liquid-nav-wrapper {
  position: relative;
  padding: 4px;
}

/* Blob layer — gooey filtered, behind text */
.liquid-blob-layer {
  position: absolute;
  inset: 0;
  filter: url(#gooey-filter);
  pointer-events: none;
  z-index: 0;
}

/* The liquid blob */
.liquid-blob {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  height: 34px;
  border-radius: 9999px;
  opacity: 0;
  background: linear-gradient(135deg,
      #7c3aed 0%,
      #6d28d9 50%,
      #8b5cf6 100%);
  box-shadow:
    0 0 20px rgba(139, 92, 246, 0.4),
    0 0 40px rgba(139, 92, 246, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 0.15);
  transition: left 0.45s cubic-bezier(0.4, 0, 0.2, 1),
    width 0.45s cubic-bezier(0.4, 0, 0.2, 1),
    opacity 0.3s ease;
  animation: liquid-pulse 3s ease-in-out infinite;
}

/* Text links layer — on top, no filter */
.liquid-nav-track {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0;
  z-index: 1;
}

/* Core Nav Links (Default transparent un-scrolled header) */
.liquid-nav-link {
  position: relative;
  padding: 6px 16px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-foreground, #0a0a0a);
  /* Default to dark text for light bg */
  text-decoration: none;
  border-radius: 9999px;
  transition: color 0.35s ease, transform 0.3s ease;
  white-space: nowrap;
  cursor: pointer;
}

.liquid-nav-link:hover,
.liquid-nav-hover {
  color: var(--color-muted-foreground, #666);
}

.liquid-nav-active {
  color: #fff;
  /* Active state is on the purple blob, always needs white text */
}

/* Scrolled state: Header background becomes dark, text must become light */
.header-scrolled .liquid-nav-link {
  color: rgba(255, 255, 255, 0.7);
}

.header-scrolled .liquid-nav-link:hover,
.header-scrolled .liquid-nav-hover {
  color: #ffffff;
}

.header-scrolled .liquid-nav-active {
  color: #ffffff;
}

@keyframes liquid-pulse {

  0%,
  100% {
    box-shadow:
      0 0 20px rgba(139, 92, 246, 0.4),
      0 0 40px rgba(139, 92, 246, 0.15),
      inset 0 1px 0 rgba(255, 255, 255, 0.15);
  }

  50% {
    box-shadow:
      0 0 25px rgba(139, 92, 246, 0.5),
      0 0 50px rgba(139, 92, 246, 0.2),
      inset 0 1px 0 rgba(255, 255, 255, 0.2);
  }
}

/* Custom Animations */
@keyframes float {

  0%,
  100% {
    transform: translateY(0px);
  }

  50% {
    transform: translateY(-10px);
  }
}

@keyframes pulse-soft {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.7;
  }
}

@keyframes slide-up {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slide-in-right {
  from {
    opacity: 0;
    transform: translateX(20px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes scale-in {
  from {
    opacity: 0;
    transform: scale(0.95);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes shimmer {
  0% {
    background-position: -200% 0;
  }

  100% {
    background-position: 200% 0;
  }
}

@keyframes gradient-x {

  0%,
  100% {
    background-position: 0% 50%;
  }

  50% {
    background-position: 100% 50%;
  }
}

@keyframes bounce-soft {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-5px);
  }
}

.animate-float {
  animation: float 6s ease-in-out infinite var(--float-delay, 0s);
}

/* --- Hero Section React Animations --- */
@keyframes blur-in {
  from {
    opacity: 0;
    filter: blur(10px);
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    filter: blur(0px);
    transform: translateY(0);
  }
}

.animate-blur-in {
  /* Using --duration and --delay CSS variables, default 0.6s and 0s */
  animation: blur-in var(--duration, 0.6s) ease-out forwards;
  animation-delay: var(--delay, 0s);
  opacity: 0;
  /* Ensures it is hidden before animation starts */
}

@keyframes split-text-up {
  from {
    opacity: 0;
    transform: translateY(40px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-split-text {
  /* Using --duration and --delay CSS variables, default 0.6s and 0s */
  animation: split-text-up var(--duration, 0.6s) ease-out forwards;
  animation-delay: var(--delay, 0s);
  opacity: 0;
  /* Ensures it is hidden before animation starts */
  display: inline-block;
}

.animate-pulse-soft {
  animation: pulse-soft 2s ease-in-out infinite;
}

.animate-slide-up {
  animation: slide-up 0.5s ease-out forwards;
}

.animate-slide-in-right {
  animation: slide-in-right 0.5s ease-out forwards;
}

.animate-scale-in {
  animation: scale-in 0.3s ease-out forwards;
}

.animate-shimmer {
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
  background-size: 200% 100%;
  animation: shimmer 2s infinite;
}

.animate-gradient-x {
  background-size: 200% 200%;
  animation: gradient-x 3s ease infinite;
}

.animate-bounce-soft {
  animation: bounce-soft 2s ease-in-out infinite;
}

/* Staggered animation delays */
.stagger-1 {
  animation-delay: 0.1s;
}

.stagger-2 {
  animation-delay: 0.2s;
}

.stagger-3 {
  animation-delay: 0.3s;
}

.stagger-4 {
  animation-delay: 0.4s;
}

.stagger-5 {
  animation-delay: 0.5s;
}

.stagger-6 {
  animation-delay: 0.6s;
}

/* Subtle Gradients */
.gradient-subtle-blue {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.05) 0%, rgba(147, 197, 253, 0.08) 50%, rgba(219, 234, 254, 0.05) 100%);
}

.gradient-subtle-purple {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.05) 0%, rgba(196, 181, 253, 0.08) 50%, rgba(237, 233, 254, 0.05) 100%);
}

.gradient-subtle-green {
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.05) 0%, rgba(134, 239, 172, 0.08) 50%, rgba(220, 252, 231, 0.05) 100%);
}

.gradient-subtle-orange {
  background: linear-gradient(135deg, rgba(249, 115, 22, 0.05) 0%, rgba(253, 186, 116, 0.08) 50%, rgba(255, 237, 213, 0.05) 100%);
}

.gradient-subtle-pink {
  background: linear-gradient(135deg, rgba(236, 72, 153, 0.05) 0%, rgba(244, 170, 205, 0.08) 50%, rgba(252, 231, 243, 0.05) 100%);
}

.gradient-hero {
  background: linear-gradient(180deg, rgba(249, 250, 251, 0) 0%, rgba(243, 244, 246, 0.5) 50%, rgba(249, 250, 251, 0) 100%);
}

.gradient-mesh {
  background:
    radial-gradient(at 40% 20%, rgba(59, 130, 246, 0.08) 0px, transparent 50%),
    radial-gradient(at 80% 0%, rgba(139, 92, 246, 0.06) 0px, transparent 50%),
    radial-gradient(at 0% 50%, rgba(34, 197, 94, 0.06) 0px, transparent 50%),
    radial-gradient(at 80% 50%, rgba(249, 115, 22, 0.05) 0px, transparent 50%),
    radial-gradient(at 0% 100%, rgba(236, 72, 153, 0.06) 0px, transparent 50%);
}

/* Hover transition utilities */
.hover-lift {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hover-lift:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.08);
}

.hover-glow {
  transition: box-shadow 0.3s ease;
}

.hover-glow:hover {
  box-shadow: 0 0 30px rgba(59, 130, 246, 0.15);
}

/* Button shine effect */
.btn-shine {
  position: relative;
  overflow: hidden;
}

.btn-shine::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(to right,
      transparent 0%,
      rgba(255, 255, 255, 0.3) 50%,
      transparent 100%);
  transform: rotate(45deg) translateX(-100%);
  transition: transform 0.6s ease;
}

.btn-shine:hover::after {
  transform: rotate(45deg) translateX(100%);
}

/* Card hover with subtle rotation */
.card-tilt {
  transition: all 0.4s ease;
}

.card-tilt:hover {
  transform: translateY(-8px) rotate(1deg);
}

/* Smooth link underline animation */
.link-underline {
  position: relative;
}

.link-underline::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: currentColor;
  transition: width 0.3s ease;
}

.link-underline:hover::after {
  width: 100%;
}

/* ============================================
   Component Styles (shadcn/ui equivalents)
   ============================================ */

/* Badge */
.badge {
  display: inline-flex;
  align-items: center;
  border-radius: 9999px;
  padding: 0.125rem 0.625rem;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.25rem;
  transition: colors 0.15s ease;
}

.badge-secondary {
  background-color: var(--color-secondary);
  color: var(--color-secondary-foreground);
}

/* Card */
.card {
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
  background-color: var(--color-card);
  color: var(--color-card-foreground);
  position: relative;
  overflow: hidden;
}

/* Button base */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  white-space: nowrap;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 500;
  transition: all 0.15s ease;
  cursor: pointer;
  text-decoration: none;
}

.btn:focus-visible {
  outline: 2px solid var(--color-ring);
  outline-offset: 2px;
}

.btn-primary {
  background-color: var(--color-primary);
  color: var(--color-primary-foreground);
}

.btn-primary:hover {
  background-color: oklch(0.145 0 0 / 0.9);
}

.btn-secondary {
  background-color: var(--color-secondary);
  color: var(--color-secondary-foreground);
}

.btn-secondary:hover {
  background-color: oklch(0.97 0 0 / 0.8);
}

.btn-outline {
  border: 1px solid var(--color-input);
  background-color: var(--color-background);
  color: var(--color-foreground);
}

.btn-outline:hover {
  background-color: var(--color-muted);
}

.btn-ghost {
  background: transparent;
  border: none;
}

.btn-ghost:hover {
  background-color: var(--color-muted);
}

.btn-sm {
  height: 2.25rem;
  padding: 0 0.75rem;
  font-size: 0.875rem;
}

.btn-lg {
  height: 2.75rem;
  padding: 0 2rem;
  font-size: 0.875rem;
}

/* Input */
.input {
  display: flex;
  height: 2.5rem;
  width: 100%;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-input);
  background-color: var(--color-background);
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  color: var(--color-foreground);
  transition: all 0.15s ease;
}

.input:focus {
  outline: 2px solid var(--color-ring);
  outline-offset: 2px;
}

.input::placeholder {
  color: var(--color-muted-foreground);
}

/* Textarea */
.textarea {
  display: flex;
  min-height: 5rem;
  width: 100%;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-input);
  background-color: var(--color-background);
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  color: var(--color-foreground);
  transition: all 0.15s ease;
  resize: vertical;
}

.textarea:focus {
  outline: 2px solid var(--color-ring);
  outline-offset: 2px;
}

.textarea::placeholder {
  color: var(--color-muted-foreground);
}

/* Label */
.label {
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1;
  color: var(--color-foreground);
}

/* Tabs */
.tabs-list {
  display: inline-flex;
  height: 2.5rem;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-lg);
  background-color: var(--color-muted);
  padding: 0.25rem;
}

.tabs-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  border-radius: var(--radius-md);
  padding: 0.375rem 0.75rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-muted-foreground);
  cursor: pointer;
  transition: all 0.15s ease;
  background: none;
  border: none;
}

.tabs-trigger:hover {
  color: var(--color-foreground);
}

.tabs-trigger.active {
  background-color: var(--color-background);
  color: var(--color-foreground);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.tabs-content {
  display: none;
}

.tabs-content.active {
  display: block;
}

/* Text balance/pretty polyfills */
.text-balance {
  text-wrap: balance;
}

.text-pretty {
  text-wrap: pretty;
}

/* Line clamp */
.line-clamp-2 {
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
}

/* Prose (for blog posts) */
.prose {
  max-width: 65ch;
  color: var(--color-foreground);
}

.prose p {
  margin-top: 1.25em;
  margin-bottom: 1.25em;
}

/* ============================================
   Elegante Theme Preview
   ============================================ */
.elegante-preview-stack {
  display: flex;
  flex-direction: column;
  gap: 0;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow:
    0 20px 60px rgba(0, 0, 0, 0.1),
    0 4px 16px rgba(0, 0, 0, 0.06);
  border: 1px solid var(--color-border);
}

.elegante-preview-item {
  width: 100%;
  line-height: 0;
  font-size: 0;
}

.elegante-preview-img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: contain;
}