/* Base Setup */
html, body {
    margin: 0;
    padding: 0;
    cursor: default; /* Keep default unless hovering specific elements */
    overflow-x: hidden;
}

/* Custom Cursor */
.cursor-dot, .cursor-outline, .cursor-trail {
    position: fixed;
    top: 0;
    left: 0;
    border-radius: 50%;
    z-index: 9999;
    pointer-events: none;
    transform-origin: center;
}

.cursor-dot {
    width: 8px;
    height: 8px;
    background-color: white;
    transform: translate(-50%, -50%);
}

.cursor-outline {
    width: 40px;
    height: 40px;
    border: 1px solid rgba(255, 255, 255, 0.5);
    /* Transform handled by JS for stretching/rotation */
    transition: background-color 0.2s, border-color 0.2s;
}

.cursor-trail {
    width: 12px;
    height: 12px;
    background-color: rgba(255, 255, 255, 0.2);
    transition: opacity 0.1s;
    mix-blend-mode: screen;
}

/* Interactive Spotlight Grid */
.grid-bg {
    position: fixed;
    inset: 0;
    z-index: 0;
    background-size: 60px 60px;
    background-image: 
        linear-gradient(to right, rgba(255, 255, 255, 0.05) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
    mask-image: radial-gradient(circle 500px at var(--mouse-x, 50vw) var(--mouse-y, 50vh), black, transparent);
    -webkit-mask-image: radial-gradient(circle 500px at var(--mouse-x, 50vw) var(--mouse-y, 50vh), black, transparent);
    pointer-events: none;
    transition: opacity 0.3s;
}

/* Click Ripple */
.click-ripple {
    position: fixed;
    border-radius: 50%;
    border: 1.5px solid rgba(255, 255, 255, 0.8);
    pointer-events: none;
    transform: translate(-50%, -50%);
    animation: rippleAnim 0.7s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    z-index: 9998;
}

@keyframes rippleAnim {
    0% { width: 0; height: 0; opacity: 1; border-width: 3px; }
    100% { width: 250px; height: 250px; opacity: 0; border-width: 0px; }
}

/* Shockwave Global Effect */
body.explode-shockwave {
    animation: shockwave 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes shockwave {
    0% { filter: blur(0px) hue-rotate(0deg); transform: scale(1); }
    20% { filter: blur(5px) hue-rotate(90deg); transform: scale(0.97); }
    100% { filter: blur(0px) hue-rotate(0deg); transform: scale(1); }
}

/* Hide native cursor when hovering magnetic elements or app modules */
.magnetic, .app-module, a, button, .scramble-text {
    cursor: none !important;
}

/* Text Glow Effect */
.text-glow {
    text-shadow: 0 0 40px rgba(255, 255, 255, 0.2);
}

/* Floating Animation for Icons inside the modules */
@keyframes floatIcon {
    0% { transform: translate(-50%, -50%) translateZ(50px) translateY(0px) rotate(0deg); }
    50% { transform: translate(-50%, -50%) translateZ(50px) translateY(-15px) rotate(2deg); }
    100% { transform: translate(-50%, -50%) translateZ(50px) translateY(0px) rotate(0deg); }
}

/* App Modules - 3D Setup */
.app-container {
    perspective: 1200px;
}

.app-module {
    transition: flex 0.7s cubic-bezier(0.25, 1, 0.5, 1), background-color 0.5s ease, box-shadow 0.3s ease;
    transform-style: preserve-3d;
    will-change: transform;
}

.app-module .icon-wrapper {
    animation: floatIcon 6s ease-in-out infinite;
    transform: translate(-50%, -50%) translateZ(50px);
}

.app-module:nth-child(2) .icon-wrapper {
    animation-delay: -2s;
}

.app-module:nth-child(3) .icon-wrapper {
    animation-delay: -4s;
}

/* Custom scrollbar to keep it clean */
::-webkit-scrollbar {
    width: 6px;
}
::-webkit-scrollbar-track {
    background: #020202;
}
::-webkit-scrollbar-thumb {
    background: #333;
    border-radius: 10px;
}
