/* ============================================
   RR ACADEMY - ADVANCED ANIMATIONS 2026
   Premium Micro-Interactions & Motion Design
   ============================================ */

/* ========== SMOOTH SCROLL BEHAVIOR ========== */

html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

/* ========== ENTRANCE ANIMATIONS ========== */

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(40px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(40px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-40px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@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);
  }
}

/* ========== LOADING & SPINNER ANIMATIONS ========== */

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

@keyframes shimmer {
  0% {
    background-position: -1000px 0;
  }
  100% {
    background-position: 1000px 0;
  }
}

@keyframes wave {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

/* ========== HOVER EFFECTS ========== */

/* Card Lift Effect */
.card-lift {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.card-lift:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

/* Button Ripple Effect */
.btn-ripple {
  position: relative;
  overflow: hidden;
}

.btn-ripple::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.btn-ripple:hover::before {
  width: 300px;
  height: 300px;
}

/* Glow on Hover */
.glow-on-hover {
  transition: all 0.3s ease;
}

.glow-on-hover:hover {
  box-shadow: 0 0 20px rgba(220, 253, 125, 0.6),
              0 0 40px rgba(220, 253, 125, 0.4);
}

/* Scale on Hover */
.scale-on-hover {
  transition: transform 0.3s ease;
}

.scale-on-hover:hover {
  transform: scale(1.05);
}

/* Rotate on Hover */
.rotate-on-hover {
  transition: transform 0.4s ease;
}

.rotate-on-hover:hover {
  transform: rotate(5deg);
}

/* ========== FLOATING ANIMATIONS ========== */

@keyframes float {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-15px);
  }
}

@keyframes floatSlow {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

.float {
  animation: float 3s ease-in-out infinite;
}

.float-slow {
  animation: floatSlow 4s ease-in-out infinite;
}

.float-delay-1 {
  animation-delay: 0.5s;
}

.float-delay-2 {
  animation-delay: 1s;
}

.float-delay-3 {
  animation-delay: 1.5s;
}

/* ========== GRADIENT ANIMATIONS ========== */

@keyframes gradientShift {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

.gradient-animate {
  background-size: 200% 200%;
  animation: gradientShift 6s ease infinite;
}

/* ========== TEXT EFFECTS ========== */

@keyframes typewriter {
  from {
    width: 0;
  }
  to {
    width: 100%;
  }
}

@keyframes blinkCursor {
  from, to {
    border-color: transparent;
  }
  50% {
    border-color: var(--color-accent-300);
  }
}

.typewriter {
  overflow: hidden;
  border-right: 3px solid var(--color-accent-300);
  white-space: nowrap;
  animation: typewriter 3s steps(40, end),
             blinkCursor 0.75s step-end infinite;
}

/* Gradient Text Shimmer */
@keyframes textShimmer {
  0% {
    background-position: 0% 50%;
  }
  100% {
    background-position: 200% 50%;
  }
}

.text-shimmer {
  background: linear-gradient(
    90deg,
    var(--color-primary-800) 0%,
    var(--color-accent-300) 50%,
    var(--color-primary-800) 100%
  );
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: textShimmer 3s linear infinite;
}

/* ========== SCROLL-TRIGGERED ANIMATIONS ========== */

/* Fade In Up on Scroll */
.scroll-fade-in-up {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.scroll-fade-in-up.in-view {
  opacity: 1;
  transform: translateY(0);
}

/* Fade In on Scroll */
.scroll-fade-in {
  opacity: 0;
  transition: opacity 0.6s ease;
}

.scroll-fade-in.in-view {
  opacity: 1;
}

/* Scale In on Scroll */
.scroll-scale-in {
  opacity: 0;
  transform: scale(0.9);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.scroll-scale-in.in-view {
  opacity: 1;
  transform: scale(1);
}

/* Slide In from Left */
.scroll-slide-left {
  opacity: 0;
  transform: translateX(-40px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.scroll-slide-left.in-view {
  opacity: 1;
  transform: translateX(0);
}

/* Slide In from Right */
.scroll-slide-right {
  opacity: 0;
  transform: translateX(40px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.scroll-slide-right.in-view {
  opacity: 1;
  transform: translateX(0);
}

/* ========== PROGRESS & LOADING ANIMATIONS ========== */

/* Progress Bar Fill */
@keyframes progressFill {
  from {
    width: 0%;
  }
  to {
    width: 100%;
  }
}

.progress-bar-animated {
  animation: progressFill 2s ease-out forwards;
}

/* Skeleton Loading */
@keyframes skeleton {
  0% {
    background-position: -200px 0;
  }
  100% {
    background-position: calc(200px + 100%) 0;
  }
}

.skeleton {
  background: linear-gradient(
    90deg,
    var(--color-neutral-200) 0px,
    var(--color-neutral-100) 40px,
    var(--color-neutral-200) 80px
  );
  background-size: 200px 100%;
  animation: skeleton 1.2s ease-in-out infinite;
}

/* ========== INTERACTIVE NUMBER COUNTER ========== */

@keyframes countUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.counter-animate {
  animation: countUp 0.6s ease-out;
}

/* ========== PARALLAX EFFECTS ========== */

.parallax {
  will-change: transform;
  transition: transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.parallax-slow {
  transform: translateY(calc(var(--scroll-position) * -0.1));
}

.parallax-medium {
  transform: translateY(calc(var(--scroll-position) * -0.3));
}

.parallax-fast {
  transform: translateY(calc(var(--scroll-position) * -0.5));
}

/* ========== STAGGER ANIMATIONS ========== */

.stagger-fade-in > * {
  opacity: 0;
  animation: fadeIn 0.6s ease forwards;
}

.stagger-fade-in > *:nth-child(1) {
  animation-delay: 0.1s;
}

.stagger-fade-in > *:nth-child(2) {
  animation-delay: 0.2s;
}

.stagger-fade-in > *:nth-child(3) {
  animation-delay: 0.3s;
}

.stagger-fade-in > *:nth-child(4) {
  animation-delay: 0.4s;
}

.stagger-fade-in > *:nth-child(5) {
  animation-delay: 0.5s;
}

.stagger-fade-in > *:nth-child(6) {
  animation-delay: 0.6s;
}

/* ========== FOCUS & ACTIVE STATES ========== */

/* Enhanced Focus Ring */
.focus-ring:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(220, 253, 125, 0.5);
}

/* Active Button State */
.btn-active:active {
  transform: scale(0.95);
  transition: transform 0.1s ease;
}

/* ========== NOTIFICATION ANIMATIONS ========== */

@keyframes slideInFromTop {
  from {
    transform: translateY(-100%);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes slideOutToTop {
  from {
    transform: translateY(0);
    opacity: 1;
  }
  to {
    transform: translateY(-100%);
    opacity: 0;
  }
}

.notification-enter {
  animation: slideInFromTop 0.4s ease-out;
}

.notification-exit {
  animation: slideOutToTop 0.4s ease-in;
}

/* ========== MODAL ANIMATIONS ========== */

@keyframes modalFadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes modalSlideUp {
  from {
    transform: translateY(50px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.modal-backdrop {
  animation: modalFadeIn 0.3s ease;
}

.modal-content {
  animation: modalSlideUp 0.4s ease;
}

/* ========== ICON ANIMATIONS ========== */

@keyframes iconBounce {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-5px);
  }
}

.icon-bounce {
  animation: iconBounce 1s ease-in-out infinite;
}

@keyframes iconRotate {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.icon-rotate {
  animation: iconRotate 2s linear infinite;
}

/* Arrow Animation */
@keyframes arrowMove {
  0%, 100% {
    transform: translateX(0);
  }
  50% {
    transform: translateX(5px);
  }
}

.arrow-animate {
  animation: arrowMove 1s ease-in-out infinite;
}

/* ========== FORM ANIMATIONS ========== */

/* Input Focus Animation */
.input-focus {
  transition: all 0.3s ease;
}

.input-focus:focus {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.2);
}

/* Label Float Animation */
@keyframes labelFloat {
  from {
    transform: translateY(0);
    font-size: 1rem;
  }
  to {
    transform: translateY(-24px);
    font-size: 0.75rem;
  }
}

.label-float {
  animation: labelFloat 0.3s ease forwards;
}

/* ========== PERFORMANCE OPTIMIZATIONS ========== */

/* GPU Acceleration */
.gpu-accelerate {
  transform: translateZ(0);
  will-change: transform;
  backface-visibility: hidden;
  perspective: 1000px;
}

/* Reduce Motion for Accessibility */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  
  .parallax {
    transform: none !important;
  }
  
  .float,
  .float-slow,
  .typewriter {
    animation: none !important;
  }
}

/* ========== UTILITY ANIMATION CLASSES ========== */

.animate-delay-100 {
  animation-delay: 0.1s;
}

.animate-delay-200 {
  animation-delay: 0.2s;
}

.animate-delay-300 {
  animation-delay: 0.3s;
}

.animate-delay-500 {
  animation-delay: 0.5s;
}

.animate-delay-1000 {
  animation-delay: 1s;
}

.animate-duration-fast {
  animation-duration: 0.3s;
}

.animate-duration-normal {
  animation-duration: 0.6s;
}

.animate-duration-slow {
  animation-duration: 1s;
}

/* Fade Transitions */
.fade-enter {
  opacity: 0;
}

.fade-enter-active {
  opacity: 1;
  transition: opacity 0.3s ease;
}

.fade-exit {
  opacity: 1;
}

.fade-exit-active {
  opacity: 0;
  transition: opacity 0.3s ease;
}

/* ========== END OF ANIMATIONS 2026 ========== */
