/* ==========================================================================
   Vengeance UI — Animated Effects for RDM Anime
   Pure CSS animations inspired by vengenceui.com components
   Adapted for WordPress PHP theme (no React/Framer Motion needed)
   ========================================================================== */

/* ==========================================================================
   1. SPOTLIGHT NAVBAR — Cursor-tracking glow on header nav items
   ========================================================================== */

/* Spotlight glow that follows mouse on header */
#rdm-masthead.rdm-spotlight-active .rdm-nav-list > li > a {
    position: relative;
    isolation: isolate;
}

#rdm-masthead.rdm-spotlight-active .rdm-nav-list > li > a::before {
    content: '';
    position: absolute;
    inset: -8px;
    border-radius: 8px;
    background: radial-gradient(
        circle at var(--spot-x, 50%) var(--spot-y, 50%),
        rgba(255, 193, 7, 0.15) 0%,
        transparent 70%
    );
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    z-index: -1;
}

#rdm-masthead.rdm-spotlight-active .rdm-nav-list > li > a:hover::before {
    opacity: 1;
}

/* Header ambient glow line animation */
@keyframes headerGlowShift {
    0% { background-position: -200% center; }
    100% { background-position: 200% center; }
}

/* Header accent line — static gradient (animation handled by overrides-v2.css) */


/* ==========================================================================
   2. ANIMATED RAYS — Hero section dynamic light rays background
   ========================================================================== */

.v-vengeance-rays {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    z-index: 0;
    opacity: 0.6;
}

.v-vengeance-rays .ray {
    position: absolute;
    top: -10%;
    width: 2px;
    height: 120%;
    background: linear-gradient(
        180deg,
        transparent 0%,
        rgba(255, 193, 7, 0.4) 30%,
        rgba(124, 58, 237, 0.3) 60%,
        transparent 100%
    );
    transform-origin: top center;
    animation: rayPulse 3s ease-in-out infinite;
}

.v-vengeance-rays .ray:nth-child(1) { left: 10%; transform: rotate(-15deg); animation-delay: 0s; animation-duration: 3.5s; }
.v-vengeance-rays .ray:nth-child(2) { left: 25%; transform: rotate(-5deg); animation-delay: 0.5s; animation-duration: 4s; }
.v-vengeance-rays .ray:nth-child(3) { left: 40%; transform: rotate(2deg); animation-delay: 1s; animation-duration: 3s; }
.v-vengeance-rays .ray:nth-child(4) { left: 55%; transform: rotate(8deg); animation-delay: 0.3s; animation-duration: 4.5s; }
.v-vengeance-rays .ray:nth-child(5) { left: 70%; transform: rotate(12deg); animation-delay: 0.8s; animation-duration: 3.2s; }
.v-vengeance-rays .ray:nth-child(6) { left: 85%; transform: rotate(18deg); animation-delay: 1.2s; animation-duration: 3.8s; }

@keyframes rayPulse {
    0%, 100% { opacity: 0.2; transform: scaleY(1); }
    50% { opacity: 0.6; transform: scaleY(1.05); }
}

/* Diagonal sweeping ray */
.v-vengeance-rays .ray-sweep {
    position: absolute;
    top: 0;
    left: -50%;
    width: 200%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(255, 193, 7, 0.03) 45%,
        rgba(124, 58, 237, 0.05) 50%,
        rgba(255, 193, 7, 0.03) 55%,
        transparent 100%
    );
    animation: raySweep 8s ease-in-out infinite;
}

@keyframes raySweep {
    0% { transform: translateX(-30%) rotate(-5deg); }
    50% { transform: translateX(30%) rotate(5deg); }
    100% { transform: translateX(-30%) rotate(-5deg); }
}


/* ==========================================================================
   3. PERSPECTIVE GRID — 3D animated grid background
   ========================================================================== */

.v-perspective-grid {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    z-index: 0;
    perspective: 400px;
}

.v-perspective-grid-inner {
    position: absolute;
    bottom: -20%;
    left: -10%;
    right: -10%;
    height: 70%;
    background-image:
        linear-gradient(rgba(124, 58, 237, 0.12) 1px, transparent 1px),
        linear-gradient(90deg, rgba(124, 58, 237, 0.12) 1px, transparent 1px);
    background-size: 60px 60px;
    transform: rotateX(60deg);
    transform-origin: bottom center;
    animation: gridScroll 20s linear infinite;
    mask-image: linear-gradient(to top, rgba(0,0,0,0.6) 0%, transparent 80%);
    -webkit-mask-image: linear-gradient(to top, rgba(0,0,0,0.6) 0%, transparent 80%);
}

@keyframes gridScroll {
    0% { background-position: 0 0; }
    100% { background-position: 0 60px; }
}


/* ==========================================================================
   4. 3D CARD TILT — Glassmorphism + perspective tilt on hover
   ========================================================================== */

.v-tilt-card {
    position: relative;
    transform-style: preserve-3d;
    will-change: transform;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1),
                box-shadow 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.v-tilt-card .v-tilt-shine {
    position: absolute;
    inset: 0;
    border-radius: inherit;
    overflow: hidden;
    pointer-events: none;
    z-index: 2;
}

.v-tilt-card .v-tilt-shine::before {
    content: '';
    position: absolute;
    inset: -50%;
    background: radial-gradient(
        circle at var(--shine-x, 50%) var(--shine-y, 50%),
        rgba(255, 255, 255, 0.1) 0%,
        transparent 50%
    );
    opacity: 0;
    transition: opacity 0.4s ease;
}

.v-tilt-card:hover .v-tilt-shine::before {
    opacity: 1;
}

/* Glowing border on hover */
.v-tilt-card::after {
    content: '';
    position: absolute;
    inset: -1px;
    border-radius: inherit;
    background: linear-gradient(
        135deg,
        rgba(124, 58, 237, 0) 0%,
        rgba(124, 58, 237, 0.4) 50%,
        rgba(255, 193, 7, 0.3) 100%
    );
    opacity: 0;
    transition: opacity 0.4s ease;
    z-index: -1;
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask-composite: exclude;
    -webkit-mask-composite: xor;
    padding: 1px;
}

.v-tilt-card:hover::after {
    opacity: 1;
}


/* ==========================================================================
   5. ANIMATED BUTTONS — Shine sweep, neon glow, pulse ring
   ========================================================================== */

/* Shine sweep effect */
.v-btn-shine {
    position: relative;
    overflow: hidden;
}

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

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

/* Neon pulse ring */
.v-btn-neon {
    position: relative;
}

.v-btn-neon::after {
    content: '';
    position: absolute;
    inset: -3px;
    border-radius: inherit;
    border: 2px solid rgba(255, 193, 7, 0.4);
    opacity: 0;
    animation: neonPulse 2s ease-in-out infinite;
    pointer-events: none;
}

.v-btn-neon:hover::after {
    opacity: 1;
}

@keyframes neonPulse {
    0%, 100% { box-shadow: 0 0 5px rgba(255, 193, 7, 0.2), inset 0 0 5px rgba(255, 193, 7, 0.1); }
    50% { box-shadow: 0 0 20px rgba(255, 193, 7, 0.4), inset 0 0 10px rgba(255, 193, 7, 0.2); }
}

/* Magnetic hover lift */
.v-btn-magnetic {
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1),
                box-shadow 0.3s ease;
}

.v-btn-magnetic:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 8px 25px rgba(255, 193, 7, 0.3), 0 0 40px rgba(124, 58, 237, 0.2);
}

.v-btn-magnetic:active {
    transform: translateY(0) scale(0.98);
    transition-duration: 80ms;
}


/* ==========================================================================
   6. TEXT REVEAL — Blur-to-clear text animation on scroll
   ========================================================================== */

.v-text-reveal {
    opacity: 0;
    transform: translateY(30px);
    filter: blur(8px);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.8s cubic-bezier(0.16, 1, 0.3, 1),
                filter 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.v-text-reveal.v-revealed {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0);
}

/* Staggered children reveal */
.v-stagger-reveal > * {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.v-stagger-reveal.v-revealed > *:nth-child(1) { transition-delay: 0.05s; opacity: 1; transform: translateY(0); }
.v-stagger-reveal.v-revealed > *:nth-child(2) { transition-delay: 0.1s; opacity: 1; transform: translateY(0); }
.v-stagger-reveal.v-revealed > *:nth-child(3) { transition-delay: 0.15s; opacity: 1; transform: translateY(0); }
.v-stagger-reveal.v-revealed > *:nth-child(4) { transition-delay: 0.2s; opacity: 1; transform: translateY(0); }
.v-stagger-reveal.v-revealed > *:nth-child(5) { transition-delay: 0.25s; opacity: 1; transform: translateY(0); }
.v-stagger-reveal.v-revealed > *:nth-child(6) { transition-delay: 0.3s; opacity: 1; transform: translateY(0); }
.v-stagger-reveal.v-revealed > *:nth-child(7) { transition-delay: 0.35s; opacity: 1; transform: translateY(0); }
.v-stagger-reveal.v-revealed > *:nth-child(8) { transition-delay: 0.4s; opacity: 1; transform: translateY(0); }

/* Gradient text reveal */
.v-gradient-text-reveal {
    background: linear-gradient(135deg, #fff 0%, #ffc107 50%, #7c3aed 100%);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: gradientShift 4s ease infinite;
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}


/* ==========================================================================
   7. MARQUEE TICKER — Infinite scrolling anime updates
   ========================================================================== */

.v-marquee-wrap {
    overflow: hidden;
    position: relative;
    padding: 12px 0;
    background: linear-gradient(90deg, var(--color-bg) 0%, transparent 5%, transparent 95%, var(--color-bg) 100%);
}

.v-marquee-track {
    display: flex;
    gap: 32px;
    animation: marqueeScroll 30s linear infinite;
    width: max-content;
}

.v-marquee-track:hover {
    animation-play-state: paused;
}

.v-marquee-item {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 193, 7, 0.1);
    border-radius: 999px;
    font-size: 0.85rem;
    color: var(--color-text-secondary);
    white-space: nowrap;
    transition: all 0.3s ease;
}

.v-marquee-item:hover {
    background: rgba(255, 193, 7, 0.08);
    border-color: rgba(255, 193, 7, 0.3);
    color: var(--color-primary);
}

.v-marquee-item .v-marquee-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #22c55e;
    animation: dotPulse 1.5s ease-in-out infinite;
}

.v-marquee-item .v-marquee-dot.new {
    background: #ef4444;
}

@keyframes marqueeScroll {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

@keyframes dotPulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(0.7); }
}


/* ==========================================================================
   8. SKELETON LOADERS — Animated placeholder loading states
   ========================================================================== */

.v-skeleton {
    position: relative;
    overflow: hidden;
    background: var(--color-bg-elevated);
    border-radius: var(--radius-md);
}

.v-skeleton::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(255, 193, 7, 0.04) 20%,
        rgba(124, 58, 237, 0.06) 50%,
        rgba(255, 193, 7, 0.04) 80%,
        transparent 100%
    );
    animation: skeletonShimmer 1.8s ease-in-out infinite;
}

@keyframes skeletonShimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.v-skeleton-card {
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.v-skeleton-card .v-skeleton-poster {
    aspect-ratio: 2/3;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.v-skeleton-card .v-skeleton-text {
    height: 14px;
    margin: 12px;
    border-radius: 4px;
}

.v-skeleton-card .v-skeleton-text-short {
    width: 60%;
    height: 10px;
    margin: 0 12px 12px;
    border-radius: 4px;
}


/* ==========================================================================
   9. FOOTER AMBIENT — Animated glow particles in footer
   ========================================================================== */

.v-footer-ambient {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
}

.v-footer-particle {
    position: absolute;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    opacity: 0;
    animation: particleFloat 6s ease-in-out infinite;
}

.v-footer-particle:nth-child(1) { left: 10%; bottom: 20%; background: rgba(255, 193, 7, 0.4); animation-delay: 0s; animation-duration: 5s; }
.v-footer-particle:nth-child(2) { left: 30%; bottom: 40%; background: rgba(124, 58, 237, 0.4); animation-delay: 1s; animation-duration: 7s; }
.v-footer-particle:nth-child(3) { left: 50%; bottom: 30%; background: rgba(236, 72, 153, 0.3); animation-delay: 2s; animation-duration: 6s; }
.v-footer-particle:nth-child(4) { left: 70%; bottom: 50%; background: rgba(255, 193, 7, 0.3); animation-delay: 0.5s; animation-duration: 8s; }
.v-footer-particle:nth-child(5) { left: 90%; bottom: 25%; background: rgba(124, 58, 237, 0.3); animation-delay: 1.5s; animation-duration: 5.5s; }
.v-footer-particle:nth-child(6) { left: 20%; bottom: 60%; background: rgba(167, 139, 250, 0.3); animation-delay: 3s; animation-duration: 7.5s; }
.v-footer-particle:nth-child(7) { left: 60%; bottom: 15%; background: rgba(255, 193, 7, 0.25); animation-delay: 2.5s; animation-duration: 6.5s; }
.v-footer-particle:nth-child(8) { left: 80%; bottom: 45%; background: rgba(124, 58, 237, 0.25); animation-delay: 0.8s; animation-duration: 5.8s; }

@keyframes particleFloat {
    0%, 100% { opacity: 0; transform: translateY(0) scale(0.5); }
    20% { opacity: 0.6; }
    50% { opacity: 0.8; transform: translateY(-40px) scale(1); }
    80% { opacity: 0.4; }
}


/* ==========================================================================
   10. FLOATING ORB — Ambient background orbs
   ========================================================================== */

.v-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.15;
    pointer-events: none;
    animation: orbFloat 12s ease-in-out infinite;
}

.v-orb-gold {
    background: radial-gradient(circle, rgba(255, 193, 7, 0.5), transparent 70%);
}

.v-orb-purple {
    background: radial-gradient(circle, rgba(124, 58, 237, 0.5), transparent 70%);
}

.v-orb-pink {
    background: radial-gradient(circle, rgba(236, 72, 153, 0.4), transparent 70%);
}

@keyframes orbFloat {
    0%, 100% { transform: translate(0, 0) scale(1); }
    25% { transform: translate(20px, -30px) scale(1.1); }
    50% { transform: translate(-15px, 15px) scale(0.95); }
    75% { transform: translate(25px, 10px) scale(1.05); }
}


/* ==========================================================================
   11. HERO ENHANCEMENTS — Animated hero section
   ========================================================================== */

/* Hero content entrance animation */
.hero-content.v-hero-animated {
    animation: heroSlideUp 1s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes heroSlideUp {
    0% { opacity: 0; transform: translateY(40px); }
    100% { opacity: 1; transform: translateY(0); }
}

/* Hero poster glow animation */
.hero-poster.v-poster-glow {
    position: relative;
}

.hero-poster.v-poster-glow::after {
    content: '';
    position: absolute;
    inset: -20px;
    border-radius: 20px;
    background: radial-gradient(ellipse, rgba(124, 58, 237, 0.25), transparent 70%);
    animation: posterGlow 4s ease-in-out infinite alternate;
    z-index: -1;
    filter: blur(20px);
}

@keyframes posterGlow {
    0% { opacity: 0.4; transform: scale(0.95); }
    100% { opacity: 0.8; transform: scale(1.05); }
}


/* ==========================================================================
   12. SECTION DIVIDER — Animated gradient line
   ========================================================================== */

.v-section-divider {
    height: 1px;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 193, 7, 0.3),
        rgba(124, 58, 237, 0.4),
        rgba(236, 72, 153, 0.3),
        transparent
    );
    background-size: 200% 100%;
    animation: dividerShift 3s linear infinite;
    margin: 24px 0;
}

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


/* ==========================================================================
   13. SCROLL PROGRESS BAR — Top of page reading progress
   ========================================================================== */

.v-scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    background: linear-gradient(90deg, #BF953F, #FCF6BA, #7c3aed, #ec4899);
    background-size: 300% 100%;
    animation: progressGradient 3s ease infinite;
    z-index: 9999;
    transition: width 0.1s linear;
    box-shadow: 0 0 10px rgba(255, 193, 7, 0.5);
}

@keyframes progressGradient {
    0% { background-position: 0% center; }
    50% { background-position: 100% center; }
    100% { background-position: 0% center; }
}


/* ==========================================================================
   14. GLASSMORPHISM CARDS — Enhanced glass effect
   ========================================================================== */

.v-glass-card {
    background: rgba(19, 19, 31, 0.7);
    backdrop-filter: blur(16px) saturate(180%);
    -webkit-backdrop-filter: blur(16px) saturate(180%);
    border: 1px solid rgba(255, 193, 7, 0.1);
    border-radius: var(--radius-lg);
    position: relative;
    overflow: hidden;
}

.v-glass-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
}


/* ==========================================================================
   15. PAGE TRANSITION — Smooth page load animation
   ========================================================================== */

.v-page-enter {
    animation: pageEnter 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes pageEnter {
    0% { opacity: 0; transform: translateY(20px); }
    100% { opacity: 1; transform: translateY(0); }
}


/* ==========================================================================
   16. TOOLTIP — Animated floating tooltip
   ========================================================================== */

.v-tooltip-wrap {
    position: relative;
}

.v-tooltip {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%) translateY(4px);
    padding: 6px 12px;
    background: rgba(19, 19, 31, 0.95);
    border: 1px solid rgba(255, 193, 7, 0.2);
    border-radius: 6px;
    font-size: 0.75rem;
    color: var(--color-text);
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
    backdrop-filter: blur(8px);
    z-index: 100;
}

.v-tooltip-wrap:hover .v-tooltip {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}


/* ==========================================================================
   17. COUNTER ANIMATION — Animated number counters
   ========================================================================== */

.v-counter {
    font-variant-numeric: tabular-nums;
    font-feature-settings: "tnum";
}


/* ==========================================================================
   18. REDUCED MOTION — Respect user preferences
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
    .v-vengeance-rays,
    .v-perspective-grid-inner,
    .v-marquee-track,
    .v-footer-particle,
    .v-orb,
    .v-scroll-progress,
    .v-section-divider,
    .v-btn-neon::after,
    .v-gradient-text-reveal,
    .v-btn-magnetic,
    .v-tilt-card,
    .v-text-reveal,
    .v-stagger-reveal > *,
    .v-skeleton::after {
        animation: none !important;
        transition-duration: 0.01ms !important;
    }

    .v-text-reveal { opacity: 1; transform: none; filter: none; }
    .v-stagger-reveal > * { opacity: 1; transform: none; }
    .v-btn-shine::before { display: none; }
}


/* ==========================================================================
   19. RESPONSIVE — Mobile adjustments
   ========================================================================== */

@media (max-width: 768px) {
    .v-vengeance-rays { opacity: 0.3; }
    .v-perspective-grid { display: none; }
    .v-marquee-item { font-size: 0.78rem; padding: 6px 12px; }
    .v-footer-particle { width: 3px; height: 3px; }
    .v-orb { filter: blur(60px); opacity: 0.1; }
}

@media (max-width: 480px) {
    .v-vengeance-rays { display: none; }
    .v-marquee-track { gap: 16px; }
}

/* Section titles — always visible, override v-text-reveal */
.tk-section-header.v-text-reveal {
    opacity: 1 !important;
    transform: none !important;
    filter: none !important;
}
.tk-section-title {
    opacity: 1 !important;
    transform: none !important;
    filter: none !important;
    color: var(--rdm-gold) !important;
    background: none !important;
    -webkit-background-clip: unset !important;
    -webkit-text-fill-color: var(--rdm-gold) !important;
    display: block !important;
    font-weight: 800 !important;
}
