.command-categories {
    margin-bottom: 30px;
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

.category-btn {
    padding: 12px 24px; /* Increased padding for better touch targets */
    border-radius: 50px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem; /* Consistent font size for all buttons */
}

/* Hover and active states for category buttons */
.category-btn:hover,
.category-btn.active {
    background: linear-gradient(to right, var(--primary), var(--accent));
    border-color: transparent;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(138, 43, 226, 0.2);
}

/* Commands Section */
.commands-section {
    padding: 50px 0;
}

.commands-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.command-card {
    background-color: var(--card-bg);
    border-radius: 10px;
    padding: 20px;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

/* Card decoration using before and after pseudo-elements */
.command-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(to bottom, var(--primary), var(--accent));
    opacity: 0.7;
}

.command-card::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(to right, var(--primary), var(--accent));
    transition: width 0.3s ease;
}

.command-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(138, 43, 226, 0.2);
}

.command-card:hover::after {
    width: 100%;
}

.command-name {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--primary-light);
}

.command-short-desc {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Modal Styles */
.command-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    z-index: 2000; /* Ensure it's above other elements  */
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.command-modal.active {
    display: flex;
    animation: fadeIn 0.3s forwards;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.command-modal-content {
    background-color: var(--card-bg);
    border-radius: 10px;
    width: 90%;
    max-width: 700px;
    max-height: 80vh;
    overflow-y: auto;
    padding: 30px;
    position: relative;
    border: 1px solid var(--border-color);
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.5);
    animation: modalSlideIn 0.3s forwards;
}

@keyframes modalSlideIn {
    from {
        transform: translateY(50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.command-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
}

.command-modal-header h2 {
    font-size: 1.8rem;
    background: linear-gradient(to right, var(--primary), var(--accent));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.close-modal {
    font-size: 1.8rem;
    cursor: pointer;
    color: var(--text-secondary);
    transition: color 0.3s ease;
}

.close-modal:hover {
    color: var(--accent);
}

.command-description {
    margin-bottom: 20px;
    color: var(--text-secondary);
    line-height: 1.6;
}

.command-usage {
    margin-bottom: 20px;
}

.command-usage h3,
.command-examples h3 {
    font-size: 1.2rem;
    margin-bottom: 10px;
    color: var(--primary-light);
}

pre {
    background-color: rgba(0, 0, 0, 0.2);
    padding: 15px;
    border-radius: 5px;
    font-family: monospace;
    overflow-x: auto;
    border: 1px solid var(--border-color);
}

.command-examples {
    margin-top: 20px;
}

.command-example {
    margin-bottom: 15px;
    padding: 15px;
    background-color: rgba(0, 0, 0, 0.2);
    border-radius: 5px;
    border: 1px solid var(--border-color);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .commands-list {
        grid-template-columns: 1fr; /* One column for smaller screens */
    }
    
    .command-modal-content {
        width: 95%;
        padding: 20px; /* Adjusted padding for smaller screens */
    }
}