/* ─── 1. GLOBAL SCROLL & MICRO ANIMATIONS ─── */
html {
    scroll-behavior: smooth;
}

.fade-in-up {
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94), transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.fade-in-up.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ─── 2. CARD INTERACTIONS ─── */
.movie-card, .trending-hero-card, .trending-small-card, .moment-card, .recently-watched-item {
    transition: transform 0.25s cubic-bezier(0.25, 0.46, 0.45, 0.94), box-shadow 0.25s ease-out !important;
    will-change: transform;
}

.movie-card:hover, .trending-hero-card:hover, .trending-small-card:hover, .moment-card:hover {
    transform: scale(1.03) translateY(-4px) !important;
    box-shadow: 0 12px 30px rgba(124, 77, 255, 0.15) !important;
}

.movie-poster, .tsc-poster, .moment-posters img {
    transition: transform 0.3s ease-out !important;
}

.movie-card:hover .movie-poster, .trending-small-card:hover .tsc-poster, .moment-card:hover .moment-posters img {
    transform: scale(1.05) !important;
}

/* Click press animation via JS class */
.card-pressed {
    transform: scale(0.95) !important;
    transition: transform 0.1s ease-out !important;
}

/* ─── 3. AVATAR PRESENCE ─── */
.story-user-av, .thc-avatars img, .tsc-avatars img, .moment-header img {
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease !important;
}
.story-item:hover .story-user-av, .trending-hero-card:hover .thc-avatars img, .trending-small-card:hover .tsc-avatars img, .moment-card:hover .moment-header img {
    transform: scale(1.15) !important;
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.2) !important;
    border-color: #a78bfa !important;
    z-index: 10;
}

/* ─── 4. HOT IN YOUR CIRCLE HERO ─── */
@keyframes shimmerLoad {
    0% { filter: brightness(1) saturate(1); }
    50% { filter: brightness(1.2) saturate(1.1); }
    100% { filter: brightness(1) saturate(1); }
}
.trending-hero-card, .trending-small-card {
    animation: shimmerLoad 1.5s ease-out forwards;
}

@keyframes float {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-3px); }
    100% { transform: translateY(0px); }
}
.thc-avatars, .tsc-avatars {
    animation: float 4s ease-in-out infinite;
}

/* ─── 5. CIRCLE MOMENTS FEEDBACK ─── */
@keyframes softBounce {
    0% { opacity: 0; transform: translateY(20px); }
    60% { opacity: 1; transform: translateY(-4px); }
    100% { opacity: 1; transform: translateY(0); }
}
.moment-card {
    animation: softBounce 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) both !important;
}
.moment-card:nth-child(1) { animation-delay: 0.1s !important; }
.moment-card:nth-child(2) { animation-delay: 0.2s !important; }
.moment-card:nth-child(3) { animation-delay: 0.3s !important; }
.moment-card:nth-child(4) { animation-delay: 0.4s !important; }

@keyframes slideInPoster {
    0% { opacity: 0; transform: translateX(-15px) scale(0.9); }
    100% { opacity: 1; transform: translateX(0) scale(1); }
}
.moment-posters img {
    animation: slideInPoster 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) both;
}
.moment-posters img:nth-child(1) { animation-delay: 0.2s; }
.moment-posters img:nth-child(2) { animation-delay: 0.3s; }
.moment-posters img:nth-child(3) { animation-delay: 0.4s; }

/* ─── 6. SEARCH EXPERIENCE ─── */
.search-overlay {
    opacity: 0;
    transition: opacity 0.3s ease, backdrop-filter 0.3s ease;
    backdrop-filter: blur(0px);
}
.search-overlay.active {
    opacity: 1;
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
}

@keyframes searchScaleFade {
    0% { opacity: 0; transform: translateY(-10px) scale(0.98); }
    100% { opacity: 1; transform: translateY(0) scale(1); }
}
.search-overlay-header {
    animation: searchScaleFade 0.3s ease-out forwards;
}
.search-results-section {
    animation: searchScaleFade 0.3s ease-out 0.1s both;
}

/* Loading Skeletons for Search */
.search-skeleton-item {
    height: 60px; width: 100%; border-radius: 8px; margin-bottom: 12px;
    background: linear-gradient(90deg, rgba(255,255,255,0.03) 25%, rgba(255,255,255,0.08) 50%, rgba(255,255,255,0.03) 75%);
    background-size: 200% 100%;
    animation: searchShimmer 1.5s infinite linear;
}
@keyframes searchShimmer { 
    0% { background-position: -200% 0; } 
    100% { background-position: 200% 0; } 
}

/* ─── 7. BUTTON FEEDBACK ─── */
button, .btn {
    transition: transform 0.15s cubic-bezier(0.25, 0.46, 0.45, 0.94), filter 0.15s ease !important;
}
button:hover, .btn:hover {
    transform: translateY(-2px);
    filter: brightness(1.15);
}
button:active, .btn:active {
    transform: scale(0.95) translateY(0) !important;
}

/* ─── 8. EMPTY STATES DELIGHT ─── */
@keyframes floatEmpty {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}
.circle-recs-empty i {
    animation: floatEmpty 3s ease-in-out infinite;
    color: #a78bfa;
}

/* ─── MOBILE OPTIMIZATION ─── */
@media (max-width: 768px) {
    /* Reduce intensive animations on mobile */
    .movie-card:hover, .trending-hero-card:hover, .trending-small-card:hover, .moment-card:hover {
        transform: scale(1.01) !important;
        box-shadow: none !important;
    }
    .moment-card, .moment-posters img {
        animation: homeFadeIn 0.4s ease both !important;
    }
    button:hover, .btn:hover { transform: none; }
    .fade-in-up { transform: translateY(0); opacity: 1; transition: none; }
}
