/**
 * PKM Universe - Advanced Effects CSS
 * Custom cursor, animations, toasts, and more!
 */

/* ============================================
   CUSTOM CURSOR
   ============================================ */
.pkm-cursor {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 99999;
    pointer-events: none;
    mix-blend-mode: difference;
}

.cursor-dot {
    position: fixed;
    width: 8px;
    height: 8px;
    background: #fff;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.2s, height 0.2s, background 0.2s;
}

.cursor-ring {
    position: fixed;
    width: 40px;
    height: 40px;
    border: 2px solid rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.3s, height 0.3s, border-color 0.3s;
}

.cursor-hover .cursor-dot {
    width: 12px;
    height: 12px;
    background: #00d4ff;
}

.cursor-hover .cursor-ring {
    width: 60px;
    height: 60px;
    border-color: #00d4ff;
}

/* Hide default cursor on desktop */
@media (pointer: fine) {
    * {
        cursor: none !important;
    }
}

/* ============================================
   SCROLL ANIMATIONS
   ============================================ */
.animate-ready {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1), transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.animate-in {
    opacity: 1;
    transform: translateY(0);
}

/* Staggered animations */
.animate-in:nth-child(1) { transition-delay: 0s; }
.animate-in:nth-child(2) { transition-delay: 0.1s; }
.animate-in:nth-child(3) { transition-delay: 0.2s; }
.animate-in:nth-child(4) { transition-delay: 0.3s; }
.animate-in:nth-child(5) { transition-delay: 0.4s; }
.animate-in:nth-child(6) { transition-delay: 0.5s; }
.animate-in:nth-child(7) { transition-delay: 0.6s; }
.animate-in:nth-child(8) { transition-delay: 0.7s; }
.animate-in:nth-child(9) { transition-delay: 0.8s; }

/* ============================================
   RIPPLE EFFECT
   ============================================ */
.ripple-effect {
    position: absolute;
    width: 20px;
    height: 20px;
    background: rgba(255, 255, 255, 0.4);
    border-radius: 50%;
    transform: translate(-50%, -50%) scale(0);
    animation: ripple 0.6s ease-out;
    pointer-events: none;
}

@keyframes ripple {
    to {
        transform: translate(-50%, -50%) scale(20);
        opacity: 0;
    }
}

/* ============================================
   GLOW TRAIL
   ============================================ */
.glow-trail {
    position: fixed;
    width: 10px;
    height: 10px;
    background: radial-gradient(circle, rgba(0, 212, 255, 0.6) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
    transform: translate(-50%, -50%);
    transition: opacity 0.3s, transform 0.3s;
    z-index: 9998;
}

/* ============================================
   SCROLL PROGRESS BAR
   ============================================ */
.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    width: 0%;
    background: linear-gradient(90deg, #00d4ff, #a855f7, #ec4899, #ffd700);
    z-index: 100001;
    transition: width 0.1s;
    box-shadow: 0 0 10px rgba(0, 212, 255, 0.5);
}

/* ============================================
   FLOATING POKEMON
   ============================================ */
@keyframes floatPokemon {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    25% { transform: translateY(-30px) rotate(5deg); }
    50% { transform: translateY(-15px) rotate(-3deg); }
    75% { transform: translateY(-40px) rotate(3deg); }
}

.floating-pokemon-sprite {
    animation: floatPokemon 20s ease-in-out infinite;
}

/* ============================================
   TOAST NOTIFICATIONS
   ============================================ */
.pkm-toast {
    position: fixed;
    bottom: 30px;
    right: 30px;
    padding: 16px 24px;
    background: linear-gradient(135deg, rgba(13, 13, 26, 0.95), rgba(20, 20, 40, 0.95));
    border: 1px solid rgba(0, 212, 255, 0.3);
    border-radius: 12px;
    color: #fff;
    font-size: 0.95rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4), 0 0 30px rgba(0, 212, 255, 0.1);
    transform: translateX(120%);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 100002;
    backdrop-filter: blur(10px);
}

.pkm-toast.show {
    transform: translateX(0);
}

.pkm-toast-success {
    border-color: rgba(34, 197, 94, 0.5);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4), 0 0 30px rgba(34, 197, 94, 0.2);
}

.pkm-toast-error {
    border-color: rgba(239, 68, 68, 0.5);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4), 0 0 30px rgba(239, 68, 68, 0.2);
}

.toast-icon {
    font-size: 1.2rem;
}

/* ============================================
   RAINBOW MODE (Easter Egg)
   ============================================ */
.rainbow-mode {
    animation: rainbowBg 3s linear infinite;
}

.rainbow-mode * {
    animation: rainbowText 3s linear infinite;
}

@keyframes rainbowBg {
    0% { filter: hue-rotate(0deg); }
    100% { filter: hue-rotate(360deg); }
}

@keyframes rainbowText {
    0% { filter: hue-rotate(0deg); }
    100% { filter: hue-rotate(360deg); }
}

/* ============================================
   LOADING SCREEN
   ============================================ */
.pkm-loader {
    position: fixed;
    inset: 0;
    background: #030308;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 100003;
    transition: opacity 0.5s, visibility 0.5s;
}

.pkm-loader.loaded {
    opacity: 0;
    visibility: hidden;
}

.loader-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(0, 212, 255, 0.2);
    border-top-color: #00d4ff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.loader-text {
    margin-top: 20px;
    font-family: 'Orbitron', sans-serif;
    font-size: 1.2rem;
    color: #00d4ff;
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* ============================================
   3D CARD TILT
   ============================================ */
.tool-card,
.membership-card,
.featured-card,
.pkm-card {
    transform-style: preserve-3d;
    transition: transform 0.3s ease-out, box-shadow 0.3s;
}

.tool-card:hover,
.membership-card:hover,
.featured-card:hover,
.pkm-card:hover {
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.4), 0 0 60px rgba(0, 212, 255, 0.15);
}

/* ============================================
   GLITCH TEXT EFFECT
   ============================================ */
.glitch {
    position: relative;
}

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

.glitch::before {
    animation: glitch-1 0.3s infinite linear alternate-reverse;
    clip-path: polygon(0 0, 100% 0, 100% 35%, 0 35%);
    color: #ff00ff;
}

.glitch::after {
    animation: glitch-2 0.3s infinite linear alternate-reverse;
    clip-path: polygon(0 65%, 100% 65%, 100% 100%, 0 100%);
    color: #00ffff;
}

@keyframes glitch-1 {
    0% { transform: translate(0); }
    20% { transform: translate(-2px, 2px); }
    40% { transform: translate(2px, -2px); }
    60% { transform: translate(-1px, 1px); }
    80% { transform: translate(1px, -1px); }
    100% { transform: translate(0); }
}

@keyframes glitch-2 {
    0% { transform: translate(0); }
    20% { transform: translate(2px, -2px); }
    40% { transform: translate(-2px, 2px); }
    60% { transform: translate(1px, -1px); }
    80% { transform: translate(-1px, 1px); }
    100% { transform: translate(0); }
}

/* ============================================
   NEON TEXT
   ============================================ */
.neon-text {
    text-shadow:
        0 0 5px #fff,
        0 0 10px #fff,
        0 0 20px #00d4ff,
        0 0 40px #00d4ff,
        0 0 80px #00d4ff;
    animation: neonFlicker 2s infinite alternate;
}

@keyframes neonFlicker {
    0%, 19%, 21%, 23%, 25%, 54%, 56%, 100% {
        text-shadow:
            0 0 5px #fff,
            0 0 10px #fff,
            0 0 20px #00d4ff,
            0 0 40px #00d4ff,
            0 0 80px #00d4ff;
    }
    20%, 24%, 55% {
        text-shadow: none;
    }
}

/* ============================================
   HOVER GLOW BUTTONS
   ============================================ */
.glow-btn {
    position: relative;
    overflow: hidden;
}

.glow-btn::before {
    content: '';
    position: absolute;
    inset: -2px;
    background: linear-gradient(45deg, #00d4ff, #a855f7, #ec4899, #ffd700, #00d4ff);
    background-size: 400%;
    z-index: -1;
    filter: blur(5px);
    animation: glowRotate 3s linear infinite;
    opacity: 0;
    transition: opacity 0.3s;
}

.glow-btn:hover::before {
    opacity: 1;
}

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

/* ============================================
   MORPHING BLOB BACKGROUND
   ============================================ */
.blob {
    position: fixed;
    width: 500px;
    height: 500px;
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.1), rgba(168, 85, 247, 0.1));
    border-radius: 40% 60% 70% 30% / 40% 50% 60% 50%;
    animation: morph 15s ease-in-out infinite;
    z-index: -2;
    filter: blur(60px);
}

.blob-1 { top: -200px; left: -200px; }
.blob-2 { bottom: -200px; right: -200px; animation-delay: -7s; }

@keyframes morph {
    0%, 100% { border-radius: 40% 60% 70% 30% / 40% 50% 60% 50%; }
    25% { border-radius: 70% 30% 50% 50% / 30% 30% 70% 70%; }
    50% { border-radius: 50% 60% 30% 60% / 70% 40% 70% 30%; }
    75% { border-radius: 30% 40% 70% 70% / 50% 60% 30% 60%; }
}

/* ============================================
   PARTICLE BURST ON CLICK
   ============================================ */
.particle-burst {
    position: fixed;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    pointer-events: none;
    z-index: 99999;
}

/* ============================================
   MOBILE RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
    .pkm-cursor { display: none; }
    .glow-trail { display: none; }
    * { cursor: auto !important; }

    .pkm-toast {
        right: 15px;
        left: 15px;
        bottom: 15px;
    }
}
