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

/* ============================================
   LIQUID GLASS DESIGN SYSTEM (macOS 26 Tahoe)
   ============================================ */

:root {
  /* Glass Effect Variables */
  --glass-bg: rgba(255, 255, 255, 0.72);
  --glass-bg-light: rgba(255, 255, 255, 0.85);
  --glass-bg-heavy: rgba(255, 255, 255, 0.92);
  --glass-blur: 40px;
  --glass-blur-light: 20px;
  --glass-border: rgba(255, 255, 255, 0.18);
  --glass-border-strong: rgba(255, 255, 255, 0.35);
  --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
  --glass-shadow-elevated: 0 16px 48px rgba(0, 0, 0, 0.12);
  --glass-inner-glow: inset 0 1px 0 rgba(255, 255, 255, 0.5);

  /* Radius System */
  --radius-xs: 8px;
  --radius-sm: 12px;
  --radius-md: 16px;
  --radius-lg: 20px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  /* Timing Functions */
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-smooth: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-bounce: cubic-bezier(0.68, -0.55, 0.265, 1.55);

  /* Base Colors */
  --color-surface: #f5f5f7;
  --color-text: #1d1d1f;
  --color-text-secondary: rgba(0, 0, 0, 0.55);
  --color-accent: #007AFF;
  --color-danger: #FF3B30;
  --color-success: #34C759;

  background-color: var(--color-surface);
  color: var(--color-text);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --glass-bg: rgba(30, 30, 30, 0.72);
    --glass-bg-light: rgba(40, 40, 40, 0.85);
    --glass-bg-heavy: rgba(20, 20, 20, 0.92);
    --glass-border: rgba(255, 255, 255, 0.1);
    --glass-border-strong: rgba(255, 255, 255, 0.15);
    --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    --glass-shadow-elevated: 0 16px 48px rgba(0, 0, 0, 0.5);
    --glass-inner-glow: inset 0 1px 0 rgba(255, 255, 255, 0.1);

    --color-surface: #000000;
    --color-text: #f5f5f7;
    --color-text-secondary: rgba(255, 255, 255, 0.55);
  }
}

.dark {
  --glass-bg: rgba(20, 20, 20, 0.7);
  --glass-bg-light: rgba(30, 30, 30, 0.8);
  --glass-bg-heavy: rgba(10, 10, 10, 0.9);
  --glass-border: rgba(255, 255, 255, 0.08);
  --glass-border-strong: rgba(255, 255, 255, 0.12);
  --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  --glass-shadow-elevated: 0 16px 48px rgba(0, 0, 0, 0.6);
  --glass-inner-glow: inset 0 1px 0 rgba(255, 255, 255, 0.05);

  --color-surface: #000000;
  --color-text: #f5f5f7;
  --color-text-secondary: rgba(255, 255, 255, 0.55);
}

body {
  margin: 0;
  overflow-x: hidden;
  user-select: none;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

* {
  box-sizing: border-box;
}

button {
  cursor: default;
}

/* ============================================
   GLASS UTILITY CLASSES
   ============================================ */

.liquid-glass {
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow), var(--glass-inner-glow);
}

.liquid-glass-light {
  background: var(--glass-bg-light);
  backdrop-filter: blur(var(--glass-blur-light));
  -webkit-backdrop-filter: blur(var(--glass-blur-light));
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
}

.liquid-glass-heavy {
  background: var(--glass-bg-heavy);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--glass-border-strong);
  box-shadow: var(--glass-shadow-elevated), var(--glass-inner-glow);
}

.glass-hover {
  transition: transform 0.2s var(--ease-spring), box-shadow 0.2s var(--ease-smooth);
}

.glass-hover:hover {
  transform: translateY(-2px) scale(1.01);
  box-shadow: var(--glass-shadow-elevated), var(--glass-inner-glow);
}

.glass-press {
  transition: transform 0.1s var(--ease-smooth);
}

.glass-press:active {
  transform: scale(0.97);
}

/* ============================================
   ANIMATION KEYFRAMES
   ============================================ */

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.98);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(24px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes scaleIn {
  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 pulse-glow {

  0%,
  100% {
    box-shadow: var(--glass-shadow);
  }

  50% {
    box-shadow: var(--glass-shadow-elevated), 0 0 20px rgba(0, 122, 255, 0.15);
  }
}

/* Animation Utility Classes */
.animate-fade-in {
  animation: fadeIn 0.4s var(--ease-spring) forwards;
}

.animate-slide-up {
  animation: slideUp 0.5s var(--ease-spring) forwards;
}

.animate-scale-in {
  animation: scaleIn 0.3s var(--ease-spring) forwards;
}

/* Stagger children animations */
.stagger-children>* {
  animation: fadeIn 0.4s var(--ease-spring) forwards;
  opacity: 0;
}

.stagger-children>*:nth-child(1) {
  animation-delay: 0s;
}

.stagger-children>*:nth-child(2) {
  animation-delay: 0.05s;
}

.stagger-children>*:nth-child(3) {
  animation-delay: 0.1s;
}

.stagger-children>*:nth-child(4) {
  animation-delay: 0.15s;
}

.stagger-children>*:nth-child(5) {
  animation-delay: 0.2s;
}

.stagger-children>*:nth-child(6) {
  animation-delay: 0.25s;
}