/**
 * 🚀 FUTURISTIC DESIGN SYSTEM
 * Design cyber/sci-fi sans border-radius
 * Utilise clip-path, effets néon, animations fluides
 */

:root {
  /* ========================================
     🎨 COULEURS FUTURISTES
     ======================================== */
  --cyber-primary: #00f0ff;
  --cyber-secondary: #ff00ff;
  --cyber-accent: #ffff00;
  --cyber-success: #00ff88;
  --cyber-warning: #ffaa00;
  --cyber-error: #ff0055;
  
  --neon-glow-sm: 0 0 5px currentColor, 0 0 10px currentColor;
  --neon-glow-md: 0 0 10px currentColor, 0 0 20px currentColor, 0 0 30px currentColor;
  --neon-glow-lg: 0 0 15px currentColor, 0 0 30px currentColor, 0 0 45px currentColor, 0 0 60px currentColor;
  
  /* Gradients cyber */
  --gradient-cyber-blue: linear-gradient(135deg, #0a0e27 0%, #1a1f3a 50%, #0a0e27 100%);
  --gradient-cyber-purple: linear-gradient(135deg, #1a0a2e 0%, #2d1b3d 50%, #1a0a2e 100%);
  --gradient-neon: linear-gradient(135deg, var(--cyber-primary) 0%, var(--cyber-secondary) 100%);
  
  /* ========================================
     📐 CLIP-PATHS FUTURISTES
     ======================================== */
  /* Découpes angulaires */
  --clip-corner-sm: polygon(
    4px 0, 100% 0, 100% calc(100% - 4px), calc(100% - 4px) 100%, 0 100%, 0 4px
  );
  
  --clip-corner-md: polygon(
    8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%, 0 8px
  );
  
  --clip-corner-lg: polygon(
    12px 0, 100% 0, 100% calc(100% - 12px), calc(100% - 12px) 100%, 0 100%, 0 12px
  );
  
  /* Coins coupés asymétriques */
  --clip-asymmetric-sm: polygon(
    0 0, calc(100% - 8px) 0, 100% 8px, 100% 100%, 8px 100%, 0 calc(100% - 8px)
  );
  
  --clip-asymmetric-md: polygon(
    0 0, calc(100% - 12px) 0, 100% 12px, 100% 100%, 12px 100%, 0 calc(100% - 12px)
  );
  
  /* Hexagone */
  --clip-hexagon: polygon(
    25% 0%, 75% 0%, 100% 50%, 75% 100%, 25% 100%, 0% 50%
  );
  
  /* Octogone */
  --clip-octagon: polygon(
    30% 0%, 70% 0%, 100% 30%, 100% 70%, 70% 100%, 30% 100%, 0% 70%, 0% 30%
  );
  
  /* Découpe tech */
  --clip-tech: polygon(
    0 0, calc(100% - 20px) 0, 100% 20px, 100% calc(100% - 20px), 
    calc(100% - 20px) 100%, 20px 100%, 0 calc(100% - 20px), 0 0
  );
  
  /* Découpe beveled (biseautée) */
  --clip-beveled: polygon(
    10px 0, calc(100% - 10px) 0, 100% 10px, 100% calc(100% - 10px),
    calc(100% - 10px) 100%, 10px 100%, 0 calc(100% - 10px), 0 10px
  );
  
  /* ========================================
     ⚡ ANIMATIONS
     ======================================== */
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 350ms cubic-bezier(0.4, 0, 0.2, 1);
  
  /* ========================================
     🎭 BACKDROP & GLASS EFFECTS
     ======================================== */
  --backdrop-blur: blur(16px) saturate(180%);
  --glass-border: 1px solid rgba(255, 255, 255, 0.1);
  --glass-bg: rgba(15, 23, 42, 0.7);
  --glass-bg-light: rgba(255, 255, 255, 0.05);
}

/* ========================================
   🎨 CLASSES UTILITAIRES
   ======================================== */

/* Conteneurs avec clip-path */
.cyber-panel {
  clip-path: var(--clip-corner-md);
  background: var(--glass-bg);
  backdrop-filter: var(--backdrop-blur);
  border: var(--glass-border);
  position: relative;
  overflow: hidden;
}

.cyber-panel::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--cyber-primary), transparent);
  opacity: 0.5;
}

.cyber-panel-lg {
  clip-path: var(--clip-corner-lg);
}

.cyber-panel-asymmetric {
  clip-path: var(--clip-asymmetric-md);
}

.cyber-card {
  clip-path: var(--clip-beveled);
  background: var(--gradient-cyber-blue);
  border: 1px solid rgba(var(--cyber-primary-rgb, 0, 240, 255), 0.3);
  position: relative;
  transition: all var(--transition-base);
}

.cyber-card:hover {
  border-color: var(--cyber-primary);
  box-shadow: var(--neon-glow-sm);
  transform: translateY(-2px);
}

/* Boutons futuristes */
.cyber-btn {
  clip-path: var(--clip-corner-sm);
  background: var(--gradient-cyber-blue);
  border: 1px solid var(--cyber-primary);
  color: var(--cyber-primary);
  padding: 0.75rem 1.5rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: all var(--transition-base);
}

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

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

.cyber-btn:hover {
  box-shadow: var(--neon-glow-md);
  transform: translateY(-1px);
}

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

.cyber-btn-primary {
  background: var(--cyber-primary);
  color: #000;
  border-color: var(--cyber-primary);
}

.cyber-btn-secondary {
  background: transparent;
  color: var(--cyber-secondary);
  border-color: var(--cyber-secondary);
}

/* Inputs futuristes */
.cyber-input {
  clip-path: var(--clip-corner-sm);
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(0, 240, 255, 0.3);
  color: #fff;
  padding: 0.75rem 1rem;
  font-family: inherit;
  transition: all var(--transition-base);
}

.cyber-input:focus {
  outline: none;
  border-color: var(--cyber-primary);
  box-shadow: var(--neon-glow-sm);
}

.cyber-input::placeholder {
  color: rgba(255, 255, 255, 0.4);
}

/* Badges/Chips */
.cyber-chip {
  clip-path: var(--clip-asymmetric-sm);
  background: rgba(0, 240, 255, 0.1);
  border: 1px solid rgba(0, 240, 255, 0.3);
  color: var(--cyber-primary);
  padding: 0.25rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

/* Séparateurs néon */
.cyber-divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--cyber-primary), transparent);
  margin: 2rem 0;
  opacity: 0.5;
}

.cyber-divider-vertical {
  width: 1px;
  height: 100%;
  background: linear-gradient(180deg, transparent, var(--cyber-primary), transparent);
  opacity: 0.5;
}

/* Effets de texte */
.cyber-text-glow {
  color: var(--cyber-primary);
  text-shadow: var(--neon-glow-sm);
}

.cyber-text-gradient {
  background: var(--gradient-neon);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Grille futuriste */
.cyber-grid {
  background-image: 
    linear-gradient(rgba(0, 240, 255, 0.1) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 240, 255, 0.1) 1px, transparent 1px);
  background-size: 20px 20px;
}

/* Animations */
@keyframes cyber-pulse {
  0%, 100% {
    opacity: 1;
    box-shadow: var(--neon-glow-sm);
  }
  50% {
    opacity: 0.8;
    box-shadow: var(--neon-glow-md);
  }
}

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

@keyframes cyber-scan {
  0% {
    transform: translateY(-100%);
  }
  100% {
    transform: translateY(100%);
  }
}

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

.cyber-animate-slide-in {
  animation: cyber-slide-in var(--transition-slow) ease-out;
}

/* Effet de scan (ligne qui descend) */
.cyber-scan-effect {
  position: relative;
  overflow: hidden;
}

.cyber-scan-effect::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--cyber-primary), transparent);
  animation: cyber-scan 3s linear infinite;
  opacity: 0.5;
}

/* Mode sombre amélioré */
@media (prefers-color-scheme: dark) {
  :root {
    --glass-bg: rgba(10, 14, 39, 0.8);
  }
}

/* Responsive */
@media (max-width: 768px) {
  .cyber-panel {
    clip-path: var(--clip-corner-sm);
  }
  
  .cyber-card {
    clip-path: var(--clip-asymmetric-sm);
  }
}

/* ========================================
   🎯 UTILITAIRES POUR REMPLACER BORDER-RADIUS
   ======================================== */

/* Pour remplacer border-radius: 4px */
.clip-sm {
  clip-path: var(--clip-corner-sm);
}

/* Pour remplacer border-radius: 8px */
.clip-md {
  clip-path: var(--clip-corner-md);
}

/* Pour remplacer border-radius: 12px+ */
.clip-lg {
  clip-path: var(--clip-corner-lg);
}

/* Pour remplacer border-radius: 50% (cercles) */
.clip-octagon {
  clip-path: var(--clip-octagon);
  aspect-ratio: 1;
}

/* Pour remplacer border-radius: 999px (pills) */
.clip-hexagon {
  
}

/* Découpes asymétriques */
.clip-asymmetric {
  clip-path: var(--clip-asymmetric-md);
}

.clip-tech {
  clip-path: var(--clip-tech);
}

.clip-beveled {
  clip-path: var(--clip-beveled);
}
