.typewriter {
    animation: typewriter 2s steps(20) 1s forwards, blink 1s infinite;
    white-space: nowrap;
    overflow: hidden;
    border-right: 2px solid transparent;
}

.fade-in-delayed {
    animation: fadeInUp 1s ease-out 3s forwards;
    opacity: 0;
    transform: translateY(20px);
}

.scroll-animate {
    opacity: 0;
    transform: translateY(50px);
    transition: all 0.8s ease-out;
}

.scroll-animate.visible {
    opacity: 1;
    transform: translateY(0);
}

@keyframes typewriter {
    0% { 
        width: 0; 
        border-right-color: #14b8a6; 
    }
    99% { 
        border-right-color: #14b8a6; 
    }
    100% { 
        width: 100%; 
        border-right-color: transparent; 
    }
}

@keyframes blink {
    0%, 50% { 
        border-right-color: transparent; 
    }
    51%, 100% { 
        border-right-color: #14b8a6; 
    }
}

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse-ring {
    0% { 
        transform: scale(1); 
        opacity: 1; 
    }
    100% { 
        transform: scale(1.5); 
        opacity: 0; 
    }
}

.pulse-ring {
    animation: pulse-ring 2s infinite;
}

.gradient-text {
    background: linear-gradient(to right, #ffffff, #14b8a6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.command-card {
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.command-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 40px rgba(20, 184, 166, 0.15);
}

.category-gradient {
    background: linear-gradient(135deg, rgba(20, 184, 166, 0.1) 0%, rgba(59, 130, 246, 0.1) 100%);
}

.filter-btn {
    transition: all 0.3s ease;
}

.filter-btn.active {
    background: linear-gradient(to right, #14b8a6, #3b82f6);
    transform: scale(1.05);
}

.search-glow:focus {
    box-shadow: 0 0 20px rgba(20, 184, 166, 0.3);
}

/* Enhanced animations for better UX */
.search-highlight {
    animation: searchHighlight 0.3s ease-in-out;
}

@keyframes searchHighlight {
    0% { 
        background-color: rgba(20, 184, 166, 0.1); 
    }
    50% { 
        background-color: rgba(20, 184, 166, 0.2); 
    }
    100% { 
        background-color: transparent; 
    }
}

.filter-in {
    animation: filterIn 0.3s ease-out forwards;
    opacity: 0;
    transform: translateY(20px) scale(0.9);
}

@keyframes filterIn {
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.filter-out {
    animation: filterOut 0.2s ease-in forwards;
}

@keyframes filterOut {
    to {
        opacity: 0;
        transform: translateY(-20px) scale(0.9);
    }
}

.animate-in {
    animation: slideInUp 0.6s ease-out forwards;
    opacity: 0;
    transform: translateY(30px);
}

@keyframes slideInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.command-clicked {
    animation: commandClick 0.2s ease-in-out;
}

@keyframes commandClick {
    0% { 
        transform: scale(1); 
    }
    50% { 
        transform: scale(0.95); 
    }
    100% { 
        transform: scale(1); 
    }
}

.search-focused {
    box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.3);
}

.threat-notification {
    animation: slideInRight 0.3s ease-out;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.copy-notification {
    animation: slideInUp 0.3s ease-out;
}

@keyframes slideInUp {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Enhanced command card styling */
.command-card {
    position: relative;
    overflow: hidden;
}

.command-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.5s;
}

.command-card:hover::before {
    left: 100%;
}

/* Category-specific hover effects */
.command-card[data-category="public"]:hover {
    border-color: rgba(34, 197, 94, 0.5);
    box-shadow: 0 20px 40px rgba(34, 197, 94, 0.15);
}

.command-card[data-category="security"]:hover {
    border-color: rgba(59, 130, 246, 0.5);
    box-shadow: 0 20px 40px rgba(59, 130, 246, 0.15);
}

.command-card[data-category="moderation"]:hover {
    border-color: rgba(147, 51, 234, 0.5);
    box-shadow: 0 20px 40px rgba(147, 51, 234, 0.15);
}

.command-card[data-category="setup"]:hover {
    border-color: rgba(245, 158, 11, 0.5);
    box-shadow: 0 20px 40px rgba(245, 158, 11, 0.15);
}

.command-card[data-category="community"]:hover {
    border-color: rgba(236, 72, 153, 0.5);
    box-shadow: 0 20px 40px rgba(236, 72, 153, 0.15);
}

.command-card[data-category="utilities"]:hover {
    border-color: rgba(6, 182, 212, 0.5);
    box-shadow: 0 20px 40px rgba(6, 182, 212, 0.15);
}

.command-card[data-category="leveling"]:hover {
    border-color: rgba(99, 102, 241, 0.5);
    box-shadow: 0 20px 40px rgba(99, 102, 241, 0.15);
}

/* Status badges styling */
.command-card span[class*="bg-"] {
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Code blocks */
code {
    cursor: pointer;
    transition: all 0.2s ease;
}

code:hover {
    background-color: rgba(20, 184, 166, 0.2) !important;
    transform: scale(1.05);
}

/* Filter button enhancements */
.filter-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.filter-btn.active {
    color: white;
    box-shadow: 0 6px 20px rgba(20, 184, 166, 0.3);
}

/* Search input enhancements */
#command-search {
    transition: all 0.3s ease;
}

#command-search:focus {
    transform: scale(1.02);
    border-color: #14b8a6;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .command-card {
        margin-bottom: 1rem;
    }
    
    .filter-btn {
        margin-bottom: 0.5rem;
    }
    
    .gradient-text {
        font-size: 2.5rem;
    }
}

/* Loading states */
.loading {
    opacity: 0.7;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #14b8a6;
    border-top: 2px solid transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Accessibility improvements */
.command-card:focus {
    outline: 2px solid #14b8a6;
    outline-offset: 2px;
}

.filter-btn:focus {
    outline: 2px solid #14b8a6;
    outline-offset: 2px;
}

#command-search:focus {
    outline: none;
}

/* Dark mode optimizations */
@media (prefers-color-scheme: dark) {
    .command-card {
        background: rgba(15, 23, 42, 0.8);
    }
    
    .threat-notification,
    .copy-notification {
        backdrop-filter: blur(10px);
    }
}