/* ============================================
   ANIMATIONS.CSS — SOPAIC Motion & Visual Effects
   Keyframes, Parallax, Hover Effects
   Adapted from Music Hub design system
   ============================================ */

/* === PRELOADER === */
.preloader,
#preloader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--color-ink, #060810);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}

#preloader.loaded,
#preloader.hidden,
.preloader.hidden {
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.6s ease, visibility 0.6s ease;
}

.preloader-content {
  text-align: center;
}

.preloader-logo {
  width: 120px;
  height: 120px;
  margin: 0 auto 2rem;
  animation: pulse-glow 2s ease-in-out infinite;
}

.preloader-brand-text {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.preloader-brand-text .sopsd-brand-kicker {
  font-size: 1.25rem;
  font-weight: 700;
  background: var(--school-gradient, linear-gradient(135deg, #30C8D6, #3A034B, #1C2B54));
  background-size: 400% 400%;
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: gradientShift 3s ease infinite;
}

.preloader-brand-text .sopsd-brand-title {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.5);
}

.loading-bar {
  width: 200px;
  height: 4px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 9999px;
  overflow: hidden;
  margin: 2rem auto 0;
}

.loading-progress {
  height: 100%;
  background: var(--school-gradient-cool, linear-gradient(135deg, #30C8D6, #1C2B54));
  border-radius: 9999px;
  animation: loading 1.5s ease-in-out infinite;
}

@keyframes loading {
  0% { width: 0%; }
  50% { width: 100%; }
  100% { width: 0%; }
}

@keyframes pulse-glow {
  0%, 100% {
    filter: drop-shadow(0 0 20px rgba(48, 200, 214, 0.5)) brightness(1);
    transform: scale(1);
  }
  50% {
    filter: drop-shadow(0 0 40px rgba(58, 3, 75, 0.6)) brightness(1.15);
    transform: scale(1.05);
  }
}

/* === HERO FLOATING ORBS === */
.hero-background {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.hero-gradient-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(100px);
  opacity: 0.25;
  animation: float-slow 20s ease-in-out infinite;
}

.orb-1 {
  width: 500px;
  height: 500px;
  background: #30C8D6;
  top: -250px;
  left: -250px;
  animation-delay: 0s;
}

.orb-2 {
  width: 400px;
  height: 400px;
  background: #3A034B;
  bottom: -200px;
  right: -200px;
  animation-delay: 5s;
}

.orb-3 {
  width: 300px;
  height: 300px;
  background: #1C2B54;
  top: 50%;
  right: 10%;
  animation-delay: 10s;
}

@keyframes float-slow {
  0%, 100% { transform: translate(0, 0) scale(1); }
  25% { transform: translate(50px, -50px) scale(1.1); }
  50% { transform: translate(100px, 0) scale(0.9); }
  75% { transform: translate(50px, 50px) scale(1.05); }
}

/* === FLOATING ANIMATION === */
@keyframes float {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-20px); }
}

.float-element {
  animation: float 3s ease-in-out infinite;
}

/* === FADE IN ANIMATIONS === */
.fade-in { animation: fadeIn 1s ease-in; }
.fade-in-up { animation: fadeInUp 0.8s ease-out; }
.fade-in-down { animation: fadeInDown 0.8s ease-out; }
.fade-in-left { animation: fadeInLeft 0.8s ease-out; }
.fade-in-right { animation: fadeInRight 0.8s ease-out; }

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

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

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

@keyframes fadeInRight {
  from { opacity: 0; transform: translateX(40px); }
  to { opacity: 1; transform: translateX(0); }
}

/* === SCALE IN === */
.scale-in { animation: scaleIn 0.5s ease-out; }

@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.5); }
  to { opacity: 1; transform: scale(1); }
}

/* === STAGGER ANIMATION FOR LISTS === */
.stagger-item {
  opacity: 0;
  animation: fadeInUp 0.6s ease-out forwards;
}

.stagger-item:nth-child(1) { animation-delay: 0.1s; }
.stagger-item:nth-child(2) { animation-delay: 0.2s; }
.stagger-item:nth-child(3) { animation-delay: 0.3s; }
.stagger-item:nth-child(4) { animation-delay: 0.4s; }
.stagger-item:nth-child(5) { animation-delay: 0.5s; }
.stagger-item:nth-child(6) { animation-delay: 0.6s; }

/* === HOVER LIFT === */
.hover-lift {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hover-lift:hover {
  transform: translateY(-8px);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.5);
}

/* === SHIMMER EFFECT === */
.shimmer {
  position: relative;
  overflow: hidden;
}

.shimmer::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.12), transparent);
  animation: shimmer 2.5s infinite;
}

@keyframes shimmer {
  0% { left: -100%; }
  100% { left: 100%; }
}

/* === PULSE ANIMATION === */
.pulse { animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite; }

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* === BOUNCE === */
.bounce { animation: bounce 1s infinite; }

@keyframes bounce {
  0%, 100% { transform: translateY(0); animation-timing-function: cubic-bezier(0.8, 0, 1, 1); }
  50% { transform: translateY(-25%); animation-timing-function: cubic-bezier(0, 0, 0.2, 1); }
}

/* === NEON GLOW === */
.neon-glow {
  text-shadow:
    0 0 5px rgba(48, 200, 214, 0.6),
    0 0 10px rgba(48, 200, 214, 0.4),
    0 0 20px rgba(48, 200, 214, 0.3),
    0 0 40px rgba(48, 200, 214, 0.15);
  animation: neon-flicker 3s infinite alternate;
}

@keyframes neon-flicker {
  0%, 19%, 21%, 23%, 25%, 54%, 56%, 100% {
    text-shadow:
      0 0 5px rgba(48, 200, 214, 0.6),
      0 0 10px rgba(48, 200, 214, 0.4),
      0 0 20px rgba(48, 200, 214, 0.3),
      0 0 40px rgba(48, 200, 214, 0.15);
  }
  20%, 24%, 55% { text-shadow: none; }
}

/* === BORDER GLOW === */
.border-glow {
  position: relative;
  border: 2px solid transparent;
  background: linear-gradient(var(--color-panel, #0c1222), var(--color-panel, #0c1222)) padding-box,
              var(--school-gradient-cool, linear-gradient(135deg, #30C8D6, #1C2B54)) border-box;
  animation: border-rotate 3s linear infinite;
}

@keyframes border-rotate {
  0% { filter: hue-rotate(0deg); }
  100% { filter: hue-rotate(360deg); }
}

/* === RIPPLE EFFECT === */
.ripple {
  position: relative;
  overflow: hidden;
}

.ripple::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(48, 200, 214, 0.2);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.ripple:hover::before {
  width: 300px;
  height: 300px;
}

/* === 3D CARD TILT === */
.card-3d {
  transform-style: preserve-3d;
  transition: transform 0.3s ease;
}

.card-3d:hover {
  transform: perspective(1000px) rotateX(3deg) rotateY(-3deg) translateZ(10px);
}

/* === TYPEWRITER === */
.typewriter {
  overflow: hidden;
  border-right: 3px solid var(--color-cyan, #30C8D6);
  white-space: nowrap;
  animation: typing 3.5s steps(40, end), blink-caret 0.75s step-end infinite;
}

@keyframes typing {
  from { width: 0; }
  to { width: 100%; }
}

@keyframes blink-caret {
  from, to { border-color: transparent; }
  50% { border-color: var(--color-cyan, #30C8D6); }
}

/* === GLASSMORPHISM UTILITIES === */
.glass {
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.glass-dark {
  background: rgba(10, 10, 10, 0.7);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

/* === CUSTOM SCROLLBAR === */
::-webkit-scrollbar {
  width: 10px;
}

::-webkit-scrollbar-track {
  background: var(--color-ink, #060810);
}

::-webkit-scrollbar-thumb {
  background: var(--school-gradient-cool, linear-gradient(135deg, #30C8D6, #1C2B54));
  border-radius: 9999px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--color-cyan, #30C8D6);
}

/* === REDUCED MOTION === */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

body.motion-disabled *,
body.motion-disabled *::before,
body.motion-disabled *::after {
  animation: none !important;
  transition: none !important;
}
/* ============================================
   END OF ANIMATIONS.CSS
   ============================================ */
