/* Enhanced Knowledge Base Styles */

/* View Toggle */
.view-toggle {
    display: flex;
    gap: 5px;
    background: #f3f4f6;
    border-radius: 8px;
    padding: 4px;
}

.view-toggle-btn {
    padding: 8px 12px;
    background: transparent;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    color: #6b7280;
    transition: all 0.2s;
}

.view-toggle-btn:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.5);
}

.view-toggle-btn.active {
    background: white;
    color: var(--primary-color);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Grid/List Views */
.items-list.grid-view {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.items-list.list-view {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.items-list.list-view .knowledge-item {
    flex-direction: row;
    align-items: center;
}

.items-list.list-view .item-icon {
    width: 48px;
    height: 48px;
    font-size: 24px;
}

.items-list.list-view .item-content {
    flex: 1;
}

.items-list.list-view .item-actions {
    margin-top: 0;
    display: flex;
    gap: 8px;
}

/* Bulk Actions Bar */
.bulk-actions-bar {
    position: fixed;
    bottom: -100px;
    left: 50%;
    transform: translateX(-50%);
    background: white;
    border-radius: 12px;
    padding: 16px 24px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    gap: 20px;
    transition: bottom 0.3s;
    z-index: 1000;
}

.bulk-actions-bar.show {
    bottom: 30px;
}

.bulk-actions-info {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
}

.bulk-actions-buttons {
    display: flex;
    gap: 10px;
}

/* Document Checkbox */
.doc-checkbox {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--primary-color);
}

.doc-select-container {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 10;
}

.knowledge-item {
    position: relative;
}

.knowledge-item.selected {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.2);
}

/* Upload Progress */
.upload-progress-container {
    background: white;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.progress-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: #f3f4f6;
    border-radius: 10px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--primary-color-light));
    border-radius: 10px;
    transition: width 0.3s ease;
}

/* File Preview Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.modal.show {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 12px;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.modal-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    font-size: 28px;
    color: var(--text-secondary);
    cursor: pointer;
    line-height: 1;
    padding: 0;
    width: 32px;
    height: 32px;
}

.modal-close:hover {
    color: var(--text-primary);
}

.modal-body {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
}

.modal-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.file-info {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 10px 20px;
    padding: 15px;
    background: #f9fafb;
    border-radius: 8px;
}

.preview-placeholder {
    text-align: center;
    padding: 40px;
    color: var(--text-secondary);
}

/* Document Tags */
.doc-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 10px;
}

.doc-tag {
    display: inline-block;
    padding: 4px 10px;
    background: #e0e7ff;
    color: #4f46e5;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.add-tag-btn {
    padding: 4px 10px;
    background: #f3f4f6;
    color: var(--text-secondary);
    border: 1px dashed var(--border-color);
    border-radius: 12px;
    font-size: 12px;
    cursor: pointer;
}

.add-tag-btn:hover {
    background: #e5e7eb;
    color: var(--text-primary);
}

/* Search Box */
.search-box {
    position: relative;
    display: flex;
    align-items: center;
}

.search-box svg {
    position: absolute;
    left: 12px;
    color: var(--text-secondary);
}

.search-box input {
    padding-left: 40px;
    padding-right: 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    width: 250px;
}

/* Knowledge List Header */
.knowledge-list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.knowledge-actions {
    display: flex;
    gap: 15px;
    align-items: center;
}

/* Responsive */
@media (max-width: 768px) {
    .items-list.grid-view {
        grid-template-columns: 1fr;
    }
    
    .knowledge-list-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .knowledge-actions {
        width: 100%;
        flex-direction: column;
        align-items: stretch;
    }
    
    .search-box input {
        width: 100%;
    }
    
    .bulk-actions-bar {
        width: 90%;
        flex-direction: column;
        padding: 12px;
    }
    
    .bulk-actions-buttons {
        width: 100%;
        flex-direction: column;
    }
}
