/* Custom styles for the network diagram aesthetic */
.diagram-node {
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 9999px;
    font-size: 0.75rem;
    text-align: center;
    cursor: default;
}

.diagram-line {
    position: absolute;
    height: 2px;
    background: linear-gradient(to right, #4F46E5, #A78BFA);
    transform-origin: 0 0;
    opacity: 0.5;
    z-index: 10;
}

/* Global Styles */
body {
    font-family: 'Outfit', sans-serif;
    background-color: #050505;
    background-image: 
        radial-gradient(circle at 15% 50%, rgba(79, 70, 229, 0.15), transparent 25%),
        radial-gradient(circle at 85% 30%, rgba(167, 139, 250, 0.15), transparent 25%);
    background-attachment: fixed;
}

/* Style for the command tokens */
.command-token {
    background: linear-gradient(90deg, rgba(79, 70, 229, 0.2), rgba(167, 139, 250, 0.2));
    border-radius: 0.25rem;
    padding: 2px 6px;
    font-family: monospace;
    font-weight: 600;
    color: #A78BFA; /* neon-purple */
    border: 1px solid rgba(167, 139, 250, 0.3);
}

/* Scroll Reveal Animation */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    filter: blur(10px); /* Modern Lens Blur Effect */
    transition: all 1s cubic-bezier(0.5, 0, 0, 1);
}
.reveal.active {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0);
}

/* Spotlight Card Effect */
.spotlight-card {
    position: relative;
    overflow: hidden;
}
.spotlight-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: radial-gradient(800px circle at var(--mouse-x) var(--mouse-y), rgba(255,255,255,0.06), transparent 40%);
    z-index: 0;
    opacity: 0;
    transition: opacity 0.5s;
    pointer-events: none;
}
.spotlight-card:hover::before {
    opacity: 1;
}

/* Custom Cursor */
.cursor-dot,
.cursor-outline {
    position: fixed;
    top: 0;
    left: 0;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    z-index: 9999;
    pointer-events: none;
}
.cursor-dot {
    width: 8px;
    height: 8px;
    background-color: white;
}
.cursor-outline {
    width: 40px;
    height: 40px;
    border: 1px solid rgba(255, 255, 255, 0.5);
    transition: width 0.2s, height 0.2s, background-color 0.2s;
}
body:hover .cursor-outline {
    background-color: rgba(255, 255, 255, 0.05);
}

/* --- 3D & Modern Additions --- */
.perspective-1000 {
    perspective: 1000px;
}
.transform-style-3d {
    transform-style: preserve-3d;
}
.tilt-card {
    transition: transform 0.1s ease-out;
    will-change: transform;
}
/* Elements with this class will float above the card surface */
.content-pop {
    transform: translateZ(30px);
}

/* Cyber Grid Background */
.cyber-grid {
    position: fixed;
    bottom: -30%;
    left: -50%;
    width: 200%;
    height: 150%;
    background-image: 
        linear-gradient(rgba(79, 70, 229, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(79, 70, 229, 0.05) 1px, transparent 1px);
    background-size: 60px 60px;
    transform: perspective(500px) rotateX(60deg);
    animation: grid-move 20s linear infinite;
    z-index: -2;
    pointer-events: none;
    mask-image: linear-gradient(to top, black 0%, transparent 100%);
    -webkit-mask-image: linear-gradient(to top, black 0%, transparent 100%);
}

/* Particle Canvas Background */
#particle-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
}

@keyframes grid-move {
    0% { background-position: 0 0; }
    100% { background-position: 0 60px; }
}

/* Scramble Text Effect Color */
.dud {
    color: #4F46E5;
    opacity: 0.7;
}

/* Glitch Effect for Logo */
@keyframes glitch-anim {
    0% { transform: translate(0); }
    20% { transform: translate(-2px, 2px); }
    40% { transform: translate(-2px, -2px); }
    60% { transform: translate(2px, 2px); }
    80% { transform: translate(2px, -2px); }
    100% { transform: translate(0); }
}

.glitch-effect {
    transition: all 0.2s ease;
}

.glitch-effect:hover {
    animation: glitch-anim 0.3s cubic-bezier(.25, .46, .45, .94) both infinite;
    filter: drop-shadow(2px 2px 0px rgba(255, 0, 80, 0.7)) drop-shadow(-2px -2px 0px rgba(0, 255, 255, 0.7));
}

/* Live Update Flash Animation */
@keyframes flash-update {
    0% { color: #10B981; text-shadow: 0 0 20px rgba(16, 185, 129, 0.5); transform: scale(1.05); }
    100% { color: white; text-shadow: none; transform: scale(1); }
}
.updated {
    animation: flash-update 0.5s ease-out;
}

/* --- Ultra Modern Loader CSS --- */
.loader-container {
    perspective: 1000px;
    transform-style: preserve-3d;
}
.loader-core {
    width: 120px;
    height: 120px;
    position: relative;
    transform-style: preserve-3d;
}
.loader-ring-1 {
    position: absolute;
    inset: -10px;
    border: 2px solid transparent;
    border-top: 2px solid #4F46E5;
    border-bottom: 2px solid #4F46E5;
    border-radius: 50%;
    animation: spin-3d-1 3s cubic-bezier(0.5, 0, 0.5, 1) infinite;
}
.loader-ring-2 {
    position: absolute;
    inset: -25px;
    border: 1px solid rgba(167, 139, 250, 0.3);
    border-left: 2px solid #A78BFA;
    border-right: 2px solid #A78BFA;
    border-radius: 50%;
    animation: spin-3d-2 4s linear infinite;
}
.loader-ring-3 {
    position: absolute;
    inset: -40px;
    border: 1px dashed rgba(16, 185, 129, 0.4);
    border-radius: 50%;
    animation: spin-reverse 12s linear infinite;
}
.loader-logo-glow {
    position: absolute;
    inset: -20px;
    background: radial-gradient(circle, rgba(79,70,229,0.6) 0%, transparent 70%);
    animation: pulse-glow 2s ease-in-out infinite;
    filter: blur(10px);
}

@keyframes spin-3d-1 {
    0% { transform: rotateX(0deg) rotateY(0deg) rotateZ(0deg); }
    100% { transform: rotateX(360deg) rotateY(180deg) rotateZ(360deg); }
}
@keyframes spin-3d-2 {
    0% { transform: rotateX(180deg) rotateY(0deg) rotateZ(0deg); }
    100% { transform: rotateX(540deg) rotateY(360deg) rotateZ(0deg); }
}
@keyframes spin-reverse {
    0% { transform: rotateZ(360deg); }
    100% { transform: rotateZ(0deg); }
}
@keyframes pulse-glow {
    0%, 100% { opacity: 0.3; transform: scale(0.8); }
    50% { opacity: 0.8; transform: scale(1.1); }
}
@keyframes shimmer {
    0% { transform: translateX(-150%); }
    100% { transform: translateX(250%); }
}

/* Glitch Text Animation */
.glitch-text {
    position: relative;
}
.glitch-text::before,
.glitch-text::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #050505;
}
.glitch-text::before {
    left: 2px;
    text-shadow: -1px 0 #ff00c1;
    clip: rect(44px, 450px, 56px, 0);
    animation: glitch-anim-1 5s infinite linear alternate-reverse;
}
.glitch-text::after {
    left: -2px;
    text-shadow: -1px 0 #00fff9;
    clip: rect(44px, 450px, 56px, 0);
    animation: glitch-anim-2 5s infinite linear alternate-reverse;
}
@keyframes glitch-anim-1 {
    0% { clip: rect(20px, 9999px, 10px, 0); }
    20% { clip: rect(60px, 9999px, 70px, 0); }
    40% { clip: rect(10px, 9999px, 50px, 0); }
    60% { clip: rect(80px, 9999px, 20px, 0); }
    80% { clip: rect(30px, 9999px, 40px, 0); }
    100% { clip: rect(50px, 9999px, 90px, 0); }
}
@keyframes glitch-anim-2 {
    0% { clip: rect(10px, 9999px, 80px, 0); }
    20% { clip: rect(80px, 9999px, 10px, 0); }
    40% { clip: rect(30px, 9999px, 60px, 0); }
    60% { clip: rect(70px, 9999px, 20px, 0); }
    80% { clip: rect(20px, 9999px, 50px, 0); }
    100% { clip: rect(90px, 9999px, 10px, 0); }
}

@keyframes music-bar-anim {
    0%, 100% { height: 4px; }
    50% { height: 12px; }
}

@keyframes scan {
    0% { top: -10%; opacity: 0; }
    50% { opacity: 1; }
    100% { top: 110%; opacity: 0; }
}

/* --- Ultra Modern Additions --- */

/* Animated Film Grain */
.noise-overlay {
    position: fixed;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background-image: url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMDAiIGhlaWdodD0iMjAwIj48ZmlsdGVyIGlkPSJnoiPjxmZVR1cmJ1bGVuY2UgdHlwZT0iZnJhY3RhbE5vaXNlIiBiYXNlRnJlcXVlbmN5PSIwLjY1IiBudW1PY3RhdmVzPSIzIiBzdGl0Y2hUaWxlcz0ic3RpdGNoIi8+PC9maWx0ZXI+PHJlY3Qgd2lkdGg9IjEwMCUiIGhlaWdodD0iMTAwJSIgZmlsdGVyPSJ1cmwoI2cpIiBvcGFjaXR5PSIxIi8+PC9zdmc+');
    opacity: 0.04;
    mix-blend-mode: overlay;
    pointer-events: none;
    z-index: 50;
    animation: noise-anim 0.2s infinite;
}
@keyframes noise-anim {
    0% { transform: translate(0,0); }
    10% { transform: translate(-5%,-5%); }
    20% { transform: translate(-10%,5%); }
    30% { transform: translate(5%,-10%); }
    40% { transform: translate(-5%,15%); }
    50% { transform: translate(-10%,5%); }
    60% { transform: translate(15%,0); }
    70% { transform: translate(0,10%); }
    80% { transform: translate(-15%,0); }
    90% { transform: translate(10%,5%); }
    100% { transform: translate(5%,0); }
}

/* Scroll Progress Bar */
.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    background: linear-gradient(90deg, #4F46E5, #A78BFA, #10B981);
    z-index: 9999;
    width: 0%;
    transition: width 0.1s ease-out;
    box-shadow: 0 0 10px rgba(79, 70, 229, 0.5);
}

/* Magnetic Button Class */
.magnetic-btn {
    transition: transform 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    will-change: transform;
}

/* Enhanced Music Bar Animation for Widget */
@keyframes music-bar-enhanced {
    0% { height: 20%; opacity: 0.7; }
    50% { height: 100%; opacity: 1; transform: scaleY(1.1); }
    100% { height: 20%; opacity: 0.7; }
}
.animate-music-bar {
    animation: music-bar-enhanced 0.6s ease-in-out infinite alternate;
}