/* Loading Animations for Header */

/* Pre-header - no animation to prevent flash/delay */
.pre-header {
  opacity: 1;
  transform: translateY(0);
}

/* Header slide in from top */
.header-area {
  opacity: 0;
  transform: translateY(-15px);
  animation: slideInFromTop 0.3s ease-out 0.05s forwards;
}

/* Logo animation */
.header-area .logo {
  opacity: 0;
  transform: scale(0.95);
  animation: logoAppear 0.25s ease-out 0.15s forwards;
}

/* Menu items stagger animation */
.header-area .nav li {
  opacity: 0;
  transform: translateY(-10px);
  animation: menuItemFadeIn 0.25s ease-out forwards;
}

.header-area .nav li:nth-child(1) { animation-delay: 0.2s; }
.header-area .nav li:nth-child(2) { animation-delay: 0.23s; }
.header-area .nav li:nth-child(3) { animation-delay: 0.26s; }
.header-area .nav li:nth-child(4) { animation-delay: 0.29s; }
.header-area .nav li:nth-child(5) { animation-delay: 0.32s; }
.header-area .nav li:nth-child(6) { animation-delay: 0.35s; }
.header-area .nav li:nth-child(7) { animation-delay: 0.38s; }

/* Pre-header contact info animation */
.pre-header .left-info ul li {
  opacity: 0;
  transform: translateX(-10px);
  animation: slideInFromLeft 0.25s ease-out forwards;
}

.pre-header .left-info ul li:nth-child(1) { animation-delay: 0.08s; }
.pre-header .left-info ul li:nth-child(2) { animation-delay: 0.11s; }
.pre-header .left-info ul li:nth-child(3) { animation-delay: 0.14s; }

/* Social icons animation */
.pre-header .social-icons ul li {
  opacity: 0;
  transform: scale(0.8);
  animation: socialIconPop 0.25s ease-out forwards;
}

.pre-header .social-icons ul li:nth-child(1) { animation-delay: 0.17s; }
.pre-header .social-icons ul li:nth-child(2) { animation-delay: 0.2s; }
.pre-header .social-icons ul li:nth-child(3) { animation-delay: 0.23s; }
.pre-header .social-icons ul li:nth-child(4) { animation-delay: 0.26s; }

/* Keyframe Animations */
@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideInFromTop {
  from {
    opacity: 0;
    transform: translateY(-15px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes logoAppear {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes menuItemFadeIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideInFromLeft {
  from {
    opacity: 0;
    transform: translateX(-10px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes socialIconPop {
  from {
    opacity: 0;
    transform: scale(0.8);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Loading overlay (optional) */
.page-loader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #fff;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.5s ease-out, visibility 0.5s ease-out;
}

.page-loader.hidden {
  opacity: 0;
  visibility: hidden;
}

.loader-container {
  position: relative;
  width: 80px;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.loader-spinner {
  position: absolute;
  width: 80px;
  height: 80px;
  border: 4px solid rgba(74, 144, 226, 0.2);
  border-top: 4px solid #4a90e2;
  border-right: 4px solid #4a90e2;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.loader-logo {
  position: relative;
  width: 45px;
  height: 45px;
  object-fit: contain;
  z-index: 1;
  animation: logoFade 1.5s ease-in-out infinite;
}

/* Fast connection - spinner rotates faster */
.page-loader.fast-connection .loader-spinner {
  animation: spin 0.6s linear infinite;
  border-top-color: #2ecc71;
  border-right-color: #2ecc71;
  border-bottom-color: rgba(46, 204, 113, 0.2);
  border-left-color: rgba(46, 204, 113, 0.2);
}

/* Slow connection - spinner rotates slower */
.page-loader.slow-connection .loader-spinner {
  animation: spin 1s linear infinite;
  border-top-color: #4a90e2;
  border-right-color: #4a90e2;
  border-bottom-color: rgba(74, 144, 226, 0.2);
  border-left-color: rgba(74, 144, 226, 0.2);
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

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

/* Smooth transition for body - removed to prevent flash */
body {
  opacity: 1;
}

@keyframes bodyFadeIn {
  to {
    opacity: 1;
  }
}

/* Mobile responsive adjustments */
@media (max-width: 991px) {
  .header-area .nav li {
    animation: none;
    opacity: 1;
    transform: none;
  }
  
  .menu-trigger {
    opacity: 0;
    animation: menuTriggerFadeIn 0.6s ease-out 1s forwards;
  }
  
  @keyframes menuTriggerFadeIn {
    from {
      opacity: 0;
      transform: scale(0.8);
    }
    to {
      opacity: 1;
      transform: scale(1);
    }
  }
}
