/* ===== LOADING OVERLAY PRINCIPAL (Page reload) ===== */
#loading-overlay {
  position: fixed;
  inset: 0;
  background: #fff;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.5s cubic-bezier(0.76, 0, 0.24, 1);
}

#loading-overlay video {
  width: 480px;
  height: auto;
}

#loading-overlay.loading-hidden {
  transform: translateY(-100%);
}

/* ===== PAGE TRANSITION OVERLAY (Changement de page) ===== */
#page-transition-overlay {
  position: fixed;
  inset: 0;
  background: rgba(255, 255, 255, 0.95);
  z-index: 99998;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: auto;
  backdrop-filter: blur(1px);
}

#page-transition-overlay.active {
  animation: transitionShow 0.9s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.transition-container {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}

.transition-logo {
  opacity: 1;
  filter: drop-shadow(0 12px 48px rgba(0, 50, 255, 0.4));
  stroke-dasharray: 1200;
  stroke-dashoffset: 1200;
}

#page-transition-overlay.active .transition-logo {
  animation: drawTrace 0.9s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes transitionShow {
  0% {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(1px);
  }
  100% {
    background: rgba(255, 255, 255, 0);
    backdrop-filter: blur(0px);
  }
}

@keyframes drawTrace {
  0% {
    opacity: 1;
    stroke-dashoffset: 1200;
    transform: scale(0.8);
  }
  50% {
    opacity: 1;
    stroke-dashoffset: 600;
    transform: scale(1);
  }
  75% {
    opacity: 1;
    stroke-dashoffset: 0;
    transform: scale(1);
  }
  100% {
    opacity: 0;
    stroke-dashoffset: 0;
    transform: scale(1.1);
  }
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  #loading-overlay video {
    width: 360px;
    height: auto;
  }
}

@media (max-width: 480px) {
  #loading-overlay video {
    width: 280px;
    height: auto;
  }
}