/* =========================================
   NABANA - MOTION CSS
   Anime Pop / Modern Shonen Style
   ========================================= */

/* --- A) HERO SPEED LINES --- */
.anim-speedlines-overlay {
    position: absolute;
    inset: -50%;
    width: 200%;
    height: 200%;
    background-image: repeating-conic-gradient(
        from 0deg at 50% 50%,
        transparent 0deg,
        rgba(255, 255, 255, 0.08) 2deg,
        transparent 4deg
    );
    opacity: 0.1;
    pointer-events: none;
    z-index: 0;
    animation: speedlines-spin 15s linear infinite;
    /* Masking for subtle effect */
    mask-image: radial-gradient(circle at center, transparent 10%, black 80%);
    -webkit-mask-image: radial-gradient(circle at center, transparent 10%, black 80%);
}

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

/* --- C) CTA SHIMMER + SPEEDBURST --- */
.anim-shimmer {
    position: relative;
    overflow: hidden;
}

.anim-shimmer::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.4),
        transparent
    );
    transform: skewX(-20deg);
    transition: left 0.5s;
    pointer-events: none;
    z-index: 10;
}

.anim-shimmer:hover::after {
    animation: shimmer-sweep 0.6s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes shimmer-sweep {
    0% { left: -100%; }
    100% { left: 200%; }
}

/* Border Glow Pulse on Hover */
.anim-glow-border {
    transition: box-shadow 0.3s ease;
}
.anim-glow-border:hover {
    box-shadow: 0 0 20px rgba(55, 230, 255, 0.4);
}

/* SPEEDBURST (Micro Lines) */
.anim-speedburst-item {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 140%;
    height: 140%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: -1;
    background: radial-gradient(circle, transparent 30%, rgba(255, 255, 255, 0.8) 35%, transparent 70%);
    opacity: 0;
}

.anim-speedburst-active .anim-speedburst-item {
    animation: speedburst-pop 0.3s ease-out forwards;
}

@keyframes speedburst-pop {
    0% { transform: translate(-50%, -50%) scale(0.8); opacity: 0; }
    40% { opacity: 1; }
    100% { transform: translate(-50%, -50%) scale(1.4); opacity: 0; }
}

/* --- G) RARITY BADGES --- */
/* NEW: Slow Pulse */
[data-anim~="badge-pulse"] {
    animation: badge-pulse-glow 3s ease-in-out infinite;
}

@keyframes badge-pulse-glow {
    0%, 100% { box-shadow: 0 0 5px rgba(55, 230, 255, 0.2); }
    50% { box-shadow: 0 0 15px rgba(55, 230, 255, 0.6); }
}

/* RARE: Occasional Sparkle Flicker */
[data-anim~="badge-sparkle"] {
    animation: badge-flicker 6s steps(2, start) infinite;
}

@keyframes badge-flicker {
    0%, 90%, 100% { opacity: 1; filter: brightness(1); }
    92% { opacity: 0.8; filter: brightness(1.5); }
    94% { opacity: 1; filter: brightness(1); }
    96% { opacity: 0.9; filter: brightness(1.3); }
}

/* LIMITED: Breathing */
[data-anim~="badge-breathe"] {
    animation: badge-breathe 4s ease-in-out infinite;
    position: relative; /* For particles */
}

@keyframes badge-breathe {
    0%, 100% { transform: scale(1); filter: drop-shadow(0 0 2px rgba(255, 61, 141, 0.3)); }
    50% { transform: scale(1.05); filter: drop-shadow(0 0 8px rgba(255, 61, 141, 0.6)); }
}

/* --- H) LIMITED SPARKLE PARTICLES --- */
.anim-sparkle {
    position: absolute;
    width: 3px;
    height: 3px;
    background-color: white;
    border-radius: 50%;
    pointer-events: none;
    opacity: 0;
    box-shadow: 0 0 4px rgba(255, 255, 255, 0.8);
    z-index: 10;
}

@keyframes sparkle-float {
    0% { transform: translateY(0) scale(0.5); opacity: 0; }
    20% { opacity: 1; transform: translateY(-5px) scale(1); }
    100% { transform: translateY(-25px) scale(0); opacity: 0; }
}

/* --- I) IMPACT FRAME MICRO-FLASH --- */
.anim-impact-flash {
    animation: impact-flash-anim 0.2s ease-out forwards;
}

@keyframes impact-flash-anim {
    0% { filter: brightness(1); transform: scale(1); }
    50% { filter: brightness(3) contrast(1.5); transform: scale(1.02); }
    100% { filter: brightness(1); transform: scale(1); }
}

/* --- F) PRODUCT CARD SHINE --- */
.anim-card-shine {
    position: relative;
    overflow: hidden;
}
.anim-card-shine::before {
    content: '';
    position: absolute;
    inset: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        115deg, 
        transparent 40%, 
        rgba(255, 255, 255, 0.1) 45%, 
        rgba(255, 255, 255, 0.2) 50%, 
        rgba(255, 255, 255, 0.1) 55%, 
        transparent 60%
    );
    opacity: 0;
    transform: translateX(-100%) translateY(-100%);
    pointer-events: none;
    transition: transform 0.6s, opacity 0.6s;
    z-index: 20;
}

.anim-card-shine:hover::before {
    opacity: 1;
    transform: translateX(20%) translateY(20%);
    transition: transform 0.8s cubic-bezier(0.25, 1, 0.5, 1), opacity 0.3s;
}

/* --- J) NAV ICONS --- */
[data-anim~="nav-icon"] {
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), filter 0.3s;
    display: inline-block;
}
[data-anim~="nav-icon"]:hover {
    transform: scale(1.1);
    filter: drop-shadow(0 0 8px currentColor);
}

/* --- UTILITIES --- */
.will-change-transform {
    will-change: transform;
}

/* --- PREFERS REDUCED MOTION --- */
@media (prefers-reduced-motion: reduce) {
    .anim-speedlines-overlay,
    [data-anim~="badge-pulse"],
    [data-anim~="badge-sparkle"],
    [data-anim~="badge-breathe"],
    .anim-shimmer::after,
    .anim-impact-flash,
    .anim-speedburst-item,
    .anim-sparkle {
        animation: none !important;
        transition: none !important;
        opacity: 0 !important; /* Hide decorative elements */
        transform: none !important;
        display: none !important;
    }
    
    /* Exceptions where we want static visibility */
    [data-anim~="badge-pulse"],
    [data-anim~="badge-sparkle"],
    [data-anim~="badge-breathe"] {
        opacity: 1 !important;
        display: inline-block !important;
    }
    
    .anim-shimmer:hover::after {
        opacity: 0.1 !important; /* Just show static highlight */
        display: block !important;
        left: 0 !important;
        width: 100% !important;
        transform: none !important;
    }
}