/* Custom fonts */
body {
    font-family: 'Inter', sans-serif;
}

.font-mono {
    font-family: 'JetBrains Mono', monospace;
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #1e293b;
}

::-webkit-scrollbar-thumb {
    background: #475569;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #64748b;
}

/* Text highlighting styles */
.correct {
    background-color: rgba(34, 197, 94, 0.2);
    color: #22c55e;
}

.incorrect {
    background-color: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

.current {
    background-color: rgba(147, 51, 234, 0.3);
    animation: pulse 1s infinite;
}

.untyped {
    color: #64748b;
}

/* Pulse animation for current character */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

/* Smooth transitions */
* {
    transition: all 0.2s ease;
}

/* Input focus states */
#typing-input:focus {
    box-shadow: 0 0 0 3px rgba(147, 51, 234, 0.1);
}

/* Disabled state */
#typing-input:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Button hover effects */
button:hover:not(:disabled) {
    transform: translateY(-1px);
}

button:active:not(:disabled) {
    transform: translateY(0);
}

/* Modal animations */
#results-modal.show {
    display: flex !important;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Progress bar */
.progress-bar {
    height: 4px;
    background: linear-gradient(90deg, #8b5cf6, #3b82f6);
    border-radius: 2px;
    transition: width 0.1s ease;
}

/* Character spacing */
.text-char {
    position: relative;
    padding: 2px 1px;
    border-radius: 2px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    #text-display {
        font-size: 1.125rem;
        line-height: 1.6;
    }
    
    #typing-input {
        font-size: 1rem;
    }
}

/* Dark mode enhancements */
@media (prefers-color-scheme: dark) {
    body {
        color-scheme: dark;
    }
}