/**
 * PKM Universe - Ultra Effects CSS
 * Advanced visual effects and animations
 */

/* ============================================
   SPOTLIGHT/FLASHLIGHT EFFECT
   ============================================ */
.spotlight-effect {
    position: fixed;
    width: 400px;
    height: 400px;
    pointer-events: none;
    z-index: 99990;
    transform: translate(-50%, -50%);
    opacity: 0;
    transition: opacity 0.3s;
}

.spotlight-effect.active {
    opacity: 1;
}

.spotlight-effect.disabled {
    display: none;
}

.spotlight-gradient {
    width: 100%;
    height: 100%;
    background: radial-gradient(circle,
        rgba(0, 212, 255, 0.15) 0%,
        rgba(168, 85, 247, 0.1) 30%,
        transparent 70%
    );
    border-radius: 50%;
    filter: blur(30px);
}

/* ============================================
   NOISE/GRAIN TEXTURE OVERLAY
   ============================================ */
.noise-overlay {
    position: fixed;
    inset: 0;
    z-index: 99989;
    pointer-events: none;
    opacity: 0.03;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
    background-repeat: repeat;
    animation: noiseMove 0.5s steps(10) infinite;
}

@keyframes noiseMove {
    0%, 100% { transform: translate(0, 0); }
    10% { transform: translate(-1%, -1%); }
    20% { transform: translate(1%, 1%); }
    30% { transform: translate(-1%, 1%); }
    40% { transform: translate(1%, -1%); }
    50% { transform: translate(-1%, 0%); }
    60% { transform: translate(1%, 0%); }
    70% { transform: translate(0%, 1%); }
    80% { transform: translate(0%, -1%); }
    90% { transform: translate(1%, 1%); }
}

/* ============================================
   AURORA/NORTHERN LIGHTS BACKGROUND
   ============================================ */
.aurora-bg {
    position: fixed;
    inset: 0;
    z-index: -10;
    overflow: hidden;
    pointer-events: none;
}

.aurora-wave {
    position: absolute;
    width: 200%;
    height: 50%;
    left: -50%;
    opacity: 0.3;
    filter: blur(100px);
    animation: auroraFlow 15s ease-in-out infinite;
}

.aurora-wave-1 {
    top: 0;
    background: linear-gradient(90deg,
        transparent 0%,
        rgba(0, 212, 255, 0.4) 25%,
        rgba(168, 85, 247, 0.4) 50%,
        rgba(0, 212, 255, 0.4) 75%,
        transparent 100%
    );
    animation-delay: 0s;
}

.aurora-wave-2 {
    top: 20%;
    background: linear-gradient(90deg,
        transparent 0%,
        rgba(168, 85, 247, 0.3) 30%,
        rgba(236, 72, 153, 0.3) 60%,
        transparent 100%
    );
    animation-delay: -5s;
    animation-duration: 20s;
}

.aurora-wave-3 {
    top: 40%;
    background: linear-gradient(90deg,
        transparent 0%,
        rgba(34, 197, 94, 0.2) 40%,
        rgba(0, 212, 255, 0.2) 70%,
        transparent 100%
    );
    animation-delay: -10s;
    animation-duration: 25s;
}

@keyframes auroraFlow {
    0%, 100% {
        transform: translateX(-25%) skewX(-5deg);
    }
    50% {
        transform: translateX(25%) skewX(5deg);
    }
}

/* ============================================
   NEON GLOW TEXT
   ============================================ */
.neon-glow {
    animation: neonPulse 2s ease-in-out infinite alternate;
}

@keyframes neonPulse {
    0% {
        text-shadow:
            0 0 5px currentColor,
            0 0 10px currentColor,
            0 0 20px var(--primary),
            0 0 40px var(--primary);
        filter: brightness(1);
    }
    100% {
        text-shadow:
            0 0 10px currentColor,
            0 0 20px currentColor,
            0 0 40px var(--primary),
            0 0 80px var(--primary);
        filter: brightness(1.2);
    }
}

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

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

.glitch-text.glitching::before {
    opacity: 0.8;
    color: #ff00ff;
    animation: glitch1 0.2s infinite;
    clip-path: polygon(0 0, 100% 0, 100% 45%, 0 45%);
}

.glitch-text.glitching::after {
    opacity: 0.8;
    color: #00ffff;
    animation: glitch2 0.2s infinite;
    clip-path: polygon(0 55%, 100% 55%, 100% 100%, 0 100%);
}

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

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

/* Text Scramble */
.scramble-char {
    color: var(--primary);
    opacity: 0.7;
}

/* ============================================
   THEME TOGGLE BUTTON
   ============================================ */
.theme-toggle {
    position: fixed;
    top: 100px;
    right: 20px;
    width: 50px;
    height: 50px;
    background: rgba(13, 13, 26, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10001;
    transition: all 0.3s;
    backdrop-filter: blur(10px);
}

.theme-toggle:hover {
    background: rgba(0, 212, 255, 0.2);
    border-color: var(--primary);
    transform: rotate(180deg);
}

.theme-toggle svg {
    width: 24px;
    height: 24px;
    stroke: var(--primary);
    position: absolute;
    transition: opacity 0.3s, transform 0.3s;
}

.theme-toggle .moon-icon {
    opacity: 0;
    transform: rotate(-90deg);
}

.light-mode .theme-toggle .sun-icon {
    opacity: 0;
    transform: rotate(90deg);
}

.light-mode .theme-toggle .moon-icon {
    opacity: 1;
    transform: rotate(0);
}

/* Light Mode Styles */
.light-mode {
    --bg-dark: #f0f4f8;
    --bg-card: rgba(255, 255, 255, 0.9);
    --text: #1a1a2e;
    --text-muted: #4a5568;
}

.light-mode body {
    background: linear-gradient(135deg, #f0f4f8 0%, #e2e8f0 100%);
}

.light-mode .mesh-bg,
.light-mode .aurora-bg {
    opacity: 0.5;
}

.light-mode .holo-card,
.light-mode .stats-container,
.light-mode .faq-item {
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
}

/* ============================================
   SOUND TOGGLE BUTTON
   ============================================ */
.sound-toggle {
    position: fixed;
    top: 160px;
    right: 20px;
    width: 50px;
    height: 50px;
    background: rgba(13, 13, 26, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10001;
    transition: all 0.3s;
    backdrop-filter: blur(10px);
}

.sound-toggle:hover {
    background: rgba(0, 212, 255, 0.2);
    border-color: var(--primary);
}

.sound-toggle svg {
    width: 24px;
    height: 24px;
    stroke: var(--primary);
    position: absolute;
    transition: opacity 0.3s;
}

.sound-toggle .sound-off {
    opacity: 0;
}

.sound-toggle.muted .sound-on {
    opacity: 0;
}

.sound-toggle.muted .sound-off {
    opacity: 1;
    stroke: #ef4444;
}

/* ============================================
   CONFETTI
   ============================================ */
.confetti-piece {
    position: fixed;
    width: 10px;
    height: 10px;
    pointer-events: none;
    z-index: 100010;
    animation: confettiFall 1.5s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
    animation-delay: var(--delay);
}

@keyframes confettiFall {
    0% {
        transform: translate(0, 0) rotate(0deg) scale(1);
        opacity: 1;
    }
    100% {
        transform: translate(
            calc(cos(var(--angle)) * var(--distance)),
            calc(sin(var(--angle)) * var(--distance) + 200px)
        ) rotate(720deg) scale(0);
        opacity: 0;
    }
}

/* ============================================
   EASTER EGG EFFECTS
   ============================================ */
.rainbow-mode {
    animation: rainbowHue 2s linear infinite;
}

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

.falling-pokemon {
    position: fixed;
    top: -50px;
    font-size: 30px;
    z-index: 100020;
    animation: pokemonFall 3s linear forwards;
    pointer-events: none;
}

@keyframes pokemonFall {
    0% {
        transform: translateY(0) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(110vh) rotate(720deg);
        opacity: 0;
    }
}

.easter-egg-message {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.95), rgba(168, 85, 247, 0.95));
    padding: 40px 60px;
    border-radius: 20px;
    font-family: 'Orbitron', sans-serif;
    font-size: 2rem;
    font-weight: 800;
    text-align: center;
    z-index: 100030;
    animation: easterEggPop 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

@keyframes easterEggPop {
    0% { transform: translate(-50%, -50%) scale(0); }
    100% { transform: translate(-50%, -50%) scale(1); }
}

/* ============================================
   ANNOUNCEMENTS BAR
   ============================================ */
.announcements-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 40px;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    z-index: 100005;
    overflow: hidden;
    display: flex;
    align-items: center;
    transition: transform 0.3s;
}

.announcements-bar.hidden {
    transform: translateY(-100%);
}

.announcements-track {
    display: flex;
    animation: marquee 30s linear infinite;
    white-space: nowrap;
}

.announcement-item {
    padding: 0 50px;
    font-size: 0.9rem;
    font-weight: 600;
    color: white;
}

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

.announcements-close {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s;
}

.announcements-close:hover {
    background: rgba(255, 255, 255, 0.4);
}

/* ============================================
   LIVE CHAT BUBBLE
   ============================================ */
.live-chat-bubble {
    position: fixed;
    bottom: 180px;
    right: 30px;
    z-index: 10002;
}

.chat-bubble-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 8px 30px rgba(0, 212, 255, 0.4);
    transition: all 0.3s;
    position: relative;
}

.chat-bubble-icon:hover {
    transform: scale(1.1);
    box-shadow: 0 12px 40px rgba(0, 212, 255, 0.5);
}

.chat-bubble-icon svg {
    width: 28px;
    height: 28px;
    stroke: white;
}

.chat-notification {
    position: absolute;
    top: -5px;
    right: -5px;
    width: 22px;
    height: 22px;
    background: #ef4444;
    border-radius: 50%;
    font-size: 12px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: notificationPulse 2s infinite;
}

@keyframes notificationPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.chat-bubble-expanded {
    position: absolute;
    bottom: 70px;
    right: 0;
    width: 320px;
    background: rgba(13, 13, 26, 0.98);
    border: 1px solid rgba(0, 212, 255, 0.3);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px) scale(0.9);
    transition: all 0.3s cubic-bezier(0.23, 1, 0.32, 1);
    backdrop-filter: blur(20px);
}

.live-chat-bubble.expanded .chat-bubble-expanded {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.live-chat-bubble.expanded .chat-bubble-icon {
    display: none;
}

.chat-header {
    padding: 16px 20px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 700;
}

.chat-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chat-body {
    padding: 20px;
    min-height: 150px;
}

.chat-message {
    display: flex;
    gap: 12px;
    margin-bottom: 15px;
}

.chat-avatar {
    width: 36px;
    height: 36px;
    background: rgba(0, 212, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.chat-text {
    background: rgba(255, 255, 255, 0.05);
    padding: 12px 16px;
    border-radius: 16px;
    border-top-left-radius: 4px;
    font-size: 0.9rem;
    line-height: 1.5;
    color: var(--text-muted);
}

.chat-footer {
    padding: 15px 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.chat-discord-btn {
    display: block;
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #5865f2, #4752c4);
    border-radius: 12px;
    color: white;
    text-decoration: none;
    text-align: center;
    font-weight: 700;
    transition: all 0.3s;
}

.chat-discord-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(88, 101, 242, 0.4);
}

/* ============================================
   COMMAND PALETTE
   ============================================ */
.command-palette {
    position: fixed;
    inset: 0;
    z-index: 100050;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 15vh;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s, visibility 0.2s;
}

.command-palette.open {
    opacity: 1;
    visibility: visible;
}

.command-palette-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
}

.command-palette-modal {
    position: relative;
    width: 100%;
    max-width: 600px;
    background: rgba(13, 13, 26, 0.98);
    border: 1px solid rgba(0, 212, 255, 0.3);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 30px 100px rgba(0, 0, 0, 0.6), 0 0 50px rgba(0, 212, 255, 0.1);
    transform: translateY(-20px) scale(0.95);
    transition: transform 0.2s cubic-bezier(0.23, 1, 0.32, 1);
}

.command-palette.open .command-palette-modal {
    transform: translateY(0) scale(1);
}

.command-search {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 20px 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.command-search svg {
    width: 24px;
    height: 24px;
    stroke: var(--text-muted);
    flex-shrink: 0;
}

.command-search input {
    flex: 1;
    background: transparent;
    border: none;
    color: white;
    font-size: 1.1rem;
    outline: none;
}

.command-search input::placeholder {
    color: var(--text-muted);
}

.command-search kbd {
    padding: 6px 10px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    font-size: 0.75rem;
    font-family: inherit;
    color: var(--text-muted);
}

.command-results {
    max-height: 400px;
    overflow-y: auto;
    padding: 10px;
}

.command-group {
    margin-bottom: 15px;
}

.command-group-title {
    padding: 10px 14px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
}

.command-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 18px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 500;
}

.command-item:hover {
    background: rgba(0, 212, 255, 0.1);
}

.command-item span {
    font-size: 1.2rem;
}

/* ============================================
   PAGE TRANSITIONS
   ============================================ */
.page-transition {
    position: fixed;
    inset: 0;
    z-index: 100100;
    pointer-events: none;
}

.transition-bg {
    position: absolute;
    inset: 0;
    background: var(--bg-dark);
    transform: translateY(100%);
    transition: transform 0.6s cubic-bezier(0.77, 0, 0.175, 1);
}

.page-transition.active .transition-bg {
    transform: translateY(0);
}

.transition-logo {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-family: 'Orbitron', sans-serif;
    font-size: 4rem;
    font-weight: 900;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    opacity: 0;
    transition: opacity 0.3s 0.3s;
}

.page-transition.active .transition-logo {
    opacity: 1;
}

/* Page load fade in - disabled to prevent invisible page issues */
/*
body {
    opacity: 0;
    transition: opacity 0.5s;
}

body.page-loaded {
    opacity: 1;
}
*/

/* ============================================
   TESTIMONIALS CAROUSEL
   ============================================ */
.testimonials-carousel {
    position: relative;
    height: 300px;
    overflow: hidden;
}

.testimonial-card {
    position: absolute;
    width: 100%;
    max-width: 600px;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%) scale(0.8);
    opacity: 0;
    transition: all 0.6s cubic-bezier(0.23, 1, 0.32, 1);
    background: rgba(13, 13, 26, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 24px;
    padding: 30px;
    text-align: center;
}

.testimonial-card.active {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
    z-index: 2;
}

.testimonial-card.prev {
    transform: translate(-120%, -50%) scale(0.8) rotateY(30deg);
    opacity: 0.3;
}

.testimonial-card.next {
    transform: translate(20%, -50%) scale(0.8) rotateY(-30deg);
    opacity: 0.3;
}

/* ============================================
   INTERACTIVE TIMELINE
   ============================================ */
.interactive-timeline {
    position: relative;
    padding-left: 40px;
}

.interactive-timeline::before {
    content: '';
    position: absolute;
    left: 15px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(180deg, var(--primary), var(--accent));
}

.timeline-item {
    position: relative;
    padding: 20px 0 40px 30px;
    opacity: 0;
    transform: translateX(-30px);
    transition: all 0.6s cubic-bezier(0.23, 1, 0.32, 1);
}

.timeline-item.visible {
    opacity: 1;
    transform: translateX(0);
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -25px;
    top: 24px;
    width: 16px;
    height: 16px;
    background: var(--primary);
    border-radius: 50%;
    border: 3px solid var(--bg-dark);
    box-shadow: 0 0 20px var(--primary-glow);
}

/* ============================================
   METABALL/LIQUID EFFECT
   ============================================ */
.metaball-container {
    position: fixed;
    top: 0;
    right: 0;
    width: 300px;
    height: 300px;
    z-index: -5;
    pointer-events: none;
    opacity: 0.5;
}

.metaball-svg {
    width: 100%;
    height: 100%;
}

.metaball {
    fill: rgba(0, 212, 255, 0.3);
}

.metaball-1 {
    animation: metaballMove1 8s ease-in-out infinite;
}

.metaball-2 {
    animation: metaballMove2 10s ease-in-out infinite;
    fill: rgba(168, 85, 247, 0.3);
}

.metaball-3 {
    animation: metaballMove3 12s ease-in-out infinite;
    fill: rgba(236, 72, 153, 0.3);
}

@keyframes metaballMove1 {
    0%, 100% { transform: translate(0, 0); }
    25% { transform: translate(30px, 40px); }
    50% { transform: translate(-20px, 60px); }
    75% { transform: translate(40px, 20px); }
}

@keyframes metaballMove2 {
    0%, 100% { transform: translate(0, 0); }
    33% { transform: translate(-40px, 30px); }
    66% { transform: translate(20px, -40px); }
}

@keyframes metaballMove3 {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(50px, 50px); }
}

/* ============================================
   TYPEWRITER CURSOR
   ============================================ */
@keyframes cursorBlink {
    0%, 100% { border-color: var(--primary); }
    50% { border-color: transparent; }
}

/* ============================================
   RESPONSIVE ADJUSTMENTS
   ============================================ */
@media (max-width: 768px) {
    .theme-toggle,
    .sound-toggle {
        width: 40px;
        height: 40px;
        right: 15px;
    }

    .theme-toggle { top: 80px; }
    .sound-toggle { top: 130px; }

    .command-palette-modal {
        margin: 0 15px;
        max-width: calc(100% - 30px);
    }

    .chat-bubble-expanded {
        width: calc(100vw - 60px);
        right: -15px;
    }

    .live-chat-bubble {
        bottom: 150px;
        right: 15px;
    }

    .chat-bubble-icon {
        width: 50px;
        height: 50px;
    }

    .announcements-bar {
        height: 35px;
    }

    .announcement-item {
        font-size: 0.8rem;
        padding: 0 30px;
    }
}

/* Hide complex effects on mobile for performance */
@media (pointer: coarse) {
    .spotlight-effect,
    .particle-trail-canvas,
    .metaball-container {
        display: none !important;
    }
}
