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

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

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

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

    .pb-safe {
        padding-bottom: env(safe-area-inset-bottom, 1rem);
    }
}

/* Custom Range */
.custom-range {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 6px;
    @apply bg-border;
    border-radius: 9999px;
    outline: none;
    transition: background 0.2s;
}

.custom-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    @apply bg-accent;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 0 10px rgba(56, 189, 248, 0.4);
    border: 2px solid #1A1E29;
    transition: transform 0.1s;
}

.custom-range::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

.custom-range::-webkit-slider-thumb:active {
    transform: scale(0.9);
}

/* Modal Helpers */
.modal-active {
    display: flex !important;
}

.scale-active {
    transform: scale(1) !important;
}

/* Floating Popup Formations */
.floating-score {
    position: absolute;
    font-family: 'JetBrains Mono', monospace;
    font-weight: 900;
    color: #4ADE80;
    text-shadow: 0 0 10px rgba(74, 222, 128, 0.8), 0 2px 4px rgba(0, 0, 0, 0.5);
    pointer-events: none;
    user-select: none;
    animation: floatUp 1s ease-out forwards;
    z-index: 1000;
}

.floating-score.bad {
    color: #EF4444;
    text-shadow: 0 0 10px rgba(239, 68, 68, 0.8), 0 2px 4px rgba(0, 0, 0, 0.5);
}

@keyframes floatUp {
    0% {
        opacity: 0;
        transform: translate(-50%, 0) scale(0.5);
    }

    20% {
        opacity: 1;
        transform: translate(-50%, -20px) scale(1.2);
    }

    100% {
        opacity: 0;
        transform: translate(-50%, -80px) scale(1);
    }
}

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

.shake-heavy {
    animation: shake-hard 0.5s 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(-4px, 2px, 0);
    }

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

@keyframes shake-hard {

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

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

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

    40%,
    60% {
        transform: translate3d(8px, -4px, 0);
    }
}

/* Active Bet Button */
.bet-btn {
    @apply bg-background border border-border rounded-xl p-3 flex flex-col items-center justify-center gap-1 cursor-pointer transition-all hover:border-accent/50 hover:bg-surface;
}

.bet-btn.active {
    @apply border-accent bg-accent/10 shadow-[0_0_15px_rgba(56, 189, 248, 0.2)];
}

.bet-btn p.algo-name {
    @apply text-xs font-bold text-white;
}

.bet-btn p.algo-odds {
    @apply text-[10px] text-accent font-mono;
}