/* BinMaster Premium - Animations & Transitions */

/* Smooth Transitions */
* {
  transition-timing-function: cubic-bezier(0.4, 0.0, 0.2, 1);
}

/* Glass Panel Slide-In Animation */
@keyframes slideInUp {
  from {
    transform: translateY(20px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

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

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

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

/* Blur Fade In Animation */
@keyframes blurFadeIn {
  from {
    opacity: 0;
    filter: blur(0px);
  }
  to {
    opacity: 1;
    filter: blur(20px);
  }
}

/* Pulse Animation for Success States */
@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.8;
  }
}

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

/* Shimmer Effect for Loading */
@keyframes shimmer {
  0% {
    background-position: -1000px 0;
  }
  100% {
    background-position: 1000px 0;
  }
}

/* Rotate Animation */
@keyframes rotate {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

/* Bounce Animation for Icons */
@keyframes bounce {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

/* Border Glow Animation */
@keyframes borderGlow {
  0%, 100% {
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 0 0 rgba(255, 255, 255, 0);
  }
  50% {
    border-color: rgba(255, 255, 255, 0.4);
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.3);
  }
}

/* Animation Classes */
.animate-slideInUp {
  animation: slideInUp 400ms ease-out;
}

.animate-slideInDown {
  animation: slideInDown 400ms ease-out;
}

.animate-fadeIn {
  animation: fadeIn 300ms ease-out;
}

.animate-fadeInScale {
  animation: fadeInScale 400ms ease-out;
}

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

.animate-bounce {
  animation: bounce 1s ease-in-out infinite;
}

.animate-rotate {
  animation: rotate 1s linear infinite;
}

/* Staggered Animations */
.stagger-item {
  opacity: 0;
  animation: slideInUp 400ms ease-out forwards;
}

.stagger-item:nth-child(1) { animation-delay: 0ms; }
.stagger-item:nth-child(2) { animation-delay: 100ms; }
.stagger-item:nth-child(3) { animation-delay: 200ms; }
.stagger-item:nth-child(4) { animation-delay: 300ms; }
.stagger-item:nth-child(5) { animation-delay: 400ms; }
.stagger-item:nth-child(6) { animation-delay: 500ms; }
.stagger-item:nth-child(7) { animation-delay: 600ms; }
.stagger-item:nth-child(8) { animation-delay: 700ms; }

/* Loading State */
.loading {
  position: relative;
  overflow: hidden;
}

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

/* Spinner */
.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(255, 255, 255, 0.2);
  border-top-color: var(--primary-500);
  border-radius: 50%;
  animation: rotate 800ms linear infinite;
}

/* Success Checkmark Animation */
@keyframes checkmark {
  0% {
    stroke-dashoffset: 100;
  }
  100% {
    stroke-dashoffset: 0;
  }
}

.checkmark {
  stroke-dasharray: 100;
  animation: checkmark 500ms ease-out forwards;
}

/* Hover Effects */
.hover-lift {
  transition: transform 300ms cubic-bezier(0.4, 0.0, 0.2, 1);
}

.hover-lift:hover {
  transform: translateY(-8px);
}

.hover-glow {
  transition: all 300ms cubic-bezier(0.4, 0.0, 0.2, 1);
}

.hover-glow:hover {
  box-shadow: 0 0 30px rgba(0, 122, 255, 0.3);
}

.hover-glass-intensify {
  transition: all 300ms cubic-bezier(0.4, 0.0, 0.2, 1);
}

.hover-glass-intensify:hover {
  backdrop-filter: blur(30px) saturate(200%);
  background: rgba(255, 255, 255, 0.45);
}

/* Focus States */
.focus-ring:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.3);
}

/* Page Transition */
.page-transition {
  animation: fadeInScale 400ms ease-out;
}

/* Accordion Transitions */
.accordion-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 300ms cubic-bezier(0.4, 0.0, 0.2, 1),
              opacity 300ms ease-out;
  opacity: 0;
}

.accordion-content.expanded {
  max-height: 2000px;
  opacity: 1;
}

.accordion-icon {
  transition: transform 300ms cubic-bezier(0.4, 0.0, 0.2, 1);
}

.accordion-item.active .accordion-icon {
  transform: rotate(180deg);
}

/* Modal Animations */
.modal {
  opacity: 0;
  pointer-events: none;
  transition: opacity 300ms ease-out;
}

.modal.show {
  opacity: 1;
  pointer-events: all;
}

.modal-content {
  transform: scale(0.9);
  transition: transform 300ms cubic-bezier(0.4, 0.0, 0.2, 1);
}

.modal.show .modal-content {
  transform: scale(1);
}

/* Copy Success Animation */
@keyframes copySuccess {
  0% {
    background: rgba(16, 185, 129, 0);
  }
  50% {
    background: rgba(16, 185, 129, 0.2);
  }
  100% {
    background: rgba(16, 185, 129, 0);
  }
}

.copy-success {
  animation: copySuccess 600ms ease-out;
}

/* Progress Bar Animation */
@keyframes progressBar {
  from {
    width: 0;
  }
  to {
    width: 100%;
  }
}

.progress-bar {
  animation: progressBar 1s ease-out forwards;
}

/* Scroll Reveal */
.scroll-reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 600ms ease-out,
              transform 600ms cubic-bezier(0.4, 0.0, 0.2, 1);
}

.scroll-reveal.revealed {
  opacity: 1;
  transform: translateY(0);
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  
  .glass-card,
  .tool-card,
  .hover-lift,
  .hover-glow,
  .hover-glass-intensify {
    backdrop-filter: none !important;
    background: rgba(255, 255, 255, 0.9) !important;
  }
}
