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

@layer components {
    .selector-btn {
        @apply px-4 py-2 bg-[#222] text-[#888] rounded-[8px] border border-[#333] font-bold text-sm transition-all hover:text-white hover:border-[#555];
    }

    .selector-btn.active {
        @apply bg-[#00FF88]/10 text-[#00FF88] border-[#00FF88] shadow-[0_0_10px_rgba(0, 255, 136, 0.2)];
    }
}

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

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

    .custom-scrollbar::-webkit-scrollbar-thumb {
        background: #333;
        border-radius: 4px;
    }

    .custom-scrollbar::-webkit-scrollbar-thumb:hover {
        background: #555;
    }
}

body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Typing Span Styles */
.char {
    transition: color 0.1s;
    border-radius: 2px;
}

.char.correct {
    color: #e2e8f0;
    /* bright white/gray */
}

.char.incorrect {
    color: #FF6B6B;
    background-color: rgba(255, 107, 107, 0.2);
    /* underline for trailing space mistakes */
    text-decoration: underline;
    text-decoration-color: #FF6B6B;
}

/* Caret Animation */
@keyframes blink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0;
    }
}

.caret-blink {
    animation: blink 1s step-end infinite;
}

/* Animation utilities */
.show-panel {
    display: flex !important;
    transform: scale(1) !important;
    opacity: 1 !important;
}

/* For spaces that are incorrect, they need visual representation if they are trailing */
.char.whitespace {
    white-space: pre;
}