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

/* FontAwesome CDN as a fallback for development */
@import url('https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css');

@layer base {
  :root {
    /* Design System Futuriste - Noir & Blanc AI */
    --background: 0 0% 98%;
    --foreground: 0 0% 8%;

    --card: 0 0% 100%;
    --card-foreground: 0 0% 8%;

    --popover: 0 0% 100%;
    --popover-foreground: 0 0% 8%;

    /* Palette AI - Noir et Blanc Pur */
    --primary: 0 0% 0%;
    --primary-foreground: 0 0% 100%;
    --primary-glow: 0 0% 15%;

    --secondary: 0 0% 95%;
    --secondary-foreground: 0 0% 8%;

    --muted: 0 0% 92%;
    --muted-foreground: 0 0% 45%;

    --accent: 0 0% 90%;
    --accent-foreground: 0 0% 8%;

    --destructive: 0 84% 60%;
    --destructive-foreground: 0 0% 98%;

    --border: 0 0% 88%;
    --input: 0 0% 95%;
    --ring: 0 0% 8%;
    
    --success: 142 71% 45%;
    --success-foreground: 0 0% 98%;
    
    --warning: 38 92% 50%;
    --warning-foreground: 0 0% 98%;
    
    /* Gradients Futuristes AI - Noir et Blanc */
    --gradient-primary: linear-gradient(135deg, hsl(0 0% 0%) 0%, hsl(0 0% 15%) 50%, hsl(0 0% 0%) 100%);
    --gradient-secondary: linear-gradient(135deg, hsl(0 0% 100%) 0%, hsl(0 0% 95%) 100%);
    --gradient-hero: linear-gradient(135deg, hsl(0 0% 0%) 0%, hsl(0 0% 10%) 50%, hsl(0 0% 20%) 100%);
    --gradient-card: linear-gradient(135deg, hsl(0 0% 100% / 0.95) 0%, hsl(0 0% 98% / 0.98) 100%);
    --gradient-accent: linear-gradient(135deg, hsl(0 0% 95%) 0%, hsl(0 0% 90%) 100%);
    --gradient-neural: linear-gradient(45deg, hsl(0 0% 0%) 0%, hsl(0 0% 10%) 25%, hsl(0 0% 0%) 50%, hsl(0 0% 15%) 75%, hsl(0 0% 0%) 100%);
    
    /* Ombres Technologiques */
    --shadow-sm: 0 1px 3px 0 hsl(0 0% 0% / 0.12);
    --shadow-md: 0 4px 12px -2px hsl(0 0% 0% / 0.15), 0 2px 6px -2px hsl(0 0% 0% / 0.1);
    --shadow-lg: 0 20px 25px -5px hsl(0 0% 0% / 0.25), 0 10px 10px -5px hsl(0 0% 0% / 0.1);
    --shadow-glow: 0 0 30px hsl(0 0% 0% / 0.15);
    --shadow-elevation: 0 8px 32px hsl(0 0% 0% / 0.12), 0 2px 16px hsl(0 0% 0% / 0.08);
    --shadow-neural: 0 0 50px hsl(0 0% 0% / 0.1), inset 0 1px 0 hsl(0 0% 100% / 0.1);
    
    /* Animations AI */
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-bounce: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    --transition-spring: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    --transition-fast: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-neural: all 0.6s cubic-bezier(0.23, 1, 0.32, 1);

    --radius: 0.75rem;

    /* Sidebar Futuriste - Blanc */
    --sidebar-background: 0 0% 100%;
    --sidebar-foreground: 0 0% 0%;
    --sidebar-primary: 0 0% 0%;
    --sidebar-primary-foreground: 0 0% 100%;
    --sidebar-accent: 0 0% 95%;
    --sidebar-accent-foreground: 0 0% 0%;
    --sidebar-border: 0 0% 90%;
    --sidebar-ring: 0 0% 0%;
  }

  .dark {
    /* Mode Sombre Futuriste AI - Inversé */
    --background: 0 0% 0%;
    --foreground: 0 0% 95%;

    --card: 0 0% 2%;
    --card-foreground: 0 0% 100%;

    --popover: 0 0% 2%;
    --popover-foreground: 0 0% 100%;

    --primary: 0 0% 100%;
    --primary-foreground: 0 0% 0%;

    --secondary: 0 0% 5%;
    --secondary-foreground: 0 0% 100%;

    --muted: 0 0% 8%;
    --muted-foreground: 0 0% 70%;

    --accent: 0 0% 8%;
    --accent-foreground: 0 0% 100%;

    --destructive: 0 62% 50%;
    --destructive-foreground: 0 0% 100%;

    --border: 0 0% 20%;
    --input: 0 0% 5%;
    --ring: 0 0% 100%;

    /* Gradients Mode Sombre - Noir et Blanc */
    --gradient-primary: linear-gradient(135deg, hsl(0 0% 100%) 0%, hsl(0 0% 90%) 50%, hsl(0 0% 100%) 100%);
    --gradient-secondary: linear-gradient(135deg, hsl(0 0% 2%) 0%, hsl(0 0% 5%) 100%);
    --gradient-hero: linear-gradient(135deg, hsl(0 0% 0%) 0%, hsl(0 0% 5%) 50%, hsl(0 0% 10%) 100%);
    --gradient-card: linear-gradient(135deg, hsl(0 0% 2% / 0.95) 0%, hsl(0 0% 5% / 0.98) 100%);
    --gradient-accent: linear-gradient(135deg, hsl(0 0% 8%) 0%, hsl(0 0% 12%) 100%);
    --gradient-neural: linear-gradient(45deg, hsl(0 0% 100%) 0%, hsl(0 0% 85%) 25%, hsl(0 0% 100%) 50%, hsl(0 0% 80%) 75%, hsl(0 0% 100%) 100%);

    /* Sidebar Mode Sombre - Blanc */
    --sidebar-background: 0 0% 100%;
    --sidebar-foreground: 0 0% 0%;
    --sidebar-primary: 0 0% 0%;
    --sidebar-primary-foreground: 0 0% 100%;
    --sidebar-accent: 0 0% 95%;
    --sidebar-accent-foreground: 0 0% 0%;
    --sidebar-border: 0 0% 90%;
    --sidebar-ring: 0 0% 0%;
  }

  * {
    border-color: hsl(var(--border));
  }

  body {
    background-color: hsl(var(--background));
    color: hsl(var(--foreground));
    font-feature-settings: "cv11", "ss01";
    font-variation-settings: "opsz" 32;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
  }
}

@layer components {
  /* Effets Futuristes AI - Matching Lovable's exact approach */
  .glass-effect {
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    background-color: hsl(var(--background) / 0.7);
    border: 1px solid hsl(var(--border) / 0.3);
    box-shadow: var(--shadow-neural);
  }
  
  .card-modern {
    background-image: var(--gradient-card);
    border: 1px solid hsl(var(--border) / 0.4);
    box-shadow: var(--shadow-elevation);
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  }
  
  .card-modern:hover {
    transform: translateY(-0.5rem) scale(1.02);
    box-shadow: var(--shadow-neural);
  }
  
  .gradient-text {
    background-image: var(--gradient-primary);
    background-clip: text;
    -webkit-background-clip: text;
    color: transparent;
    font-weight: 500;
  }
  
  .button-modern {
    background-image: var(--gradient-primary);
    color: hsl(var(--primary-foreground));
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    border: 1px solid hsl(var(--border) / 0.2);
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  }

  .button-modern:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-glow);
  }

  /* Neural Glow Effect */
  .neural-glow {
    box-shadow: var(--shadow-neural);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
  }

  /* AI Border Effect */
  .ai-border {
    position: relative;
    border: 1px solid hsl(var(--border) / 0.3);
  }

  .ai-border::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    border: 1px solid hsl(var(--primary) / 0.2);
    opacity: 0;
    transition: opacity 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  }

  .ai-border:hover::before {
    opacity: 1;
  }

  /* AI Scan Animation */
  .ai-scan {
    position: relative;
    overflow: hidden;
  }

  .ai-scan::before {
    content: '';
    position: absolute;
    inset: 0;
    transform: translateX(-100%);
    background: linear-gradient(to right, transparent, hsl(var(--primary) / 0.1), transparent);
    transition: transform 1s cubic-bezier(0.4, 0, 0.2, 1);
  }

  .ai-scan:hover::before {
    transform: translateX(100%);
  }

  /* Typography futuriste */
  .font-ai {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-variation-settings: 'wght' 400, 'opsz' 14;
    letter-spacing: -0.025em;
  }

  .font-ai-bold {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-variation-settings: 'wght' 700, 'opsz' 14;
    letter-spacing: -0.03em;
  }
}

@layer utilities {
  /* Transition utilities to match their exact approach */
  .transition-colors {
    transition-property: color, background-color, border-color, text-decoration-color, fill, stroke;
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
    transition-duration: 0.15s;
  }

  .transition-all {
    transition-property: all;
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
    transition-duration: 0.15s;
  }

  .duration-300 {
    transition-duration: 0.3s;
  }

  .duration-500 {
    transition-duration: 0.5s;
  }

  .ease-smooth {
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
  }

  .ease-spring {
    transition-timing-function: cubic-bezier(0.175, 0.885, 0.32, 1.275);
  }

  .hover\:scale-\[1\.01\]:hover {
    transform: scale(1.01);
  }

  .hover\:scale-\[1\.02\]:hover {
    transform: scale(1.02);
  }

  .hover\:-translate-y-1:hover {
    transform: translateY(-0.25rem);
  }

  .hover\:shadow-glow:hover {
    box-shadow: var(--shadow-glow);
  }

  .hover\:shadow-md:hover {
    box-shadow: var(--shadow-md);
  }
}