@tailwind base;
@tailwind components;
@tailwind utilities;

@layer utilities {
    .custom-scrollbar::-webkit-scrollbar {
        width: 6px;
    }

    .custom-scrollbar::-webkit-scrollbar-track {
        background: transparent;
    }

    .custom-scrollbar::-webkit-scrollbar-thumb {
        @apply bg-border rounded-full hover:bg-textMuted;
    }
}

/* Neon Grid Background */
.pattern-grid {
    background-size: 40px 40px;
    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 at center, black 40%, transparent 100%);
    -webkit-mask-image: radial-gradient(circle at center, black 40%, transparent 100%);
}

/* Build Button Active State */
.build-btn.selected {
    @apply border-primary ring-2 ring-primary/20 bg-primary/5;
}

.build-btn.selected .absolute.inset-0 {
    @apply translate-y-0 opacity-100;
}

/* Canvas Crosshair styling when building */
.cursor-crosshair {
    cursor: crosshair !important;
}

.cursor-default {
    cursor: default !important;
}

/* Screen Shake */
.shake {
    animation: shake 0.4s cubic-bezier(.36, .07, .19, .97) both;
}

@keyframes shake {

    10%,
    90% {
        transform: translate3d(-1px, 1px, 0);
    }

    20%,
    80% {
        transform: translate3d(2px, -1px, 0);
    }

    30%,
    50%,
    70% {
        transform: translate3d(-3px, 2px, 0);
    }

    40%,
    60% {
        transform: translate3d(3px, -2px, 0);
    }
}

/* Floating texts */
.floating-text {
    position: absolute;
    font-family: 'JetBrains Mono', monospace;
    font-weight: 700;
    font-size: 12px;
    pointer-events: none;
    user-select: none;
    animation: floatUp 0.8s ease-out forwards;
    z-index: 50;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
}

@keyframes floatUp {
    0% {
        opacity: 0;
        transform: translateY(0) scale(0.8);
    }

    20% {
        opacity: 1;
        transform: translateY(-10px) scale(1.1);
    }

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