/* ================================================================
   GLOBAL ADVANCED ANIMATIONS - SCP SITE ROLEPLAY
   Consistent animations across all pages
   ================================================================ */

/* ========== INITIAL HIDDEN STATE ========== */
/* Prevent flash of unstyled content - CRITICAL */
.animate-page-enter,
.animate-fade-in-up,
.animate-slide-left,
.animate-slide-right {
  opacity: 0;
}

/* ========== PAGE LOAD ANIMATIONS ========== */

@keyframes pageEnter {
  0% {
    opacity: 0;
    transform: scale(0.95) translateY(30px);
    filter: blur(10px);
  }

  100% {
    opacity: 1;
    transform: scale(1) translateY(0);
    filter: blur(0);
  }
}

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

  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInScale {
  0% {
    opacity: 0;
    transform: scale(0.9);
  }

  100% {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes slideInLeft {
  0% {
    opacity: 0;
    transform: translateX(-60px);
  }

  100% {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideInRight {
  0% {
    opacity: 0;
    transform: translateX(60px);
  }

  100% {
    opacity: 1;
    transform: translateX(0);
  }
}

/* ========== GLOW & PULSE EFFECTS ========== */

@keyframes pulseGlow {
  0%,
  100% {
    box-shadow:
      0 0 5px rgba(255, 30, 30, 0.3),
      0 0 10px rgba(255, 30, 30, 0.2),
      0 0 15px rgba(255, 30, 30, 0.1);
  }

  50% {
    box-shadow:
      0 0 10px rgba(255, 30, 30, 0.5),
      0 0 20px rgba(255, 30, 30, 0.3),
      0 0 30px rgba(255, 30, 30, 0.2);
  }
}

@keyframes pulseGlowGreen {
  0%,
  100% {
    box-shadow:
      0 0 5px rgba(0, 255, 102, 0.3),
      0 0 10px rgba(0, 255, 102, 0.2);
  }

  50% {
    box-shadow:
      0 0 10px rgba(0, 255, 102, 0.5),
      0 0 20px rgba(0, 255, 102, 0.3);
  }
}

@keyframes subtlePulse {
  0%,
  100% {
    transform: scale(1);
    opacity: 1;
  }

  50% {
    transform: scale(1.02);
    opacity: 0.95;
  }
}

@keyframes shimmer {
  0% {
    background-position: -200% center;
  }

  100% {
    background-position: 200% center;
  }
}

/* ========== BUTTON HOVER ANIMATIONS ========== */

@keyframes buttonHoverGlow {
  0% {
    box-shadow:
      0 6px 14px rgba(255, 0, 0, 0.18),
      inset 0 -6px 12px rgba(255, 0, 0, 0.06);
  }

  100% {
    box-shadow:
      0 8px 20px rgba(255, 0, 0, 0.4),
      0 0 30px rgba(255, 0, 0, 0.2),
      inset 0 -6px 12px rgba(255, 0, 0, 0.1);
  }
}

@keyframes ripple {
  0% {
    transform: scale(0);
    opacity: 0.6;
  }

  100% {
    transform: scale(2.5);
    opacity: 0;
  }
}

/* ========== PARTICLE EFFECTS ========== */

@keyframes float {
  0%,
  100% {
    transform: translateY(0) translateX(0);
  }

  25% {
    transform: translateY(-20px) translateX(10px);
  }

  50% {
    transform: translateY(-10px) translateX(-10px);
  }

  75% {
    transform: translateY(-30px) translateX(5px);
  }
}

@keyframes floatRotate {
  0% {
    transform: translateY(0) rotate(0deg);
    opacity: 0.3;
  }

  50% {
    transform: translateY(-100px) rotate(180deg);
    opacity: 0.6;
  }

  100% {
    transform: translateY(-200px) rotate(360deg);
    opacity: 0;
  }
}

/* ========== MENU & DROPDOWN ANIMATIONS ========== */

@keyframes dropdownExpand {
  0% {
    opacity: 0;
    transform: translateY(-15px) scale(0.95);
    max-height: 0;
  }

  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
    max-height: 500px;
  }
}

@keyframes menuItemStagger {
  0% {
    opacity: 0;
    transform: translateX(-20px);
  }

  100% {
    opacity: 1;
    transform: translateX(0);
  }
}

/* ========== LED & INDICATOR ANIMATIONS ========== */

@keyframes ledBlink {
  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.3;
  }
}

@keyframes ledPulse {
  0%,
  100% {
    transform: scale(1);
    filter: brightness(1);
  }

  50% {
    transform: scale(1.15);
    filter: brightness(1.5);
  }
}

@keyframes scanline {
  0% {
    transform: translateY(-100%);
  }

  100% {
    transform: translateY(100%);
  }
}

/* ========== TEXT & TYPING EFFECTS ========== */

@keyframes typewriter {
  from {
    width: 0;
  }

  to {
    width: 100%;
  }
}

@keyframes textGlow {
  0%,
  100% {
    text-shadow:
      0 0 5px rgba(255, 30, 30, 0.5),
      0 0 10px rgba(255, 30, 30, 0.3);
  }

  50% {
    text-shadow:
      0 0 10px rgba(255, 30, 30, 0.8),
      0 0 20px rgba(255, 30, 30, 0.5),
      0 0 30px rgba(255, 30, 30, 0.3);
  }
}

@keyframes glitch {
  0%,
  100% {
    transform: translate(0);
  }

  20% {
    transform: translate(-2px, 2px);
  }

  40% {
    transform: translate(-2px, -2px);
  }

  60% {
    transform: translate(2px, 2px);
  }

  80% {
    transform: translate(2px, -2px);
  }
}

/* ========== LOADING & PROGRESS ANIMATIONS ========== */

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

  100% {
    transform: rotate(360deg);
  }
}

@keyframes progressBar {
  0% {
    width: 0%;
  }

  100% {
    width: 100%;
  }
}

@keyframes dots {
  0%,
  20% {
    content: '.';
  }

  40% {
    content: '..';
  }

  60%,
  100% {
    content: '...';
  }
}

/* ========== BACKGROUND EFFECTS ========== */

@keyframes gradientShift {
  0% {
    background-position: 0% 50%;
  }

  50% {
    background-position: 100% 50%;
  }

  100% {
    background-position: 0% 50%;
  }
}

@keyframes starfield {
  0% {
    transform: translateY(0);
  }

  100% {
    transform: translateY(-100vh);
  }
}

/* ========== 3D TRANSFORM EFFECTS ========== */

@keyframes flip {
  0% {
    transform: perspective(400px) rotateY(0);
  }

  100% {
    transform: perspective(400px) rotateY(360deg);
  }
}

@keyframes cardFlip {
  0% {
    transform: perspective(1000px) rotateY(0deg);
  }

  100% {
    transform: perspective(1000px) rotateY(180deg);
  }
}

@keyframes bounceIn {
  0% {
    opacity: 0;
    transform: scale(0.3);
  }

  50% {
    opacity: 1;
    transform: scale(1.05);
  }

  70% {
    transform: scale(0.9);
  }

  100% {
    transform: scale(1);
  }
}

/* ========== UTILITY CLASSES ========== */

.animate-page-enter {
  animation: pageEnter 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.animate-fade-in-up {
  animation: fadeInUp 0.6s ease-out forwards;
}

.animate-slide-left {
  animation: slideInLeft 0.6s ease-out forwards;
}

.animate-slide-right {
  animation: slideInRight 0.6s ease-out forwards;
}

.animate-glow {
  animation: pulseGlow 2s ease-in-out infinite;
}

.animate-float {
  animation: float 6s ease-in-out infinite;
}

.animate-shimmer {
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0.1) 50%,
    rgba(255, 255, 255, 0) 100%
  );
  background-size: 200% 100%;
  animation: shimmer 3s infinite;
}

/* Stagger delays for sequential animations */
.stagger-1 {
  animation-delay: 0.1s;
}

.stagger-2 {
  animation-delay: 0.2s;
}

.stagger-3 {
  animation-delay: 0.3s;
}

.stagger-4 {
  animation-delay: 0.4s;
}

.stagger-5 {
  animation-delay: 0.5s;
}

.stagger-6 {
  animation-delay: 0.6s;
}

.stagger-7 {
  animation-delay: 0.7s;
}

.stagger-8 {
  animation-delay: 0.8s;
}

/* ========== SMOOTH TRANSITIONS ========== */

.smooth-all {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.smooth-transform {
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.smooth-opacity {
  transition: opacity 0.3s ease;
}

.smooth-colors {
  transition:
    background-color 0.3s ease,
    color 0.3s ease,
    border-color 0.3s ease;
}

/* ========== CUSTOM SCROLLBAR STYLING ========== */
/* Consistent SCP-themed scrollbar across all pages */

::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.3);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 0, 0, 0.4);
  border-radius: 4px;
  border: 1px solid rgba(0, 0, 0, 0.2);
  transition: background 0.2s ease;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 0, 0, 0.7);
  box-shadow: 0 0 6px rgba(255, 0, 0, 0.5);
}

::-webkit-scrollbar-thumb:active {
  background: rgba(255, 30, 30, 0.9);
}

/* Firefox scrollbar styling */
* {
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 0, 0, 0.4) rgba(0, 0, 0, 0.3);
}

/* Mobile overflow: allow scrolling when content exceeds viewport */
@media (max-width: 768px) {
  html,
  body {
    overflow-y: auto !important;
  }

  body {
    align-items: flex-start;
    padding: 1rem;
  }

  .wrap,
  .menu-wrap {
    overflow: auto;
    max-height: none;
  }
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }

  .led.blink,
  .led.blink-fast {
    animation: none !important;
  }
}
