/* Dark Haven - Special Effects & Components */

/* Strong glitch effect */
.strong-glitch {
    animation: strong-glitch-anim 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94) both infinite;
    color: var(--text-primary);
    background: var(--bg-primary);
}

@keyframes strong-glitch-anim {
    0% {
        transform: translate(0);
        opacity: 1;
        clip-path: inset(0 0 0 0);
    }

    10% {
        transform: translate(-5px, 3px);
        opacity: 0.8;
        clip-path: inset(10% 0 80% 0);
    }

    20% {
        transform: translate(5px, -3px);
        opacity: 1;
        clip-path: inset(80% 0 5% 0);
    }

    30% {
        transform: translate(-5px, 5px);
        opacity: 0.8;
        clip-path: inset(40% 0 30% 0);
    }

    40% {
        transform: translate(5px, -5px);
        opacity: 1;
        clip-path: inset(20% 0 60% 0);
    }

    50% {
        transform: translate(-3px, 2px);
        opacity: 0.6;
        clip-path: inset(60% 0 10% 0);
    }

    60% {
        transform: translate(3px, -2px);
        opacity: 1;
        clip-path: inset(10% 0 50% 0);
    }

    70% {
        transform: translate(-5px, 2px);
        opacity: 0.8;
        clip-path: inset(50% 0 20% 0);
    }

    80% {
        transform: translate(5px, -2px);
        opacity: 1;
        clip-path: inset(0 0 0 0);
    }

    90% {
        transform: translate(-2px, 2px);
        opacity: 0.7;
    }

    100% {
        transform: translate(0);
        opacity: 1;
        clip-path: inset(0 0 0 0);
    }
}

/* Glitch text animation */
.glitch-text {
    position: relative;
    animation: glitch-skew 4s infinite linear alternate-reverse;
}

.glitch-text::before,
.glitch-text::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.glitch-text::before {
    color: var(--text-primary);
    animation: glitch-anim-1 3s infinite linear alternate-reverse;
    clip-path: polygon(0 0, 100% 0, 100% 35%, 0 35%);
}

.glitch-text::after {
    color: var(--text-primary);
    animation: glitch-anim-2 2s infinite linear alternate-reverse;
    clip-path: polygon(0 65%, 100% 65%, 100% 100%, 0 100%);
}

@keyframes glitch-skew {

    0%,
    87%,
    100% {
        transform: skewX(0deg);
    }

    88% {
        transform: skewX(0.5deg);
    }

    89% {
        transform: skewX(-0.5deg);
    }

    90% {
        transform: skewX(0.3deg);
    }
}

@keyframes glitch-anim-1 {

    0%,
    85%,
    100% {
        transform: translateX(0);
        opacity: 1;
    }

    86% {
        transform: translateX(-3px);
        opacity: 0.8;
    }

    87% {
        transform: translateX(3px);
        opacity: 0.9;
    }

    88% {
        transform: translateX(-2px);
        opacity: 0.8;
    }
}

@keyframes glitch-anim-2 {

    0%,
    80%,
    100% {
        transform: translateX(0);
        opacity: 1;
    }

    81% {
        transform: translateX(3px);
        opacity: 0.8;
    }

    82% {
        transform: translateX(-3px);
        opacity: 0.9;
    }

    83% {
        transform: translateX(2px);
        opacity: 0.8;
    }
}

/* Modal Effects */
.modal-bg-effects {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.modal-stripe {
    position: absolute;
    width: 2px;
    height: 130%;
    background: linear-gradient(to bottom, transparent, rgba(255, 255, 255, 0.18), transparent);
    animation: stripeMove linear infinite;
    opacity: 0.4;
}

@keyframes stripeMove {
    0% {
        transform: translateY(-100%);
    }

    100% {
        transform: translateY(100%);
    }
}

/* Mega Menu */
.mega-menu-wrapper {
    position: relative;
    padding-bottom: 20px;
    margin-bottom: -20px;
    display: flex;
    align-items: center;
}

.mega-menu {
    position: absolute;
    top: 100%;
    left: -12px;
    min-width: 240px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(15px);
    transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1), transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.3s;
    z-index: 100;
    padding-top: 10px;
}

.mega-menu-wrapper:hover .mega-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.mega-menu-wrapper:hover i[data-lucide="chevron-down"] {
    transform: rotate(180deg);
}

.mega-menu-wrapper i[data-lucide="chevron-down"] {
    transition: transform 0.3s ease;
}

.mega-submenu {
    position: absolute;
    left: 100%;
    top: 0;
    min-width: 170px;
    opacity: 0;
    visibility: hidden;
    transform: translateX(-8px);
    transition: all 0.18s ease;
    z-index: 101;
}

.mega-menu-category:hover>.mega-submenu {
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
}

/* Mystery Box Game Styles */
.mystery-box-wrapper {
    position: relative;
    width: 200px;
    height: 200px;
    margin: 0 auto;
}

.mystery-box {
    width: 100%;
    height: 100%;
    position: relative;
    transform-style: preserve-3d;
    animation: box-rotate 15s linear infinite;
}

.mystery-box:hover {
    animation-duration: 3s;
}

.mystery-box:hover .box-face {
    box-shadow: 0 0 40px rgba(147, 51, 234, 0.6), inset 0 0 30px rgba(147, 51, 234, 0.3);
}

.box-face {
    position: absolute;
    width: 200px;
    height: 200px;
    border: 2px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    font-weight: bold;
    color: var(--text-primary);
    background: rgba(10, 10, 10, 0.9);
    backdrop-filter: blur(5px);
    transition: all 0.3s ease;
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.1), inset 0 0 20px rgba(255, 255, 255, 0.05);
}

html.light-theme .box-face {
    background: rgba(245, 245, 245, 0.9);
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.1), inset 0 0 20px rgba(0, 0, 0, 0.05);
}

.box-face.front {
    transform: translateZ(100px);
}

.box-face.back {
    transform: rotateY(180deg) translateZ(100px);
}

.box-face.right {
    transform: rotateY(90deg) translateZ(100px);
}

.box-face.left {
    transform: rotateY(-90deg) translateZ(100px);
}

.box-face.top {
    transform: rotateX(90deg) translateZ(100px);
}

.box-face.bottom {
    transform: rotateX(-90deg) translateZ(100px);
}

@keyframes box-rotate {
    0% {
        transform: rotateX(0deg) rotateY(0deg);
    }

    25% {
        transform: rotateX(20deg) rotateY(90deg);
    }

    50% {
        transform: rotateX(-20deg) rotateY(180deg);
    }

    75% {
        transform: rotateX(20deg) rotateY(270deg);
    }

    100% {
        transform: rotateX(0deg) rotateY(360deg);
    }
}

.game-title {
    font-size: 1.5rem;
    margin-top: 3rem;
    text-transform: uppercase;
    letter-spacing: 0.3em;
    animation: title-glow 2s ease-in-out infinite alternate;
    text-align: center;
}

@keyframes title-glow {
    0% {
        text-shadow: 0 0 10px rgba(147, 51, 234, 0.5), 0 0 20px rgba(147, 51, 234, 0.3);
    }

    100% {
        text-shadow: 0 0 20px rgba(147, 51, 234, 0.8), 0 0 40px rgba(147, 51, 234, 0.5);
    }
}

.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: var(--text-primary);
    border-radius: 50%;
    opacity: 0;
    animation: particle-float 4s ease-in-out infinite;
}

@keyframes particle-float {
    0% {
        opacity: 0;
        transform: translateY(0) scale(0);
    }

    50% {
        opacity: 0.8;
    }

    100% {
        opacity: 0;
        transform: translateY(-100px) scale(1.5);
    }
}

/* Payment Success Styles */
.success-glow {
    animation: pulse-glow 2s ease-in-out infinite;
}

@keyframes pulse-glow {

    0%,
    100% {
        box-shadow: 0 0 20px rgba(34, 197, 94, 0.3);
    }

    50% {
        box-shadow: 0 0 40px rgba(34, 197, 94, 0.6);
    }
}

.pending-pulse {
    animation: pending-pulse 1.5s ease-in-out infinite;
}

@keyframes pending-pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

/* Terminal Cursor Animation */
.terminal-cursor::after {
    content: '_';
    display: inline-block;
    animation: cursor-blink 1s step-end infinite;
    margin-left: 2px;
    color: var(--text-primary);
}

@keyframes cursor-blink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0;
    }
}
/* Shake Animation for Validation Errors */
.shake-anim {
    animation: shake 0.5s cubic-bezier(.36, .07, .19, .97) both;
}

@keyframes shake {
    10%, 90% { transform: translate3d(-1px, 0, 0); }
    20%, 80% { transform: translate3d(2px, 0, 0); }
    30%, 50%, 70% { transform: translate3d(-4px, 0, 0); }
    40%, 60% { transform: translate3d(4px, 0, 0); }
}
