/* Animations personnalisées - Optimisé avec GPU */
@keyframes fade-in-up {
  from {
    opacity: 0;
    transform: translate3d(0, 30px, 0);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

@keyframes blob {
  0%,
  100% {
    transform: translate3d(0, 0, 0) scale(1);
  }
  25% {
    transform: translate3d(20px, -50px, 0) scale(1.1);
  }
  50% {
    transform: translate3d(-20px, 20px, 0) scale(0.9);
  }
  75% {
    transform: translate3d(50px, 50px, 0) scale(1.05);
  }
}

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

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

/* Blobs animés - Optimisation GPU */
.blob {
  will-change: transform;
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  mix-blend-mode: multiply;
  animation: blob 20s infinite;
  opacity: 0.5;
}

.blob-1 {
  width: 400px;
  height: 400px;
  background: linear-gradient(135deg, #3f3f46 0%, #27272a 100%);
  top: -100px;
  left: -100px;
  animation-delay: 0s;
}

.blob-2 {
  width: 500px;
  height: 500px;
  background: linear-gradient(135deg, #52525b 0%, #3f3f46 100%);
  top: 50%;
  right: -150px;
  animation-delay: 4s;
}

.blob-3 {
  width: 450px;
  height: 450px;
  background: linear-gradient(135deg, #71717a 0%, #52525b 100%);
  bottom: -100px;
  left: 50%;
  animation-delay: 8s;
}

.blob-4 {
  width: 350px;
  height: 350px;
  background: linear-gradient(135deg, #52525b 0%, #3f3f46 100%);
  top: 20%;
  left: 10%;
  animation-delay: 2s;
}

.blob-5 {
  width: 400px;
  height: 400px;
  background: linear-gradient(135deg, #3f3f46 0%, #27272a 100%);
  bottom: 20%;
  right: 10%;
  animation-delay: 6s;
}

.blob-6 {
  width: 500px;
  height: 500px;
  background: linear-gradient(135deg, #52525b 0%, #3f3f46 100%);
  top: 10%;
  right: 5%;
  animation-delay: 3s;
}

.blob-7 {
  width: 450px;
  height: 450px;
  background: linear-gradient(135deg, #3f3f46 0%, #27272a 100%);
  top: 30%;
  left: 10%;
  animation-delay: 5s;
}

.blob-8 {
  width: 380px;
  height: 380px;
  background: linear-gradient(135deg, #52525b 0%, #3f3f46 100%);
  bottom: 10%;
  right: 15%;
  animation-delay: 7s;
}

/* Motifs d'arrière-plan - Optimisé */
.bg-grid-pattern {
  background-image: linear-gradient(
      rgba(255, 255, 255, 0.05) 1px,
      transparent 1px
    ),
    linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
  background-size: 50px 50px;
  will-change: auto;
}

.bg-dots-pattern {
  background-image: radial-gradient(
    circle,
    rgba(0, 0, 0, 0.1) 1px,
    transparent 1px
  );
  background-size: 20px 20px;
  will-change: auto;
}

/* Texte dégradé - Optimisé */
.gradient-text-hero {
  background: linear-gradient(135deg, #a1a1aa 0%, #71717a 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  background-size: 200% 200%;
  animation: gradient-shift 3s ease infinite;
  will-change: background-position;
}

/* Effet Glassmorphisme - Optimisé */
.glass-effect {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  transform: translateZ(0);
}

/* Animation Blob pour la section Compétences - Optimisé */
@keyframes animate-blob {
  0%,
  100% {
    transform: translate(0, 0) scale(1);
  }
  33% {
    transform: translate(30px, -50px) scale(1.1);
  }
  66% {
    transform: translate(-20px, 20px) scale(0.9);
  }
}

.animate-blob {
  animation: animate-blob 7s infinite;
  will-change: transform;
}

.animation-delay-2000 {
  animation-delay: 2s;
}

.animation-delay-4000 {
  animation-delay: 4s;
}

.animate-fade-in-up {
  animation: fade-in-up 0.6s ease-out forwards;
  opacity: 0;
  will-change: opacity, transform;
}

.animation-delay-200 {
  animation-delay: 0.2s;
}

.animation-delay-400 {
  animation-delay: 0.4s;
}

.animation-delay-600 {
  animation-delay: 0.6s;
}

.animation-delay-800 {
  animation-delay: 0.8s;
}

.animation-delay-1000 {
  animation-delay: 1s;
}

/* Défilement fluide */
html {
  scroll-behavior: smooth;
}

/* Barre de défilement personalisée */
::-webkit-scrollbar {
  width: 12px;
}

::-webkit-scrollbar-track {
  background: linear-gradient(180deg, #27272a 0%, #18181b 100%);
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #71717a 0%, #52525b 100%);
  border-radius: 10px;
  border: 2px solid #27272a;
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, #a1a1aa 0%, #71717a 100%);
}

/* Lien actif de la navbar */
.nav-link.active {
  color: #ffffff;
  font-weight: 600;
}

/* Animation de la barre de progression des compétences */
.skill-item {
  transition: transform 0.3s ease;
}

.skill-item:hover {
  transform: translateX(10px);
}

/* Animation de toutes les barres de progression au survol */
.skill-item:hover .bg-gradient-to-r {
  box-shadow: 0 4px 20px rgba(113, 113, 122, 0.5);
  transform: scaleX(1.02);
  transition: all 0.3s ease;
}

.skill-item .bg-gradient-to-r {
  transition: all 0.3s ease;
  transform-origin: left;
}

/* Effets de cartes modernes */
.modern-card {
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: all 0.3s ease;
  will-change: transform;
}

.modern-card:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translate3d(0, -5px, 0);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

/* Effets au survol de carte */
.card-hover {
  transition: all 0.3s ease;
  will-change: transform;
}

.card-hover:hover {
  transform: translate3d(0, -10px, 0);
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1),
    0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* Effet de superposition d'image */
.image-overlay {
  position: relative;
  overflow: hidden;
}

.image-overlay::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    135deg,
    rgba(59, 130, 246, 0.9),
    rgba(30, 64, 175, 0.9)
  );
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 1;
}

.image-overlay:hover::before {
  opacity: 1;
}

/* Animation de pulsation du bouton */
@keyframes pulse {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.7);
  }
  50% {
    box-shadow: 0 0 0 10px rgba(59, 130, 246, 0);
  }
}

.btn-pulse {
  animation: pulse 2s infinite;
}

/* Animation de chargement */
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.loading {
  animation: spin 1s linear infinite;
}

/* Texte dégradé */
.gradient-text {
  background: linear-gradient(135deg, #3b82f6, #8b5cf6);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* États de focus des formulaires */
input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Typographie responsive */
@media (max-width: 640px) {
  h1 {
    font-size: 2.5rem;
  }

  h2 {
    font-size: 2rem;
  }
}

/* Effet au survol de la carte projet */
.project-card {
  position: relative;
  overflow: hidden;
}

.project-card::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    135deg,
    rgba(59, 130, 246, 0.1),
    rgba(139, 92, 246, 0.1)
  );
  opacity: 0;
  transition: opacity 0.3s ease;
}

.project-card:hover::after {
  opacity: 1;
}

/* Animation de révélation de section */
.reveal {
  opacity: 0;
  transform: translateY(50px);
  transition: all 0.6s ease;
}

.reveal.active {
  opacity: 1;
  transform: translateY(0);
}

/* Animation flottante pour les icônes */
@keyframes float {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

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

/* Bordure dégradée personnalisée */
.border-gradient {
  border: 2px solid transparent;
  background-clip: padding-box;
  position: relative;
}

.border-gradient::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: -1;
  margin: -2px;
  border-radius: inherit;
  background: linear-gradient(135deg, #3b82f6, #8b5cf6);
}

/* Sélection de texte */
::selection {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}

::-moz-selection {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}

/* Effet de scintillement */
@keyframes shimmer {
  0% {
    background-position: -1000px 0;
  }
  100% {
    background-position: 1000px 0;
  }
}

.shimmer {
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0.2) 50%,
    rgba(255, 255, 255, 0) 100%
  );
  background-size: 1000px 100%;
  animation: shimmer 2s infinite;
}

/* Effet de lueur néon */
.neon-glow {
  text-shadow: 0 0 10px rgba(102, 126, 234, 0.5),
    0 0 20px rgba(102, 126, 234, 0.3), 0 0 30px rgba(102, 126, 234, 0.2);
}

/* Effet de particules */
@keyframes particles {
  0%,
  100% {
    opacity: 0;
    transform: translateY(0) scale(0);
  }
  50% {
    opacity: 1;
  }
  100% {
    transform: translateY(-100px) scale(1);
  }
}

/* Support du flou d'arrière-plan */
@supports (backdrop-filter: blur(10px)) {
  .backdrop-blur {
    backdrop-filter: blur(10px);
  }
}

/* Styles d'impression */
@media print {
  .no-print {
    display: none !important;
  }
}

/* Accessibilité */
.skip-to-content {
  position: absolute;
  top: -40px;
  left: 0;
  background: #3b82f6;
  color: white;
  padding: 8px;
  text-decoration: none;
  z-index: 100;
}

.skip-to-content:focus {
  top: 0;
}

/* Lecteur d'écran uniquement */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

.sr-only.focus\:not-sr-only:focus {
  position: static;
  width: auto;
  height: auto;
  padding: inherit;
  margin: inherit;
  overflow: visible;
  clip: auto;
  white-space: normal;
}

/* Focus visible */
button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 2px solid #3b82f6;
  outline-offset: 2px;
}

/* Transition pour tous les éléments */
* {
  transition: color 0.2s ease, background-color 0.2s ease;
}

/* Supprimer les transitions des animations */
.animate-fade-in-up,
.reveal {
  transition: none;
}

/* Uniformiser la hauteur des cartes projets */
#projects article {
  min-height: 580px;
  display: flex;
  flex-direction: column;
}

#projects article > div:last-child {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
