/* ============================================
   WELCOME ANIMATION - EVERY PAGE LOAD
   ============================================ */

/* Welcome Overlay - Full Screen */
/* Welcome Overlay - Full Screen */
.welcome-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: linear-gradient(135deg, #0e1610 0%, #1a2e1f 50%, #0e1610 100%);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  /* Reduced from 0.8s ... 2.5s */
  animation: fadeOutOverlay 0.6s ease-in-out 1.8s forwards;
  /* Ensure overlay is always on top and covers everything */
  pointer-events: all;
}

/* Animated Background Particles */
.welcome-overlay::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image:
    radial-gradient(
      circle at 20% 50%,
      rgba(39, 217, 83, 0.15) 0%,
      transparent 50%
    ),
    radial-gradient(
      circle at 80% 80%,
      rgba(39, 217, 83, 0.1) 0%,
      transparent 50%
    ),
    radial-gradient(
      circle at 40% 20%,
      rgba(39, 217, 83, 0.08) 0%,
      transparent 50%
    );
  animation: pulseGlow 3s ease-in-out infinite;
}

/* Welcome Content Container */
.welcome-content {
  position: relative;
  z-index: 2;
  text-align: center;
  /* Reduced delays */
  animation: scaleInContent 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) 0.2s
    backwards;
}

/* Logo Animation */
.welcome-logo {
  width: 200px;
  height: auto;
  margin-bottom: 30px;
  /* Faster logo float */
  animation:
    logoFloat 1.2s ease-in-out,
    logoGlow 2s ease-in-out infinite alternate;
  filter: drop-shadow(0 10px 40px rgba(39, 217, 83, 0.4));
}

/* Welcome Text */
.welcome-text {
  font-size: 2rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 15px;
  /* Faster timing */
  animation: slideUpFade 0.6s ease-out 0.4s backwards;
}

.welcome-subtext {
  font-size: 1.1rem;
  font-weight: 400;
  color: var(--text-muted);
  letter-spacing: 1px;
  /* Faster timing */
  animation: slideUpFade 0.6s ease-out 0.6s backwards;
}

/* Highlight Color */
.welcome-highlight {
  color: var(--primary);
  text-shadow: 0 0 20px rgba(39, 217, 83, 0.6);
}

/* Loading Bar - Fixed to bottom of overlay */
.welcome-loader {
  position: fixed;
  bottom: 60px;
  left: 50%;
  transform: translateX(-50%);
  width: 200px;
  height: 3px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  overflow: hidden;
  /* REMOVED slideUpFade animation to prevent jumping/glitching */
  /* animation: slideUpFade 0.8s ease-out 1.2s backwards; */
  opacity: 0;
  animation: fadeIn 0.5s ease-out 0.8s forwards; /* Simple fade in instead */
  z-index: 10;
}

.welcome-loader-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), #1a8f3a, var(--primary));
  background-size: 200% 100%;
  border-radius: 10px;
  animation:
    loaderProgress 1.8s ease-in-out forwards,
    /* Faster progress (2.5s -> 1.8s) */ loaderShine 1.5s ease-in-out infinite;
  box-shadow: 0 0 20px rgba(39, 217, 83, 0.8);
}

/* ============================================
   PAGE CONTENT ENTRANCE ANIMATIONS
   Only active if 'trigger-entrance' class is on body
   ============================================ */

/* Prevent FOUC before JS loads the overlay */
html.welcome-active-html body {
  overflow: hidden !important;
}

html.welcome-active-html body > *:not(.welcome-overlay) {
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

/* Hide all content initially - COMPLETE LOCKDOWN */
body.welcome-active {
  overflow: hidden !important;
}

/* Force hide ALL page elements during welcome animation */
body.welcome-active * {
  visibility: hidden !important;
}

/* Only show welcome overlay and its children */
body.welcome-active .welcome-overlay,
body.welcome-active .welcome-overlay * {
  visibility: visible !important;
}

/* Additional opacity-based hiding for page content */
body.welcome-active .navbar,
body.welcome-active .hero,
body.welcome-active .client-slider,
body.welcome-active .section,
body.welcome-active footer,
body.welcome-active .premium-footer,
body.welcome-active .scroll-top-btn {
  opacity: 0 !important;
  pointer-events: none !important;
}

/* Navbar Entrance */
body.trigger-entrance .navbar {
  /* Reduced from 3.3s -> 2.0s */
  animation: slideDownFadeIn 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) 2s backwards;
}

/* Hero Section Entrance */
body.trigger-entrance .hero {
  /* Reduced from 3.5s -> 2.2s */
  animation: heroEntrance 1s ease-out 2.2s backwards;
}

body.trigger-entrance .hero h1 {
  /* Reduced from 3.7s -> 2.4s */
  animation: slideUpFade 0.8s ease-out 2.4s backwards;
}

body.trigger-entrance .hero p {
  /* Reduced from 3.9s -> 2.6s */
  animation: slideUpFade 0.8s ease-out 2.6s backwards;
}

body.trigger-entrance .hero .btn-consultancy,
body.trigger-entrance .hero .btn-job-seekers {
  /* Reduced from 4.1s -> 2.8s */
  animation: scaleInBounce 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) 2.8s backwards;
}

body.trigger-entrance .hero .btn-job-seekers {
  animation-delay: 3s;
}

/* Client Slider Entrance */
body.trigger-entrance .client-slider {
  animation: slideUpFade 0.8s ease-out 3.2s backwards;
}

/* Section Staggered Entrance */
body.trigger-entrance .section:nth-of-type(1) {
  animation: fadeInUp 0.8s ease-out 3.4s backwards;
}

body.trigger-entrance .section:nth-of-type(2) {
  animation: fadeInUp 0.8s ease-out 3.6s backwards;
}

body.trigger-entrance .section:nth-of-type(3) {
  animation: fadeInUp 0.8s ease-out 3.8s backwards;
}

body.trigger-entrance .section:nth-of-type(4) {
  animation: fadeInUp 0.8s ease-out 4s backwards;
}

/* Footer Entrance */
body.trigger-entrance footer,
body.trigger-entrance .premium-footer {
  animation: fadeInUp 0.8s ease-out 4.2s backwards;
}

/* Scroll to Top Button - Delayed */
body.trigger-entrance .scroll-top-btn {
  animation: scaleInBounce 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) 4.4s backwards;
}

/* ============================================
   KEYFRAME ANIMATIONS
   ============================================ */

@keyframes fadeOutOverlay {
  0% {
    opacity: 1;
    visibility: visible;
  }
  100% {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
  }
}

@keyframes pulseGlow {
  0%,
  100% {
    opacity: 0.5;
    transform: scale(1);
  }
  50% {
    opacity: 1;
    transform: scale(1.05);
  }
}

@keyframes scaleInContent {
  0% {
    opacity: 0;
    transform: scale(0.8);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes logoFloat {
  0% {
    transform: translateY(-50px) scale(0.5);
    opacity: 0;
  }
  60% {
    transform: translateY(10px) scale(1.1);
  }
  100% {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}

@keyframes logoGlow {
  0% {
    filter: drop-shadow(0 10px 40px rgba(39, 217, 83, 0.3));
  }
  100% {
    filter: drop-shadow(0 10px 60px rgba(39, 217, 83, 0.6));
  }
}

@keyframes slideUpFade {
  0% {
    opacity: 0;
    transform: translateY(30px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes loaderProgress {
  0% {
    width: 0%;
  }
  100% {
    width: 100%;
  }
}

@keyframes loaderShine {
  0% {
    background-position: 0% 50%;
  }
  100% {
    background-position: 200% 50%;
  }
}

@keyframes slideDownFadeIn {
  0% {
    opacity: 0;
    transform: translateX(-50%) translateY(-50px);
  }
  100% {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

@keyframes heroEntrance {
  0% {
    opacity: 0;
    transform: scale(0.95);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes scaleInBounce {
  0% {
    opacity: 0;
    transform: scale(0.5);
  }
  70% {
    transform: scale(1.05);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes fadeInUp {
  0% {
    opacity: 0;
    transform: translateY(40px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ============================================
   RESPONSIVE ADJUSTMENTS
   ============================================ */

@media (max-width: 768px) {
  .welcome-logo {
    width: 150px;
  }

  .welcome-text {
    font-size: 1.5rem;
    letter-spacing: 1px;
  }

  .welcome-subtext {
    font-size: 0.95rem;
  }

  .welcome-loader {
    width: 150px;
    bottom: 40px;
  }
}

@media (max-width: 480px) {
  .welcome-logo {
    width: 120px;
  }

  .welcome-text {
    font-size: 1.2rem;
  }

  .welcome-subtext {
    font-size: 0.85rem;
  }

  .welcome-loader {
    width: 120px;
  }
}
