/* 
 * Dream Gallery Animations
 * Card entrance animations and interactive hover states
 */

/* Entrance animation keyframes */
@keyframes cardFadeSlideUp {
    from {
        opacity: 0;
        transform: translateY(24px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes cardScaleIn {
    from {
        opacity: 0;
        transform: scale(0.96);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes cardGlowPulse {
    0%, 100% {
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3), 0 0 0 rgba(59, 130, 246, 0);
    }
    50% {
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4), 0 0 20px rgba(59, 130, 246, 0.15);
    }
}

/* Base card entrance - animate on load */
.dream-card {
    /* Existing styles preserved, adding animation properties */
    animation: cardFadeSlideUp 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
    animation-fill-mode: backwards;
}

/* Staggered delay based on card index - applied via JS */
/* .dream-card[data-index="0"] { animation-delay: 0ms; } */
/* .dream-card[data-index="1"] { animation-delay: 80ms; } */
/* .dream-card[data-index="2"] { animation-delay: 160ms; } */
/* etc. */

/* Enhanced hover effects */
.dream-card {
    transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1),
                box-shadow 0.25s cubic-bezier(0.22, 1, 0.36, 1),
                border-color 0.2s ease,
                background 0.2s ease,
                filter 0.2s ease;
}

.dream-card:hover {
    transform: translateY(-6px) scale(1.01);
    box-shadow: 
        0 16px 32px rgba(0, 0, 0, 0.45),
        0 0 24px rgba(6, 182, 212, 0.12),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
    border-color: rgba(6, 182, 212, 0.5);
    background: rgba(30, 58, 138, 0.3);
}

.dream-card:active {
    transform: translateY(-2px) scale(0.99);
    transition-duration: 0.1s;
}

/* Card image enhancements on hover */
.dream-card-image {
    transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1),
                filter 0.25s ease;
}

.dream-card:hover .dream-card-image {
    transform: scale(1.05);
    filter: brightness(1.08);
}

.dream-card-image img.loaded {
    transition: opacity 0.4s ease, transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.dream-card:hover .dream-card-image img.loaded {
    transform: scale(1.05);
}

/* Play button specifically - enhance on card hover */
.dream-card:hover .card-play-btn {
    transform: scale(1.15);
    box-shadow: 0 4px 16px rgba(6, 182, 212, 0.6);
}

/* Card content text enhancement */
.dream-card-content {
    transition: color 0.2s ease, transform 0.2s ease;
}

.dream-card:hover .dream-card-title {
    color: var(--nocturne-cyan);
}

.dream-card-title {
    transition: color 0.2s ease;
}

/* Meta info subtle shift on hover */
.dream-card:hover .dream-card-meta {
    color: var(--text-primary);
}

/* Motifs/Tags enhanced hover */
.night-motifs {
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.dream-card:hover .night-motifs {
    transform: translateX(4px);
    opacity: 1;
}

/* Reduced motion preference */
@media (prefers-reduced-motion: reduce) {
    .dream-card {
        animation: none;
        transition: none;
    }
    
    .dream-card:hover {
        transform: translateY(-4px);
    }
    
    .dream-card:hover .dream-card-image,
    .dream-card:hover .dream-card-image img.loaded {
        transform: none;
        filter: none;
    }
}

/* Mobile optimizations */
@media (max-width: 768px) {
    .dream-card {
        animation: cardFadeSlideUp 0.4s cubic-bezier(0.22, 1, 0.36, 1) both;
    }
    
    .dream-card:hover {
        transform: translateY(-3px) scale(1.005);
        box-shadow: 0 8px 16px rgba(0, 0, 0, 0.35);
    }
    
    .dream-card:active {
        transform: translateY(-1px) scale(0.995);
    }
}

/* Focus states for accessibility */
.dream-card:focus-visible {
    outline: 2px solid var(--nocturne-cyan);
    outline-offset: 2px;
}

/* Card appearing class for dynamic loading */
.dream-card.appearing {
    animation: cardScaleIn 0.4s cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* Loading skeleton shimmer effect */
.dream-card.loading {
    animation: cardShimmer 1.5s ease-in-out infinite;
}

@keyframes cardShimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}