/* ==========================================================================
   RIA E-Approval Dashboard - Animations
   ========================================================================== */

/* ==========================================================================
   Page Load Animations
   ========================================================================== */
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

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

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

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

/* Staggered Animation Classes */
.animate-fade-up {
  animation: fadeUp 300ms ease-out both;
}

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

.animate-slide-left {
  animation: slideInLeft 300ms ease-out both;
}

.animate-slide-right {
  animation: slideInRight 300ms ease-out both;
}

.animate-scale-in {
  animation: scaleIn 300ms ease-out both;
}

/* Stagger Delays */
.delay-1 { animation-delay: 50ms; }
.delay-2 { animation-delay: 100ms; }
.delay-3 { animation-delay: 150ms; }
.delay-4 { animation-delay: 200ms; }
.delay-5 { animation-delay: 250ms; }
.delay-6 { animation-delay: 300ms; }

/* Element-level animation assignment */
.header {
  animation: fadeUp 300ms ease-out 0ms both;
}

.sidebar {
  animation: slideInLeft 300ms ease-out 50ms both;
}

.gallery {
  animation: fadeUp 300ms ease-out 100ms both;
}

.content-grid {
  animation: fadeUp 300ms ease-out 150ms both;
}

.sharing {
  animation: fadeUp 300ms ease-out 200ms both;
}

.footer {
  animation: fadeUp 300ms ease-out 250ms both;
}

/* ==========================================================================
   Hover Micro-interactions
   ========================================================================== */

/* Card Hover */
.card-hover {
  transition: transform 150ms ease-out, box-shadow 150ms ease-out;
}

.card-hover:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

/* Post Card Hover */
.post-card {
  transition: transform 150ms ease-out,
              box-shadow 150ms ease-out,
              background-color 150ms ease-out;
}

.post-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

/* Button Hover */
.btn-primary {
  transition: background-color 150ms ease, transform 100ms ease;
}

.btn-primary:hover {
  background-color: var(--color-primary-hover);
}

.btn-primary:active {
  transform: scale(0.98);
}

/* Nav Item Hover */
.sidebar__item {
  transition: background-color 150ms ease-out,
              color 150ms ease-out,
              border-color 150ms ease-out;
}

/* Tab Hover */
.section__tab {
  transition: background-color 150ms ease, color 150ms ease;
}

/* Gallery Slide Transition */
.gallery__slide {
  transition: opacity 400ms ease-in-out, visibility 400ms ease-in-out;
}

/* ==========================================================================
   Loading States - Skeleton
   ========================================================================== */
@keyframes shimmer {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

.skeleton {
  background: linear-gradient(
    90deg,
    var(--color-bg-secondary) 25%,
    var(--color-border-subtle) 50%,
    var(--color-bg-secondary) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

.skeleton-text {
  height: 14px;
  border-radius: var(--radius-sm);
}

.skeleton-title {
  height: 20px;
  width: 60%;
  border-radius: var(--radius-sm);
}

.skeleton-badge {
  height: 20px;
  width: 80px;
  border-radius: var(--radius-sm);
}

.skeleton-avatar {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
}

/* ==========================================================================
   Pulse Animation (for notifications)
   ========================================================================== */
@keyframes pulse {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.1);
  }
  100% {
    transform: scale(1);
  }
}

.pulse {
  animation: pulse 300ms ease-in-out;
}

/* ==========================================================================
   Badge Animation
   ========================================================================== */
@keyframes badgePop {
  0% {
    transform: scale(0);
    opacity: 0;
  }
  50% {
    transform: scale(1.2);
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

.badge-pop {
  animation: badgePop 300ms cubic-bezier(0.175, 0.885, 0.32, 1.275) both;
}

/* ==========================================================================
   Spinner
   ========================================================================== */
@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid var(--color-border);
  border-top-color: var(--color-primary);
  border-radius: 50%;
  animation: spin 600ms linear infinite;
}

/* ==========================================================================
   Text Clamp
   ========================================================================== */
.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.line-clamp-3 {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

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

/* ==========================================================================
   Utility Animation Classes
   ========================================================================== */

/* Fade */
.fade-enter {
  opacity: 0;
}

.fade-enter-active {
  opacity: 1;
  transition: opacity 200ms ease-out;
}

.fade-exit {
  opacity: 1;
}

.fade-exit-active {
  opacity: 0;
  transition: opacity 200ms ease-out;
}

/* Slide */
.slide-up-enter {
  opacity: 0;
  transform: translateY(10px);
}

.slide-up-enter-active {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 200ms ease-out, transform 200ms ease-out;
}

.slide-up-exit {
  opacity: 1;
  transform: translateY(0);
}

.slide-up-exit-active {
  opacity: 0;
  transform: translateY(-10px);
  transition: opacity 200ms ease-out, transform 200ms ease-out;
}

/* Scale */
.scale-enter {
  opacity: 0;
  transform: scale(0.95);
}

.scale-enter-active {
  opacity: 1;
  transform: scale(1);
  transition: opacity 200ms ease-out, transform 200ms ease-out;
}

.scale-exit {
  opacity: 1;
  transform: scale(1);
}

.scale-exit-active {
  opacity: 0;
  transform: scale(0.95);
  transition: opacity 200ms ease-out, transform 200ms ease-out;
}