/* Page Transition - Circular Ripple Effect */
.page-transition {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 99999;
  pointer-events: none;
  overflow: hidden;
  display: none;
}

/* Show transition when active */
.page-transition.circle-in,
.page-transition.circle-out {
  display: block;
}

/* Circular Reveal Mask */
.transition-circle {
  position: absolute;
  width: 200vmax;
  height: 200vmax;
  border-radius: 50%;
  background: radial-gradient(circle at center, #1b3e89 0%, #ff813e 100%);
  transform: translate(-50%, -50%) scale(0);
  transform-origin: center center;
  will-change: transform;
  top: 50%;
  left: 50%;
  transition: transform 0.7s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Circle expand animation */
.circle-in .transition-circle {
  transform: translate(-50%, -50%) scale(1);
}

/* Circle contract animation */
.circle-out .transition-circle {
  transform: translate(-50%, -50%) scale(0);
  transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Ripple Rings */
.transition-ripple {
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  opacity: 0;
}

.circle-in .transition-ripple {
  opacity: 1;
}

.transition-ripple::before,
.transition-ripple::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 100px;
  height: 100px;
  border: 3px solid rgba(255, 255, 255, 0.5);
  border-radius: 50%;
  transform: translate(-50%, -50%) scale(0);
  animation: ripple 1.0s ease-out infinite;
}

.transition-ripple::after {
  animation-delay: 0.3s;
}

@keyframes ripple {
  0% {
    transform: translate(-50%, -50%) scale(0);
    opacity: 1;
  }
  100% {
    transform: translate(-50%, -50%) scale(20);
    opacity: 0;
  }
}

/* Floating Particles */
.transition-particles {
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
}

.particle {
  position: absolute;
  width: 4px;
  height: 4px;
  background: rgba(255, 255, 255, 0.8);
  border-radius: 50%;
  opacity: 0;
}

.circle-in .particle {
  animation: float-particle 1.2s ease-out forwards;
}

.particle:nth-child(1) { top: 20%; left: 10%; animation-delay: 0.1s; }
.particle:nth-child(2) { top: 80%; left: 90%; animation-delay: 0.2s; }
.particle:nth-child(3) { top: 10%; left: 50%; animation-delay: 0.3s; }
.particle:nth-child(4) { top: 70%; left: 30%; animation-delay: 0.4s; }
.particle:nth-child(5) { top: 40%; left: 80%; animation-delay: 0.5s; }
.particle:nth-child(6) { top: 60%; left: 20%; animation-delay: 0.6s; }
.particle:nth-child(7) { top: 30%; left: 60%; animation-delay: 0.7s; }
.particle:nth-child(8) { top: 90%; left: 40%; animation-delay: 0.8s; }

@keyframes float-particle {
  0% {
    opacity: 0;
    transform: translateY(0) scale(0);
  }
  50% {
    opacity: 1;
    transform: translateY(-20px) scale(1);
  }
  100% {
    opacity: 0;
    transform: translateY(-40px) scale(0);
  }
}

/* Center Brand Badge */
.transition-brand {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 100001;
  opacity: 0;
  pointer-events: none;
}

.circle-in .transition-brand {
  animation: brand-appear 0.9s ease-out forwards;
}

.transition-brand-inner {
  width: 100px;
  height: 100px;
  background: white;
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  transform: rotate(45deg) scale(0);
}

.circle-in .transition-brand-inner {
  animation: brand-rotate 0.9s ease-out forwards;
}

.transition-brand-text {
  transform: rotate(-45deg);
  color: #1b3e89;
  font-size: 14px;
  font-weight: bold;
  text-align: center;
  line-height: 1.2;
}

@keyframes brand-appear {
  0% {
    opacity: 0;
  }
  50% {
    opacity: 1;
  }
  100% {
    opacity: 0;
  }
}

@keyframes brand-rotate {
  0% {
    transform: rotate(45deg) scale(0);
  }
  50% {
    transform: rotate(45deg) scale(1.2);
  }
  100% {
    transform: rotate(45deg) scale(1);
  }
}

/* Circle Expand Animation - Legacy */
@keyframes circleExpand {
  0% {
    transform: translate(-50%, -50%) scale(0);
    opacity: 1;
  }
  100% {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
  }
}

/* Circle Contract Animation - Legacy */
@keyframes circleContract {
  0% {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
  }
  100% {
    transform: translate(-50%, -50%) scale(0);
    opacity: 0;
  }
}