/**
 * VEZA V5 ULTRA - DESIGN SYSTEM
 * Design system moderne avec glassmorphism, neumorphism, animations avancées
 */

@layer base {
  :root {
    /* === V5 COLOR SYSTEM === */
    /* Glassmorphism surfaces */
    --glass-light: rgba(255, 255, 255, 0.85);
    --glass-dark: rgba(18, 18, 18, 0.85);
    --glass-border: rgba(255, 255, 255, 0.1);
    --glass-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37);
    
    /* Brand gradients */
    --gradient-brand: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-success: linear-gradient(135deg, #84fab0 0%, #8fd3f4 100%);
    --gradient-danger: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --gradient-warning: linear-gradient(135deg, #ffecd2 0%, #fcb69f 100%);
    --gradient-aurora: linear-gradient(45deg, #FF0080, #FF8C00, #FFD700, #00CED1, #8A2BE2);
    --gradient-mesh: radial-gradient(at 40% 20%, hsla(28,100%,74%,1) 0px, transparent 50%),
                     radial-gradient(at 80% 0%, hsla(189,100%,56%,1) 0px, transparent 50%),
                     radial-gradient(at 0% 50%, hsla(355,100%,93%,1) 0px, transparent 50%),
                     radial-gradient(at 80% 50%, hsla(340,100%,76%,1) 0px, transparent 50%),
                     radial-gradient(at 0% 100%, hsla(22,100%,77%,1) 0px, transparent 50%);
    
    /* Neumorphic shadows */
    --neu-light-1: 20px 20px 60px #d1d1d1, -20px -20px 60px #ffffff;
    --neu-light-2: inset 20px 20px 60px #d1d1d1, inset -20px -20px 60px #ffffff;
    --neu-dark-1: 20px 20px 60px #0a0a0a, -20px -20px 60px #1a1a1a;
    --neu-dark-2: inset 20px 20px 60px #0a0a0a, inset -20px -20px 60px #1a1a1a;
    
    /* V5 Enhanced colors */
    --v5-primary: #667eea;
    --v5-primary-light: #8b9aff;
    --v5-primary-dark: #4a5fc1;
    --v5-secondary: #764ba2;
    --v5-accent: #f093fb;
    --v5-success: #84fab0;
    --v5-warning: #ffecd2;
    --v5-danger: #f5576c;
    --v5-info: #8fd3f4;
    
    /* Backdrop filters */
    --blur-sm: blur(8px);
    --blur-md: blur(16px);
    --blur-lg: blur(24px);
    --blur-xl: blur(40px);
    
    /* Animation timings */
    --timing-fast: 150ms;
    --timing-normal: 300ms;
    --timing-slow: 500ms;
    --timing-very-slow: 800ms;
    
    /* Easing functions */
    --ease-smooth: cubic-bezier(0.4, 0, 0.2, 1);
    --ease-bounce: cubic-bezier(0.68, -0.55, 0.265, 1.55);
    --ease-elastic: cubic-bezier(0.68, -0.6, 0.32, 1.6);
    
    /* Spacing scale */
    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-6: 1.5rem;
    --space-8: 2rem;
    --space-12: 3rem;
    --space-16: 4rem;
    --space-24: 6rem;
  }

  @media (prefers-color-scheme: dark) {
    :root {
      --color-background: #0a0a0a;
      --color-foreground: #fafafa;
    }
  }
}

/* === V5 ANIMATIONS === */
@keyframes appear {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes disappear {
  from {
    opacity: 1;
    transform: translateY(0);
  }
  to {
    opacity: 0;
    transform: translateY(-10px);
  }
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

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

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

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

@keyframes glow {
  0%, 100% {
    box-shadow: 0 0 20px rgba(102, 126, 234, 0.5);
  }
  50% {
    box-shadow: 0 0 40px rgba(102, 126, 234, 0.8);
  }
}

@keyframes rotate-360 {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

@keyframes wave {
  0%, 100% {
    transform: scaleY(0.5);
  }
  50% {
    transform: scaleY(1);
  }
}

/* Skeleton loading animation */
@keyframes skeleton-loading {
  0% {
    background-position: -200% 0;
  }
  100% {
    background-position: 200% 0;
  }
}

/* === V5 UTILITY CLASSES === */
@layer utilities {
  /* Glassmorphism */
  .glass {
    background: var(--glass-light);
    backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid var(--glass-border);
  }

  .dark .glass {
    background: var(--glass-dark);
  }

  .glass-strong {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(30px) saturate(200%);
    border: 1px solid rgba(255, 255, 255, 0.2);
  }

  .dark .glass-strong {
    background: rgba(18, 18, 18, 0.95);
  }

  /* Neumorphism */
  .neu-raised {
    box-shadow: var(--neu-light-1);
  }

  .dark .neu-raised {
    box-shadow: var(--neu-dark-1);
  }

  .neu-pressed {
    box-shadow: var(--neu-light-2);
  }

  .dark .neu-pressed {
    box-shadow: var(--neu-dark-2);
  }

  /* Gradient backgrounds */
  .gradient-brand {
    background: var(--gradient-brand);
  }

  .gradient-success {
    background: var(--gradient-success);
  }

  .gradient-danger {
    background: var(--gradient-danger);
  }

  .gradient-aurora {
    background: var(--gradient-aurora);
    background-size: 200% 200%;
  }

  .gradient-mesh {
    background: var(--gradient-mesh);
  }

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

  /* Hover effects */
  .hover-lift {
    transition: transform var(--timing-normal) var(--ease-smooth),
                box-shadow var(--timing-normal) var(--ease-smooth);
  }

  .hover-lift:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15);
  }

  .hover-glow:hover {
    animation: glow 1.5s ease-in-out infinite;
  }

  .hover-scale {
    transition: transform var(--timing-fast) var(--ease-smooth);
  }

  .hover-scale:hover {
    transform: scale(1.05);
  }

  /* Click effects */
  .click-shrink:active {
    transform: scale(0.98);
  }

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

  /* Loading skeleton */
  .skeleton {
    background: linear-gradient(
      90deg,
      rgba(255, 255, 255, 0.05) 0%,
      rgba(255, 255, 255, 0.1) 50%,
      rgba(255, 255, 255, 0.05) 100%
    );
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
  }

  /* Animations */
  .animate-appear {
    animation: appear var(--timing-normal) var(--ease-smooth);
  }

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

  .animate-pulse-slow {
    animation: pulse 2s ease-in-out infinite;
  }

  /* Backdrop blur */
  .backdrop-blur-sm {
    backdrop-filter: var(--blur-sm);
  }

  .backdrop-blur-md {
    backdrop-filter: var(--blur-md);
  }

  .backdrop-blur-lg {
    backdrop-filter: var(--blur-lg);
  }

  .backdrop-blur-xl {
    backdrop-filter: var(--blur-xl);
  }

  /* Scrollbar styling */
  .scrollbar-thin::-webkit-scrollbar {
    width: 8px;
    height: 8px;
  }

  .scrollbar-thin::-webkit-scrollbar-track {
    background: transparent;
  }

  .scrollbar-thin::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
  }

  .scrollbar-thin::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
  }

  /* Focus ring V5 */
  .focus-ring-v5:focus-visible {
    outline: 2px solid var(--v5-primary);
    outline-offset: 2px;
    border-radius: 0.375rem;
  }

  /* Text gradients */
  .text-gradient {
    background: var(--gradient-brand);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
  }

  .text-gradient-aurora {
    background: var(--gradient-aurora);
    background-size: 200% 200%;
    animation: gradient-shift 3s ease infinite;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
  }

  /* Card enhancements */
  .card-interactive {
    @apply glass hover-lift click-shrink cursor-pointer;
    transition: all var(--timing-normal) var(--ease-smooth);
  }

  .card-interactive:hover {
    border-color: var(--v5-primary);
  }

  /* Button enhancements */
  .btn-v5 {
    @apply relative overflow-hidden;
    transition: all var(--timing-normal) var(--ease-smooth);
  }

  .btn-v5::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
      90deg,
      transparent,
      rgba(255, 255, 255, 0.2),
      transparent
    );
    transition: left var(--timing-slow) var(--ease-smooth);
  }

  .btn-v5:hover::before {
    left: 100%;
  }

  /* Floating elements */
  .floating {
    animation: float 3s ease-in-out infinite;
  }

  /* Rotate continuously */
  .rotate-continuous {
    animation: rotate-360 20s linear infinite;
  }

  /* Smooth transitions */
  .transition-smooth {
    transition: all var(--timing-normal) var(--ease-smooth);
  }

  .transition-bounce {
    transition: all var(--timing-normal) var(--ease-bounce);
  }

  /* Audio waveform bars */
  .waveform-bar {
    animation: wave 1s ease-in-out infinite;
  }

  .waveform-bar:nth-child(2) {
    animation-delay: 0.1s;
  }

  .waveform-bar:nth-child(3) {
    animation-delay: 0.2s;
  }

  .waveform-bar:nth-child(4) {
    animation-delay: 0.3s;
  }

  .waveform-bar:nth-child(5) {
    animation-delay: 0.4s;
  }
}

/* === V5 COMPONENT ENHANCEMENTS === */
@layer components {
  /* Enhanced cards */
  .card-v5 {
    @apply glass rounded-2xl p-6 transition-smooth;
    position: relative;
    overflow: hidden;
  }

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

  .card-v5:hover::before {
    left: 100%;
  }

  /* Enhanced buttons */
  .btn-primary-v5 {
    @apply btn-v5 px-6 py-3 rounded-xl font-semibold text-white;
    background: var(--gradient-brand);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
  }

  .btn-primary-v5:hover {
    box-shadow: 0 8px 24px rgba(102, 126, 234, 0.4);
    transform: translateY(-2px);
  }

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

  /* Enhanced inputs */
  .input-v5 {
    @apply glass rounded-xl px-4 py-3 outline-none transition-smooth;
    border: 2px solid transparent;
  }

  .input-v5:focus {
    border-color: var(--v5-primary);
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
  }

  /* Modal enhancements */
  .modal-v5 {
    @apply glass-strong rounded-3xl p-8 shadow-2xl;
    animation: scaleIn var(--timing-normal) var(--ease-bounce);
  }

  /* Tooltip enhancements */
  .tooltip-v5 {
    @apply glass px-3 py-2 rounded-lg text-sm;
    animation: appear var(--timing-fast) var(--ease-smooth);
  }
}

