/* Animations & Transitions */

/* ============================================
   FOCUS VISIBLE STYLES
   ============================================ */

*:focus-visible {
    outline: 3px solid rgba(108, 99, 255, 0.5);
    outline-offset: 2px;
}

/* ============================================
   CARD ANIMATIONS
   ============================================ */

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

.recording-card {
    animation: cardFadeIn 0.3s ease-out forwards;
}

/* Stagger animation for cards */
.recording-card:nth-child(1) { animation-delay: 0ms; }
.recording-card:nth-child(2) { animation-delay: 50ms; }
.recording-card:nth-child(3) { animation-delay: 100ms; }
.recording-card:nth-child(4) { animation-delay: 150ms; }
.recording-card:nth-child(5) { animation-delay: 200ms; }
.recording-card:nth-child(6) { animation-delay: 250ms; }
.recording-card:nth-child(7) { animation-delay: 300ms; }
.recording-card:nth-child(8) { animation-delay: 350ms; }

/* ============================================
   HOVER GLOW EFFECT (SIDEBAR)
   ============================================ */

.nav-item::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: var(--radius-md);
    opacity: 0;
    background: radial-gradient(
        circle at center,
        rgba(255, 255, 255, 0.1) 0%,
        transparent 70%
    );
    transition: opacity var(--transition-base);
    pointer-events: none;
}

.nav-item:hover::after {
    opacity: 1;
}

/* ============================================
   BUTTON RIPPLE EFFECT
   ============================================ */

.btn-primary {
    position: relative;
    overflow: hidden;
}

.btn-primary::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(
        circle,
        rgba(255, 255, 255, 0.3) 0%,
        transparent 70%
    );
    transform: scale(0);
    opacity: 0;
    transition: transform 0.5s, opacity 0.5s;
}

.btn-primary:active::before {
    transform: scale(2);
    opacity: 1;
    transition: 0s;
}

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

/* Smooth opacity transitions */
.fade-in {
    animation: fadeIn 0.3s ease-out;
}

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

/* Smooth height transitions */
.expand {
    animation: expand 0.3s ease-out;
}

@keyframes expand {
    from {
        max-height: 0;
        opacity: 0;
    }
    to {
        max-height: 1000px;
        opacity: 1;
    }
}

/* ============================================
   LOADING ANIMATIONS
   ============================================ */

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

.spinner {
    animation: spin 1s linear infinite;
}

/* Skeleton loading for cards */
@keyframes skeleton-loading {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

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

/* ============================================
   PAGE TRANSITION ANIMATIONS
   ============================================ */

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

.page-transition {
    animation: slideInFromRight 0.3s ease-out;
}

/* ============================================
   MICRO-INTERACTIONS
   ============================================ */

/* Scale on active */
.scale-on-active:active {
    transform: scale(0.95);
}

/* Bounce effect */
@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-4px);
    }
}

.bounce {
    animation: bounce 0.6s ease-in-out;
}

/* Shake effect for errors */
@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }
    25% {
        transform: translateX(-10px);
    }
    75% {
        transform: translateX(10px);
    }
}

.shake {
    animation: shake 0.4s ease-in-out;
}

/* ============================================
   ACCESSIBILITY - REDUCED MOTION
   ============================================ */

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

/* ============================================
   SCROLL ANIMATIONS
   ============================================ */

.smooth-scroll {
    scroll-behavior: smooth;
}

/* Fade in on scroll (for future enhancement) */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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