/* ========================================
   EFFETS 3D - Page d'accueil
   ======================================== */

/* === Hero 3D avec parallaxe === */
.hero-3d {
  position: relative;
  overflow: hidden;
  perspective: 1000px;
  background: linear-gradient(135deg, #0B3D73 0%, #4A90E2 50%, #7BC8D9 100%);
}

.hero-3d::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(255,255,255,0.1) 1px, transparent 1px);
  background-size: 50px 50px;
  animation: moveGrid 20s linear infinite;
  transform-style: preserve-3d;
}

@keyframes moveGrid {
  0% { transform: translate(0, 0) rotateX(60deg); }
  100% { transform: translate(50px, 50px) rotateX(60deg); }
}

.hero-3d-content {
  position: relative;
  z-index: 2;
  transform-style: preserve-3d;
}

/* Effet parallaxe sur le contenu */
.parallax-layer {
  transform: translateZ(50px) scale(0.95);
  transition: transform 0.3s ease;
}

/* === Animation 3D de l'œil === */
.eye-3d-container {
  width: 300px;
  height: 300px;
  margin: 2rem auto;
  perspective: 1000px;
  position: relative;
}

.eye-3d {
  width: 100%;
  height: 100%;
  position: relative;
  transform-style: preserve-3d;
  animation: rotateEye 10s ease-in-out infinite;
}

@keyframes rotateEye {
  0%, 100% { transform: rotateY(0deg) rotateX(0deg); }
  25% { transform: rotateY(10deg) rotateX(-5deg); }
  50% { transform: rotateY(0deg) rotateX(5deg); }
  75% { transform: rotateY(-10deg) rotateX(-5deg); }
}

.eye-outer {
  width: 280px;
  height: 180px;
  background: linear-gradient(135deg, #FFFFFF, #E8F4F8);
  border-radius: 50%;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) translateZ(0px);
  box-shadow:
    0 10px 30px rgba(0,0,0,0.2),
    inset 0 -5px 15px rgba(0,0,0,0.1);
}

.eye-iris {
  width: 120px;
  height: 120px;
  background: radial-gradient(circle, #4A90E2 0%, #0B3D73 70%, #000 100%);
  border-radius: 50%;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) translateZ(20px);
  box-shadow:
    0 0 20px rgba(74, 144, 226, 0.5),
    inset 0 0 30px rgba(0,0,0,0.3);
  animation: pulse 3s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { transform: translate(-50%, -50%) translateZ(20px) scale(1); }
  50% { transform: translate(-50%, -50%) translateZ(20px) scale(1.05); }
}

.eye-pupil {
  width: 50px;
  height: 50px;
  background: #000;
  border-radius: 50%;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) translateZ(40px);
  box-shadow:
    0 0 15px rgba(0,0,0,0.8),
    inset 0 0 10px rgba(255,255,255,0.2);
}

.eye-shine {
  width: 20px;
  height: 20px;
  background: rgba(255,255,255,0.8);
  border-radius: 50%;
  position: absolute;
  top: 30%;
  left: 35%;
  transform: translateZ(60px);
  filter: blur(2px);
  animation: shine 2s ease-in-out infinite;
}

@keyframes shine {
  0%, 100% { opacity: 0.8; }
  50% { opacity: 1; }
}

/* === Cartes 3D avec effet tilt === */
.card-3d {
  transform-style: preserve-3d;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  cursor: pointer;
  position: relative;
}

.card-3d::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.2), rgba(255,255,255,0));
  border-radius: var(--border-radius-grand);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.card-3d:hover::before {
  opacity: 1;
}

.card-3d:hover {
  transform: translateZ(20px) rotateX(5deg) rotateY(5deg);
  box-shadow:
    0 20px 50px rgba(0,0,0,0.2),
    0 0 30px rgba(74, 144, 226, 0.3);
}

.card-3d-content {
  transform: translateZ(30px);
}

/* Effet de profondeur sur les icônes */
.card-3d .card-icon {
  transform: translateZ(50px);
  transition: transform 0.3s ease;
}

.card-3d:hover .card-icon {
  transform: translateZ(80px) scale(1.1);
}

/* === Particules flottantes 3D === */
.particles-3d {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  pointer-events: none;
  perspective: 1000px;
}

.particle {
  position: absolute;
  width: 4px;
  height: 4px;
  background: rgba(255, 255, 255, 0.6);
  border-radius: 50%;
  transform-style: preserve-3d;
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.8);
}

/* Animations pour différentes particules */
.particle:nth-child(1) {
  left: 10%;
  animation: float1 15s ease-in-out infinite;
}

.particle:nth-child(2) {
  left: 20%;
  animation: float2 18s ease-in-out infinite 2s;
}

.particle:nth-child(3) {
  left: 30%;
  animation: float3 20s ease-in-out infinite 4s;
}

.particle:nth-child(4) {
  left: 40%;
  animation: float1 22s ease-in-out infinite 1s;
}

.particle:nth-child(5) {
  left: 50%;
  animation: float2 17s ease-in-out infinite 3s;
}

.particle:nth-child(6) {
  left: 60%;
  animation: float3 19s ease-in-out infinite 5s;
}

.particle:nth-child(7) {
  left: 70%;
  animation: float1 16s ease-in-out infinite 2s;
}

.particle:nth-child(8) {
  left: 80%;
  animation: float2 21s ease-in-out infinite 4s;
}

.particle:nth-child(9) {
  left: 90%;
  animation: float3 23s ease-in-out infinite 1s;
}

.particle:nth-child(10) {
  left: 15%;
  animation: float1 18s ease-in-out infinite 6s;
}

@keyframes float1 {
  0%, 100% {
    transform: translate3d(0, 0, 0) rotateZ(0deg);
    opacity: 0;
  }
  10% { opacity: 1; }
  50% {
    transform: translate3d(100px, -80vh, 100px) rotateZ(180deg);
    opacity: 1;
  }
  90% { opacity: 1; }
  100% {
    transform: translate3d(0, -100vh, 0) rotateZ(360deg);
    opacity: 0;
  }
}

@keyframes float2 {
  0%, 100% {
    transform: translate3d(0, 0, 0) rotateY(0deg);
    opacity: 0;
  }
  10% { opacity: 1; }
  50% {
    transform: translate3d(-80px, -80vh, 80px) rotateY(180deg);
    opacity: 1;
  }
  90% { opacity: 1; }
  100% {
    transform: translate3d(0, -100vh, 0) rotateY(360deg);
    opacity: 0;
  }
}

@keyframes float3 {
  0%, 100% {
    transform: translate3d(0, 0, 0) rotateX(0deg);
    opacity: 0;
  }
  10% { opacity: 1; }
  50% {
    transform: translate3d(50px, -80vh, -50px) rotateX(180deg);
    opacity: 1;
  }
  90% { opacity: 1; }
  100% {
    transform: translate3d(0, -100vh, 0) rotateX(360deg);
    opacity: 0;
  }
}

/* === Section avec effet de profondeur === */
.section-3d {
  transform-style: preserve-3d;
  perspective: 1000px;
}

.section-3d .container {
  transform-style: preserve-3d;
}

.depth-layer-1 {
  transform: translateZ(10px);
}

.depth-layer-2 {
  transform: translateZ(20px);
}

.depth-layer-3 {
  transform: translateZ(30px);
}

/* === Animation d'entrée 3D === */
@keyframes slideIn3D {
  from {
    opacity: 0;
    transform: translateZ(-100px) rotateX(20deg);
  }
  to {
    opacity: 1;
    transform: translateZ(0) rotateX(0);
  }
}

.animate-3d-entry {
  animation: slideIn3D 1s ease-out forwards;
}

/* === Effet glassmorphism 3D === */
.glass-3d {
  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-style: preserve-3d;
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.1),
    inset 0 0 30px rgba(255, 255, 255, 0.05);
}

/* === Bouton 3D === */
.btn-3d {
  transform-style: preserve-3d;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

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

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

.btn-3d:hover {
  transform: translateZ(10px) scale(1.05);
  box-shadow:
    0 10px 30px rgba(0, 0, 0, 0.3),
    0 0 20px rgba(74, 144, 226, 0.5);
}

.btn-3d:active {
  transform: translateZ(5px) scale(1.02);
}

/* === Responsive 3D === */
@media (max-width: 768px) {
  .eye-3d-container {
    width: 200px;
    height: 200px;
  }

  .eye-outer {
    width: 200px;
    height: 130px;
  }

  .eye-iris {
    width: 80px;
    height: 80px;
  }

  .eye-pupil {
    width: 35px;
    height: 35px;
  }

  /* Réduire les effets 3D sur mobile pour performance */
  .card-3d:hover {
    transform: translateZ(10px) rotateX(2deg) rotateY(2deg);
  }

  .hero-3d::before {
    animation: none;
  }
}

/* === Désactiver les effets 3D si préférence réduite === */
@media (prefers-reduced-motion: reduce) {
  .hero-3d::before,
  .eye-3d,
  .particle,
  .card-3d,
  .btn-3d {
    animation: none !important;
    transition: none !important;
  }

  .card-3d:hover {
    transform: none;
  }
}

/* === Logo 3D pulsant === */
.logo-3d {
  transform-style: preserve-3d;
  display: inline-block;
  animation: float 3s ease-in-out infinite;
}

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

.logo-3d span:first-child {
  display: inline-block;
  transform: translateZ(20px);
  font-size: 2rem;
  animation: pulse 2s ease-in-out infinite;
}
