/**
 * Micro-animations
 * Subtle motion effects to enhance the user experience
 */

/* Subtle hover animations for gallery items */
.gallery-item {
    transition: transform 0.35s cubic-bezier(0.25, 0.8, 0.25, 1), 
                box-shadow 0.35s cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* Slight pulse animation for interactive elements */
@keyframes subtle-pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.02); }
    100% { transform: scale(1); }
}

/* Gentle floating animation */
@keyframes float {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-5px); }
    100% { transform: translateY(0px); }
}

/* Smooth fade in for elements entering viewport */
@keyframes fade-in-up {
    0% { 
        opacity: 0;
        transform: translateY(15px);
    }
    100% { 
        opacity: 1;
        transform: translateY(0);
    }
}

/* Apply animations to specific elements */

/* Stage title animations */
.stage-title {
    position: relative;
    overflow: hidden;
}

.stage-title::after {
    content: "";
    position: absolute;
    bottom: -2px;
    left: 50%;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, rgba(147, 112, 219, 0.8), transparent);
    transition: width 0.6s ease, left 0.6s ease;
}

.stage-title:hover::after {
    width: 80%;
    left: 10%;
}

/* Filter button animations */
.filter-button {
    position: relative;
    overflow: hidden;
}

.filter-button::after {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.5s ease;
}

.filter-button:hover::after {
    left: 100%;
}

/* Gallery overlay animation refinements */
.gallery-overlay {
    transition: transform 0.4s cubic-bezier(0.17, 0.67, 0.83, 0.67), 
                opacity 0.4s cubic-bezier(0.17, 0.67, 0.83, 0.67);
    transform: translateY(100%);
}

/* Pagination hover animation */
.pagination-link:not(.active) {
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.pagination-link:not(.active):hover {
    transform: translateY(-3px) scale(1.05);
}

/* Animate gallery items on page load */
.gallery-item {
    opacity: 0;
    animation: fade-in-up 0.6s ease forwards;
}

/* Staggered animation for multiple items */
.gallery-item:nth-child(1) { animation-delay: 0.05s; }
.gallery-item:nth-child(2) { animation-delay: 0.1s; }
.gallery-item:nth-child(3) { animation-delay: 0.15s; }
.gallery-item:nth-child(4) { animation-delay: 0.2s; }
.gallery-item:nth-child(5) { animation-delay: 0.25s; }
.gallery-item:nth-child(6) { animation-delay: 0.3s; }
.gallery-item:nth-child(7) { animation-delay: 0.35s; }
.gallery-item:nth-child(8) { animation-delay: 0.4s; }
.gallery-item:nth-child(9) { animation-delay: 0.45s; }
.gallery-item:nth-child(10) { animation-delay: 0.5s; }
.gallery-item:nth-child(11) { animation-delay: 0.55s; }
.gallery-item:nth-child(12) { animation-delay: 0.6s; }

/* Subtle motion for timeline markers */
.timeline-marker {
    animation: float 3s ease-in-out infinite;
}

/* Subtle glow animation for highlighted elements */
@keyframes subtle-glow {
    0% { box-shadow: 0 0 5px rgba(147, 112, 219, 0.4); }
    50% { box-shadow: 0 0 12px rgba(147, 112, 219, 0.7); }
    100% { box-shadow: 0 0 5px rgba(147, 112, 219, 0.4); }
}

/* Focus state animations */
input:focus, select:focus, textarea:focus {
    animation: subtle-glow 2s infinite;
}

/* Button click effects */
.filter-button:active {
    transform: scale(0.96);
}

/* Pagination active transition */
.pagination-link.active {
    animation: subtle-pulse 2s infinite;
}

/* Loading spinner animation */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-spinner {
    width: 30px;
    height: 30px;
    border: 3px solid rgba(147, 112, 219, 0.2);
    border-radius: 50%;
    border-top-color: rgba(147, 112, 219, 0.8);
    animation: spin 1s ease-in-out infinite;
}

/* Image loading fade-in effect */
.gallery-image {
    opacity: 0;
    transition: opacity 0.4s ease-in-out;
}

.gallery-image.loaded {
    opacity: 1;
}
