/*
 * Lovita - Modern Dating Platform
 * Custom styles and animations
 */

/* ==========================================================================
   Task 6: Theme System — CSS Custom Properties
   All colors defined as custom properties under :root (dark theme default).
   Tenant branding overrides via getTenantCSS which sets --color-primary, etc.
   ========================================================================== */

:root {
  /* Primary colors - can be overridden by tenant theme */
  --color-primary-50: #fdf2f8;
  --color-primary-100: #fce7f3;
  --color-primary-200: #fbcfe8;
  --color-primary-300: #f9a8d4;
  --color-primary-400: #f472b6;
  --color-primary-500: #ec4899;
  --color-primary-600: #db2777;
  --color-primary-700: #be185d;
  --color-primary-800: #9d174d;
  --color-primary-900: #831843;

  /* Semantic surface colors (dark default) */
  --color-surface: rgb(24 24 27);
  --color-surface-raised: rgb(39 39 42);
  --color-surface-overlay: rgb(63 63 70);

  /* Overlay/backdrop */
  --color-overlay: rgba(0, 0, 0, 0.6);
  --color-overlay-light: rgba(0, 0, 0, 0.3);
  --color-overlay-heavy: rgba(0, 0, 0, 0.8);

  /* Brand (derived from primary, overridden by tenant) */
  --color-brand-muted: rgba(236, 72, 153, 0.2);
  --color-brand-subtle: rgba(236, 72, 153, 0.1);

  /* Semantic status */
  --color-success: #10b981;
  --color-success-muted: rgba(16, 185, 129, 0.2);
  --color-danger: #ef4444;
  --color-danger-muted: rgba(239, 68, 68, 0.2);

  /* Muted/foreground */
  --color-muted: rgb(161 161 170);
  --color-muted-foreground: rgb(113 113 122);

  /* Accent */
  --color-accent: #8b5cf6;
  --color-accent-muted: rgba(139, 92, 246, 0.2);

  /* Glow (used in shadows, adapts to tenant primary) */
  --color-glow: rgba(236, 72, 153, 0.4);

  /* Text */
  --color-text: rgb(244 244 245);
  --color-text-secondary: rgb(161 161 170);
  --color-text-tertiary: rgb(113 113 122);

  /* Borders */
  --color-border: rgb(63 63 70);
  --color-border-subtle: rgba(255, 255, 255, 0.1);

  /* Glass tints (dark theme) */
  --glass-tint: rgba(255, 255, 255, 0.05);
  --glass-tint-hover: rgba(255, 255, 255, 0.08);
  --glass-border: rgba(255, 255, 255, 0.1);
  --glass-border-strong: rgba(255, 255, 255, 0.2);

  /* Transition presets */
  --ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-smooth: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-snappy: cubic-bezier(0.2, 0, 0, 1);
  --duration-fast: 150ms;
  --duration-normal: 250ms;
  --duration-slow: 400ms;
  --duration-slower: 600ms;
}

/* Light theme overrides */
.theme-light {
  --color-surface: rgb(250 250 250);
  --color-surface-raised: rgb(255 255 255);
  --color-surface-overlay: rgb(244 244 245);

  --color-overlay: rgba(0, 0, 0, 0.4);
  --color-overlay-light: rgba(0, 0, 0, 0.15);
  --color-overlay-heavy: rgba(0, 0, 0, 0.6);

  --color-muted: rgb(113 113 122);
  --color-muted-foreground: rgb(161 161 170);

  --color-text: rgb(24 24 27);
  --color-text-secondary: rgb(63 63 70);
  --color-text-tertiary: rgb(113 113 122);

  --color-border: rgb(228 228 231);
  --color-border-subtle: rgba(0, 0, 0, 0.08);

  --glass-tint: rgba(255, 255, 255, 0.6);
  --glass-tint-hover: rgba(255, 255, 255, 0.75);
  --glass-border: rgba(255, 255, 255, 0.5);
  --glass-border-strong: rgba(255, 255, 255, 0.7);

  --color-glow: rgba(236, 72, 153, 0.25);
}

/* ==========================================================================
   Task 5: Fluid Typography
   ========================================================================== */

body {
  font-size: clamp(1rem, 0.93rem + 0.36vw, 1.25rem);
  line-height: 1.6;
}

h1 { font-size: clamp(2.488rem, 2.09rem + 1.99vw, 3.815rem); }
h2 { font-size: clamp(2.074rem, 1.79rem + 1.42vw, 3.052rem); }
h3 { font-size: clamp(1.728rem, 1.53rem + 0.99vw, 2.441rem); }
h4 { font-size: clamp(1.44rem, 1.3rem + 0.7vw, 1.953rem); }
h5 { font-size: clamp(1.2rem, 1.1rem + 0.5vw, 1.563rem); }
h6 { font-size: clamp(1rem, 0.93rem + 0.36vw, 1.25rem); }

/* ===== Custom Font ===== */
.font-display {
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
}

/* ==========================================================================
   Existing Animations (preserved)
   ========================================================================== */

@keyframes float {
  0%, 100% {
    transform: translateY(0) rotate(0deg);
  }
  33% {
    transform: translateY(-20px) rotate(1deg);
  }
  66% {
    transform: translateY(10px) rotate(-1deg);
  }
}

@keyframes float-slow {
  0%, 100% {
    transform: translateY(0) translateX(0);
  }
  50% {
    transform: translateY(-30px) translateX(10px);
  }
}

@keyframes pulse-glow {
  0%, 100% {
    box-shadow: 0 0 20px var(--color-glow);
  }
  50% {
    box-shadow: 0 0 40px var(--color-glow);
  }
}

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

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

.animate-float {
  animation: float 8s ease-in-out infinite;
}

.animate-float-slow {
  animation: float-slow 12s ease-in-out infinite;
}

.animate-pulse-glow {
  animation: pulse-glow 3s ease-in-out infinite;
}

.animate-gradient {
  background-size: 200% 200%;
  animation: gradient-shift 8s ease infinite;
}

.animate-shimmer {
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.1),
    transparent
  );
  background-size: 200% 100%;
  animation: shimmer 2s infinite;
}

/* Staggered animations for feature cards */
.animate-delay-100 { animation-delay: 0.1s; }
.animate-delay-200 { animation-delay: 0.2s; }
.animate-delay-300 { animation-delay: 0.3s; }
.animate-delay-400 { animation-delay: 0.4s; }
.animate-delay-500 { animation-delay: 0.5s; }
.animate-delay-600 { animation-delay: 0.6s; }

/* ==========================================================================
   Existing Glassmorphism (preserved unchanged)
   ========================================================================== */

.glass {
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.glass-strong {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(40px);
  -webkit-backdrop-filter: blur(40px);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

/* ==========================================================================
   Task 3: Glassmorphism System — New classes
   ========================================================================== */

.glass-card {
  background: var(--glass-tint);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  border-radius: 1rem;
  transition: background var(--duration-normal) var(--ease-smooth),
              border-color var(--duration-normal) var(--ease-smooth);
}

.glass-card:hover {
  background: var(--glass-tint-hover);
  border-color: var(--glass-border-strong);
}

.glass-nav {
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-bottom: 1px solid var(--glass-border);
  position: sticky;
  top: 0;
  z-index: 40;
}

.glass-modal {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(32px);
  -webkit-backdrop-filter: blur(32px);
  border: 1px solid var(--glass-border-strong);
  border-radius: 1.5rem;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4), 0 8px 20px rgba(0, 0, 0, 0.2);
}

.glass-input {
  background: var(--glass-tint);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--glass-border);
  border-radius: 0.75rem;
  transition: border-color var(--duration-normal) var(--ease-smooth),
              box-shadow var(--duration-normal) var(--ease-smooth);
}

.glass-input:focus {
  outline: none;
  border-color: var(--color-primary, #ec4899);
  box-shadow: 0 0 0 3px var(--color-brand-muted),
              0 0 20px var(--color-brand-subtle);
}

.glass-surface {
  background: rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

/* ==========================================================================
   Existing Button Styles (preserved)
   ========================================================================== */

.btn-glow {
  position: relative;
  overflow: hidden;
}

.btn-glow::before {
  content: '';
  position: absolute;
  inset: 0;
  background: inherit;
  filter: blur(20px);
  opacity: 0.5;
  z-index: -1;
  transform: translateY(8px);
}

.btn-glow:hover::before {
  filter: blur(30px);
  opacity: 0.7;
}

/* ==========================================================================
   Task 4: Button System
   ========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.25rem;
  border-radius: 0.75rem;
  border: 1px solid transparent;
  cursor: pointer;
  user-select: none;
  transition: all var(--duration-normal) var(--ease-smooth);
  position: relative;
  overflow: hidden;
}

.btn:active {
  transform: scale(0.97);
}

.btn:disabled {
  opacity: 0.5;
  pointer-events: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--color-primary-500, #ec4899), var(--color-primary-600, #db2777));
  color: #fff;
  box-shadow: 0 2px 8px var(--color-brand-muted);
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--color-primary-400, #f472b6), var(--color-primary-500, #ec4899));
  box-shadow: 0 4px 16px var(--color-glow);
  transform: translateY(-1px);
}

.btn-primary:active {
  transform: translateY(0) scale(0.97);
}

.btn-secondary {
  background: var(--color-surface-raised);
  color: var(--color-text, rgb(244 244 245));
  border-color: var(--color-border);
}

.btn-secondary:hover {
  background: var(--color-surface-overlay);
  border-color: var(--color-muted);
}

.btn-danger {
  background: linear-gradient(135deg, var(--color-danger, #ef4444), #dc2626);
  color: #fff;
  box-shadow: 0 2px 8px var(--color-danger-muted);
}

.btn-danger:hover {
  box-shadow: 0 4px 16px rgba(239, 68, 68, 0.4);
  transform: translateY(-1px);
}

.btn-danger:active {
  transform: translateY(0) scale(0.97);
}

.btn-primary-outline {
  background: transparent;
  color: var(--color-primary, #ec4899);
  border-color: var(--color-primary, #ec4899);
}

.btn-primary-outline:hover {
  background: var(--color-brand-subtle);
  box-shadow: 0 0 15px var(--color-brand-subtle);
}

/* ==========================================================================
   Task 4: Action Buttons (Discover page — like / pass / super)
   ========================================================================== */

.action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 9999px;
  border: 2px solid var(--color-border);
  background: var(--glass-tint);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  cursor: pointer;
  transition: all var(--duration-normal) var(--ease-bounce);
}

.action-btn:hover {
  transform: scale(1.1);
}

.action-btn:active {
  transform: scale(0.9);
}

.action-btn-like {
  border-color: var(--color-primary, #ec4899);
  color: var(--color-primary, #ec4899);
}

.action-btn-like:hover {
  background: var(--color-brand-muted);
  box-shadow: 0 0 20px var(--color-glow);
}

.action-btn-pass {
  border-color: var(--color-muted);
  color: var(--color-muted);
}

.action-btn-pass:hover {
  background: rgba(161, 161, 170, 0.15);
  border-color: var(--color-danger, #ef4444);
  color: var(--color-danger, #ef4444);
}

.action-btn-super {
  border-color: var(--color-accent, #8b5cf6);
  color: var(--color-accent, #8b5cf6);
}

.action-btn-super:hover {
  background: var(--color-accent-muted);
  box-shadow: 0 0 20px rgba(139, 92, 246, 0.4);
}

/* ==========================================================================
   Task 4: Form Elements
   ========================================================================== */

.input {
  display: block;
  width: 100%;
  padding: 0.625rem 1rem;
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--color-text);
  background: var(--glass-tint);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--color-border);
  border-radius: 0.75rem;
  transition: border-color var(--duration-normal) var(--ease-smooth),
              box-shadow var(--duration-normal) var(--ease-smooth);
}

.input::placeholder {
  color: var(--color-muted-foreground);
}

.input:focus {
  outline: none;
  border-color: var(--color-primary, #ec4899);
  box-shadow: 0 0 0 3px var(--color-brand-muted),
              0 0 20px var(--color-brand-subtle);
}

/* Toggle switch */
.toggle {
  position: relative;
  display: inline-flex;
  width: 2.75rem;
  height: 1.5rem;
  background: var(--color-surface-overlay);
  border-radius: 9999px;
  cursor: pointer;
  transition: background var(--duration-normal) var(--ease-smooth);
}

.toggle::after {
  content: '';
  position: absolute;
  top: 0.125rem;
  left: 0.125rem;
  width: 1.25rem;
  height: 1.25rem;
  border-radius: 9999px;
  background: #fff;
  transition: transform var(--duration-normal) var(--ease-bounce);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.toggle.active,
.toggle[aria-checked="true"] {
  background: var(--color-primary, #ec4899);
}

.toggle.active::after,
.toggle[aria-checked="true"]::after {
  transform: translateX(1.25rem);
}

/* ===== Custom Input Styles (preserved) ===== */
.input-glow:focus {
  box-shadow: 0 0 0 4px var(--color-brand-muted),
              0 0 30px var(--color-brand-subtle);
}

/* ==========================================================================
   Task 4: HTMX Swap Animations
   ========================================================================== */

.htmx-swap-fade {
  animation: fadeIn var(--duration-slow) var(--ease-smooth);
}

.htmx-swap-slide {
  animation: slideUp var(--duration-slow) var(--ease-smooth);
}

/* Ensure HTMX settling class fades nicely */
.htmx-settling {
  opacity: 1;
  transition: opacity var(--duration-normal) var(--ease-smooth);
}

.htmx-swapping {
  opacity: 0;
  transition: opacity var(--duration-fast) var(--ease-smooth);
}

/* ==========================================================================
   Task 4: Skeleton Variants
   ========================================================================== */

.skeleton-text {
  height: 0.875rem;
  border-radius: 0.25rem;
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.05) 25%,
    rgba(255, 255, 255, 0.1) 50%,
    rgba(255, 255, 255, 0.05) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

.skeleton-avatar {
  width: 3rem;
  height: 3rem;
  border-radius: 9999px;
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.05) 25%,
    rgba(255, 255, 255, 0.1) 50%,
    rgba(255, 255, 255, 0.05) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

.skeleton-card {
  border-radius: 1rem;
  min-height: 12rem;
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.05) 25%,
    rgba(255, 255, 255, 0.1) 50%,
    rgba(255, 255, 255, 0.05) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

/* ==========================================================================
   Task 4: Card Entrance Animations
   ========================================================================== */

@keyframes card-enter {
  0% {
    opacity: 0;
    transform: translateY(30px) scale(0.95);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.card-enter {
  animation: card-enter var(--duration-slow) var(--ease-bounce) both;
}

.card-enter-stagger-1 { animation-delay: 0.05s; }
.card-enter-stagger-2 { animation-delay: 0.1s; }
.card-enter-stagger-3 { animation-delay: 0.15s; }
.card-enter-stagger-4 { animation-delay: 0.2s; }
.card-enter-stagger-5 { animation-delay: 0.25s; }
.card-enter-stagger-6 { animation-delay: 0.3s; }

/* ==========================================================================
   Task 4: Swipe Animations (Discover card stack)
   ========================================================================== */

@keyframes swipe-left {
  0% {
    opacity: 1;
    transform: translateX(0) rotate(0deg);
  }
  100% {
    opacity: 0;
    transform: translateX(-120%) rotate(-15deg);
  }
}

@keyframes swipe-right {
  0% {
    opacity: 1;
    transform: translateX(0) rotate(0deg);
  }
  100% {
    opacity: 0;
    transform: translateX(120%) rotate(15deg);
  }
}

@keyframes swipe-up {
  0% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  100% {
    opacity: 0;
    transform: translateY(-120%) scale(0.8);
  }
}

.swipe-left {
  animation: swipe-left 0.5s var(--ease-smooth) forwards;
}

.swipe-right {
  animation: swipe-right 0.5s var(--ease-smooth) forwards;
}

.swipe-up {
  animation: swipe-up 0.5s var(--ease-smooth) forwards;
}

/* ==========================================================================
   Task 4: Match Celebration
   ========================================================================== */

@keyframes confetti-fall {
  0% {
    opacity: 1;
    transform: translateY(-100vh) rotate(0deg);
  }
  100% {
    opacity: 0;
    transform: translateY(100vh) rotate(720deg);
  }
}

@keyframes heart-burst {
  0% {
    opacity: 0;
    transform: scale(0);
  }
  50% {
    opacity: 1;
    transform: scale(1.3);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

.match-celebration {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.match-celebration-heart {
  animation: heart-burst 0.6s var(--ease-bounce) both;
}

.match-celebration-confetti {
  animation: confetti-fall 2.5s linear both;
}

/* Confetti piece variants */
.match-celebration-confetti:nth-child(odd) {
  animation-duration: 2s;
}

.match-celebration-confetti:nth-child(3n) {
  animation-duration: 3s;
  animation-delay: 0.2s;
}

/* ==========================================================================
   Task 4: Page Transitions
   ========================================================================== */

.page-enter {
  animation: fadeIn var(--duration-slow) var(--ease-smooth) both;
}

.page-leave {
  animation: pageLeave var(--duration-normal) var(--ease-smooth) both;
}

@keyframes pageLeave {
  0% {
    opacity: 1;
    transform: translateY(0);
  }
  100% {
    opacity: 0;
    transform: translateY(-10px);
  }
}

/* ==========================================================================
   Task 4: Accessibility — Reduced Motion
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .animate-float,
  .animate-float-slow,
  .animate-pulse-glow,
  .animate-gradient,
  .animate-shimmer,
  .card-enter,
  .swipe-left,
  .swipe-right,
  .swipe-up,
  .match-celebration-heart,
  .match-celebration-confetti,
  .page-enter,
  .page-leave,
  .htmx-swap-fade,
  .htmx-swap-slide {
    animation: none !important;
  }

  .card-enter {
    opacity: 1 !important;
    transform: none !important;
  }

  .btn:hover,
  .btn:active,
  .action-btn:hover,
  .action-btn:active {
    transform: none !important;
  }
}

/* ===== Custom Scrollbar ===== */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.1);
}

::-webkit-scrollbar-thumb {
  background: var(--color-brand-muted);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--color-glow);
}

/* ===== Card Hover Effects ===== */
.card-hover {
  transition: all 0.3s var(--ease-smooth);
}

.card-hover:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

/* ===== Feature Card Styles ===== */
.feature-card {
  background: linear-gradient(135deg, var(--glass-tint) 0%, rgba(255, 255, 255, 0.02) 100%);
  border: 1px solid var(--glass-border);
  transition: all 0.4s var(--ease-smooth);
}

.feature-card:hover {
  background: linear-gradient(135deg, var(--glass-tint-hover) 0%, rgba(255, 255, 255, 0.04) 100%);
  border-color: var(--color-brand-muted);
  transform: translateY(-8px);
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.4);
}

/* ===== Profile Card ===== */
.profile-card {
  transform-style: preserve-3d;
  perspective: 1000px;
}

.profile-card-inner {
  transition: transform 0.6s var(--ease-smooth);
}

.profile-card:hover .profile-card-inner {
  transform: rotateY(5deg) rotateX(5deg);
}

/* ===== Navigation Styles ===== */
.nav-link {
  @apply flex items-center gap-2 px-4 py-2 text-sm font-medium text-zinc-400 rounded-xl transition-all duration-200;
}

.nav-link:hover {
  @apply text-white bg-zinc-800;
}

.nav-link-active {
  @apply text-white bg-gradient-to-r from-primary-500/20 to-purple-500/20 border border-primary-500/30;
}

/* ===== Primary Color Utilities ===== */
.text-primary {
  color: var(--color-primary, #ec4899);
}

.bg-primary {
  background-color: var(--color-primary, #ec4899);
}

.border-primary {
  border-color: var(--color-primary, #ec4899);
}

/* Gradient text */
.text-gradient {
  background: linear-gradient(135deg, var(--color-primary, #ec4899) 0%, var(--color-accent, #8b5cf6) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* ===== Toast Styles ===== */
.toast {
  @apply px-6 py-4 rounded-2xl shadow-2xl border backdrop-blur-xl;
  animation: toast-slide-in 0.3s ease-out;
}

@keyframes toast-slide-in {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

.toast-success {
  @apply bg-emerald-500/20 border-emerald-500/30 text-emerald-400;
}

.toast-error {
  @apply bg-red-500/20 border-red-500/30 text-red-400;
}

.toast-info {
  @apply bg-blue-500/20 border-blue-500/30 text-blue-400;
}

/* ===== Modal Styles ===== */
.modal-backdrop {
  background: var(--color-overlay-heavy);
  backdrop-filter: blur(8px);
}

.modal-content {
  animation: modal-pop-in 0.3s var(--ease-bounce);
}

@keyframes modal-pop-in {
  from {
    transform: scale(0.95) translateY(10px);
    opacity: 0;
  }
  to {
    transform: scale(1) translateY(0);
    opacity: 1;
  }
}

/* ===== Skeleton Loading (original preserved) ===== */
.skeleton {
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.05) 25%,
    rgba(255, 255, 255, 0.1) 50%,
    rgba(255, 255, 255, 0.05) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

/* ===== Match Animation (original preserved) ===== */
.match-animation {
  animation: match-pulse 0.5s var(--ease-smooth);
}

@keyframes match-pulse {
  0% {
    transform: scale(0.8);
    opacity: 0;
  }
  50% {
    transform: scale(1.1);
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

/* ===== Typing Indicator ===== */
.typing-indicator span {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  margin: 0 2px;
  animation: typing-bounce 1.4s infinite ease-in-out both;
}

.typing-indicator span:nth-child(1) { animation-delay: -0.32s; }
.typing-indicator span:nth-child(2) { animation-delay: -0.16s; }
.typing-indicator span:nth-child(3) { animation-delay: 0s; }

@keyframes typing-bounce {
  0%, 80%, 100% {
    transform: scale(0);
  }
  40% {
    transform: scale(1);
  }
}

/* ===== Like Button Animation ===== */
.like-button {
  transition: transform 0.2s var(--ease-smooth);
}

.like-button:active {
  transform: scale(0.85);
}

.like-button.liked {
  animation: like-pop 0.3s var(--ease-smooth);
}

@keyframes like-pop {
  0% { transform: scale(1); }
  50% { transform: scale(1.3); }
  100% { transform: scale(1); }
}

/* ==========================================================================
   Task 5: Responsive Utilities
   ========================================================================== */

/* Touch target minimum 44px (WCAG 2.5.5) */
.touch-target {
  min-width: 44px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Safe area padding for notched phones */
.safe-area-top {
  padding-top: env(safe-area-inset-top, 0px);
}

.safe-area-bottom {
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

.safe-area-left {
  padding-left: env(safe-area-inset-left, 0px);
}

.safe-area-right {
  padding-right: env(safe-area-inset-right, 0px);
}

.safe-area-x {
  padding-left: env(safe-area-inset-left, 0px);
  padding-right: env(safe-area-inset-right, 0px);
}

.safe-area-y {
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

.safe-area-all {
  padding-top: env(safe-area-inset-top, 0px);
  padding-right: env(safe-area-inset-right, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  padding-left: env(safe-area-inset-left, 0px);
}

@media (max-width: 640px) {
  .mobile-full {
    width: 100%;
    max-width: 100%;
  }
}

/* ===== Hide scrollbar but keep functionality ===== */
.hide-scrollbar {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.hide-scrollbar::-webkit-scrollbar {
  display: none;
}

/* ===== Premium Badge ===== */
.premium-badge {
  background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 50%, #d97706 100%);
  color: #000;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 9999px;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ===== Online Indicator ===== */
.online-indicator {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--color-success, #10b981);
  border: 2px solid var(--color-surface, #18181b);
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.4);
}

.online-indicator.pulse {
  animation: online-pulse 2s infinite;
}

@keyframes online-pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4);
  }
  70% {
    box-shadow: 0 0 0 10px rgba(16, 185, 129, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
  }
}

/* ===== Alpine.js Cloak ===== */
[x-cloak] {
  display: none !important;
}

/* ===== HTMX Loading States ===== */
.htmx-request .htmx-indicator {
  display: inline-flex;
}

.htmx-request.htmx-indicator {
  display: inline-flex;
}

/* ===== Print Styles ===== */
@media print {
  .no-print {
    display: none !important;
  }
}
