/* Enhanced Terminal Styling */
.terminal-font {
    font-family: 'Fira Code', 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-feature-settings: "liga" 1;
}

.ui-font { 
    font-family: 'Inter', 'Roboto', sans-serif; 
}

/* Terminal cursor animation */
.terminal-cursor {
    animation: blink 1s infinite;
}

@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

/* Scrollbar styling */
.scrollbar-hide { 
    -ms-overflow-style: none; 
    scrollbar-width: none; 
}

.scrollbar-hide::-webkit-scrollbar { 
    display: none; 
}

.scrollbar-thin {
    scrollbar-width: thin;
}

.scrollbar-thin::-webkit-scrollbar {
    width: 6px;
}

.scrollbar-thin::-webkit-scrollbar-track {
    background: #1f2937;
}

.scrollbar-thin::-webkit-scrollbar-thumb {
    background: #4b5563;
    border-radius: 3px;
}

.scrollbar-thin::-webkit-scrollbar-thumb:hover {
    background: #6b7280;
}

/* Card hover effects */
.command-card-hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 255, 65, 0.15);
}

/* CRT scanlines effect for dark mode */
@media (prefers-color-scheme: dark) {
    .terminal-font::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: linear-gradient(transparent 50%, rgba(0, 255, 65, 0.03) 50%);
        background-size: 100% 2px;
        pointer-events: none;
        opacity: 0.3;
    }
}

/* Enhanced button transitions */
button {
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

button:active {
    transform: translateY(1px);
}

/* Achievement badge glow */
.achievement-glow {
    animation: glow 2s ease-in-out infinite alternate;
}

@keyframes glow {
    from {
        box-shadow: 0 0 5px #fbbf24;
    }
    to {
        box-shadow: 0 0 20px #fbbf24, 0 0 30px #fbbf24;
    }
}

/* Mobile-friendly tap targets */
@media (max-width: 768px) {
    button {
        min-height: 44px;
    }
    
    input {
        min-height: 44px;
    }
}

/* Safety indicator animations */
.safety-danger {
    animation: pulse-red 2s ease-in-out infinite;
}

.safety-warning {
    animation: pulse-yellow 2s ease-in-out infinite;
}

@keyframes pulse-red {
    0%, 100% { border-color: #ef4444; }
    50% { border-color: #f87171; }
}

@keyframes pulse-yellow {
    0%, 100% { border-color: #eab308; }
    50% { border-color: #facc15; }
}

/* Terminal text effects */
.matrix-text {
    text-shadow: 0 0 10px #00ff41;
}

/* Loading animation for v86 */
.vm-loading {
    animation: vm-boot 3s ease-in-out;
}

@keyframes vm-boot {
    0% { opacity: 0; transform: scale(0.8); }
    50% { opacity: 0.7; transform: scale(1.1); }
    100% { opacity: 1; transform: scale(1); }
}

/* Responsive improvements */
@media (max-width: 640px) {
    .terminal-font {
        font-size: 12px;
        line-height: 1.4;
    }
    
    .command-card {
        padding: 12px;
    }
    
    .virtual-keyboard {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 1000;
        max-height: 50vh;
        overflow-y: auto;
    }
}

/* Focus states for accessibility */
button:focus-visible,
input:focus-visible {
    outline: 2px solid #00bfff;
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .text-matrix-green {
        color: #00ff00 !important;
    }
    
    .text-electric-cyan {
        color: #00ffff !important;
    }
    
    .border-gray-700 {
        border-color: #ffffff !important;
    }
}

/* Retina display optimization */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .terminal-font {
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
    }
}