/* =============================================================================
   Marketplace Styles
   ============================================================================= */

.marketplace-container {
    padding: 100px var(--space-xl) var(--space-3xl);
    max-width: 1400px;
    margin: 0 auto;
}

.marketplace-header {
    text-align: center;
    margin-bottom: var(--space-2xl);
}

.marketplace-header h1 {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-md);
    font-size: 2.5rem;
    margin-bottom: var(--space-sm);
}

.marketplace-header h1 i {
    color: var(--accent-primary);
}

.marketplace-header p {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

/* Search Section */
.search-section {
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
    margin-bottom: var(--space-xl);
}

.search-box {
    position: relative;
    max-width: 500px;
    margin: 0 auto;
    width: 100%;
}

.search-box i {
    position: absolute;
    left: var(--space-md);
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.search-box input {
    width: 100%;
    padding: var(--space-md) var(--space-md) var(--space-md) calc(var(--space-md) * 3);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 1rem;
    color: var(--text-primary);
    transition: all var(--transition-fast);
}

.search-box input:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.search-box input::placeholder {
    color: var(--text-muted);
}

/* Filter Tabs */
.filter-tabs {
    display: flex;
    justify-content: center;
    gap: var(--space-sm);
    flex-wrap: wrap;
}

.filter-tab {
    padding: var(--space-sm) var(--space-lg);
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    color: var(--text-secondary);
    font-size: 0.9rem;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.filter-tab:hover {
    border-color: var(--accent-primary);
    color: var(--text-primary);
}

.filter-tab.active {
    background: var(--accent-gradient);
    border-color: transparent;
    color: white;
}

/* Agent Grid */
.agent-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: var(--space-lg);
}

/* Agent Card */
.agent-card {
    display: flex;
    flex-direction: column;
    padding: var(--space-lg);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    cursor: pointer;
    transition: all var(--transition-normal);
}

.agent-card:hover {
    border-color: var(--accent-primary);
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.agent-icon {
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-gradient);
    border-radius: var(--border-radius);
    margin-bottom: var(--space-md);
}

.agent-icon i {
    font-size: 1.5rem;
    color: white;
}

.agent-icon.large {
    width: 72px;
    height: 72px;
}

.agent-icon.large i {
    font-size: 2rem;
}

.agent-info {
    flex: 1;
}

.agent-info h3 {
    margin-bottom: var(--space-xs);
}

.agent-category {
    display: inline-block;
    padding: 2px 8px;
    background: var(--bg-tertiary);
    border-radius: var(--border-radius-sm);
    font-size: 0.75rem;
    color: var(--accent-primary);
    margin-bottom: var(--space-sm);
}

.agent-info p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: var(--space-md);
    line-height: 1.5;
}

.agent-meta {
    display: flex;
    gap: var(--space-lg);
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-bottom: var(--space-md);
}

.agent-meta i {
    margin-right: var(--space-xs);
}

.btn-sm {
    padding: var(--space-sm) var(--space-md);
    font-size: 0.85rem;
}

/* Modal */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: var(--space-xl);
}

.modal-overlay.active {
    display: flex;
}

.modal-content {
    position: relative;
    width: 100%;
    max-width: 700px;
    max-height: 90vh;
    overflow-y: auto;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    padding: var(--space-xl);
}

.modal-close {
    position: absolute;
    top: var(--space-md);
    right: var(--space-md);
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-tertiary);
    border: none;
    border-radius: 50%;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.modal-close:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

/* Agent Detail */
.agent-detail-header {
    display: flex;
    gap: var(--space-lg);
    margin-bottom: var(--space-xl);
}

.agent-detail-header h2 {
    margin-bottom: var(--space-xs);
}

.agent-author {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-top: var(--space-sm);
}

.agent-description {
    color: var(--text-secondary);
    font-size: 1.05rem;
    line-height: 1.6;
    margin-bottom: var(--space-xl);
}

.agent-stats {
    display: flex;
    gap: var(--space-xl);
    padding: var(--space-md);
    background: var(--bg-tertiary);
    border-radius: var(--border-radius);
    margin-bottom: var(--space-xl);
}

.agent-stats .stat {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    color: var(--text-secondary);
}

.agent-stats .stat i {
    color: var(--accent-primary);
}

.agent-detail h3 {
    margin-bottom: var(--space-md);
    color: var(--text-primary);
}

.feature-list {
    list-style: none;
    margin-bottom: var(--space-xl);
}

.feature-list li {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) 0;
    color: var(--text-secondary);
}

.feature-list i {
    color: var(--success);
}

.agent-detail pre {
    background: var(--bg-primary);
    padding: var(--space-md);
    border-radius: var(--border-radius);
    overflow-x: auto;
    margin-bottom: var(--space-xl);
}

.agent-detail code {
    font-family: 'Fira Code', 'Monaco', monospace;
    font-size: 0.85rem;
    color: var(--accent-primary);
}

.agent-actions {
    display: flex;
    gap: var(--space-md);
}

/* Responsive */
@media (max-width: 768px) {
    .agent-grid {
        grid-template-columns: 1fr;
    }

    .agent-detail-header {
        flex-direction: column;
    }

    .agent-actions {
        flex-direction: column;
    }

    .agent-actions .btn {
        width: 100%;
        justify-content: center;
    }
}
