/**
 * Page Loader Styles - Animated Roamcode Loading Screen
 */

.page-loader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}

.page-loader.hidden {
  opacity: 0;
  visibility: hidden;
}

.loader-content {
  text-align: center;
  width: 100%;
  max-width: 400px;
  padding: 2rem;
}

.loader-logo {
  margin-bottom: 3rem;
}

.loader-text {
  font-size: clamp(2.5rem, 8vw, 4rem);
  font-weight: 700;
  letter-spacing: 0.1em;
  color: #1a1a1a;
  position: relative;
  display: inline-block;
  font-family: 'Poppins', sans-serif;
  animation: text-pulse 2s ease-in-out infinite;
}

.loader-text::before {
  content: attr(data-text);
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  color: #cc1616;
  overflow: hidden;
  animation: loading-text 2s ease-in-out infinite;
  clip-path: polygon(0 0, 0 0, 0 100%, 0% 100%);
}

@keyframes loading-text {
  0% {
    clip-path: polygon(0 0, 0 0, 0 100%, 0% 100%);
  }
  50% {
    clip-path: polygon(0 0, 100% 0, 100% 100%, 0% 100%);
  }
  100% {
    clip-path: polygon(100% 0, 100% 0, 100% 100%, 100% 100%);
  }
}

@keyframes text-pulse {
  0%, 100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.05);
    opacity: 0.9;
  }
}

/* Alternative animation - letter by letter */
.loader-text span {
  display: inline-block;
  animation: letter-bounce 1.5s ease-in-out infinite;
  animation-delay: calc(var(--i) * 0.1s);
}

@keyframes letter-bounce {
  0%, 100% {
    transform: translateY(0);
    color: #1a1a1a;
  }
  50% {
    transform: translateY(-20px);
    color: #cc1616;
  }
}

/* Progress bar */
.loader-progress {
  width: 100%;
  height: 4px;
  background: #e9ecef;
  border-radius: 10px;
  overflow: hidden;
  position: relative;
}

.loader-bar {
  height: 100%;
  background: linear-gradient(90deg, #cc1616 0%, #e82d2d 50%, #cc1616 100%);
  background-size: 200% 100%;
  border-radius: 10px;
  width: 0%;
  animation: loading-progress 2s ease-in-out infinite, gradient-shift 2s linear infinite;
}

@keyframes loading-progress {
  0% {
    width: 0%;
  }
  50% {
    width: 70%;
  }
  100% {
    width: 100%;
  }
}

@keyframes gradient-shift {
  0% {
    background-position: 0% 50%;
  }
  100% {
    background-position: 200% 50%;
  }
}

/* Fade out animation */
.page-loader.fade-out {
  animation: fadeOut 0.5s ease forwards;
}

@keyframes fadeOut {
  to {
    opacity: 0;
    visibility: hidden;
  }
}

/* Mobile responsive */
@media (max-width: 768px) {
  .loader-text {
    font-size: 2.5rem;
  }
  
  .loader-content {
    padding: 1.5rem;
  }
  
  .loader-logo {
    margin-bottom: 2rem;
  }
}

