/* Advanced Archive Card Animations and Interactions */

/* Card Entrance Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

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

@keyframes shimmer {
    0% {
        background-position: -200px 0;
    }
    100% {
        background-position: calc(200px + 100%) 0;
    }
}

/* Card Container Animations */
.archive-card {
    animation: fadeInUp 0.6s ease-out forwards;
    animation-delay: calc(var(--card-index, 0) * 0.1s);
    opacity: 0;
}

.archive-card:nth-child(odd) {
    animation-name: slideInLeft;
}

/* Enhanced Hover Effects */
.archive-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(99, 102, 241, 0.1);
}

.archive-card:hover .card-image {
    transform: scale(1.1);
}

.archive-card:hover .card-gradient-overlay {
    opacity: 0.8;
}

/* Badge Animations */
.badge-animate {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.badge-animate:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Loading Shimmer Effect */
.shimmer-loading {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200px 100%;
    animation: shimmer 2s infinite;
}

/* Stagger Animation for Cards */
.cards-container .archive-card:nth-child(1) { animation-delay: 0.1s; }
.cards-container .archive-card:nth-child(2) { animation-delay: 0.2s; }
.cards-container .archive-card:nth-child(3) { animation-delay: 0.3s; }
.cards-container .archive-card:nth-child(4) { animation-delay: 0.4s; }
.cards-container .archive-card:nth-child(5) { animation-delay: 0.5s; }
.cards-container .archive-card:nth-child(6) { animation-delay: 0.6s; }

/* Interactive Button Effects */
.btn-interactive {
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.btn-interactive::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.btn-interactive:hover::before {
    left: 100%;
}

/* Floating Animation for Status Badges */
@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-3px);
    }
}

.status-badge {
    animation: float 3s ease-in-out infinite;
}

/* Card Content Reveal Animation */
.card-content-reveal {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
}

.archive-card:hover .card-content-reveal {
    max-height: 200px;
}

/* Gradient Border Animation */
@keyframes gradient-border {
    0%, 100% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
}

.gradient-border {
    background: linear-gradient(45deg, #6366f1, #8b5cf6, #06b6d4, #10b981);
    background-size: 300% 300%;
    animation: gradient-border 4s ease infinite;
    padding: 2px;
    border-radius: 12px;
}

.gradient-border-inner {
    background: white;
    border-radius: 10px;
    height: 100%;
    width: 100%;
}

/* Icon Rotation on Hover */
.icon-rotate {
    transition: transform 0.3s ease;
}

.archive-card:hover .icon-rotate {
    transform: rotate(360deg);
}

/* Text Highlight Animation */
@keyframes highlight {
    0% {
        background-size: 0% 100%;
    }
    100% {
        background-size: 100% 100%;
    }
}

.text-highlight {
    background: linear-gradient(120deg, rgba(99, 102, 241, 0.2) 0%, rgba(99, 102, 241, 0.2) 100%);
    background-repeat: no-repeat;
    background-size: 0% 100%;
    background-position: 0% 100%;
    transition: background-size 0.3s ease;
}

.archive-card:hover .text-highlight {
    animation: highlight 0.5s ease forwards;
}

/* Responsive Animations */
@media (max-width: 768px) {
    .archive-card {
        animation-duration: 0.4s;
    }
    
    .archive-card:hover {
        transform: translateY(-4px) scale(1.01);
    }
}

/* Accessibility - Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    .archive-card,
    .badge-animate,
    .btn-interactive,
    .status-badge,
    .icon-rotate {
        animation: none;
        transition: none;
    }
    
    .archive-card:hover {
        transform: none;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .shimmer-loading {
        background: linear-gradient(90deg, #374151 25%, #4b5563 50%, #374151 75%);
    }
    
    .gradient-border-inner {
        background: #1f2937;
    }
}
