/**
 * Indexing Table Component Styles
 * Interactive table for page indexing status and batch indexing requests
 */

/* Container */
.indexing-table-container {
    background: var(--card-bg, #1a1a2e);
    border-radius: 12px;
    border: 1px solid var(--border-color, rgba(255, 255, 255, 0.1));
    margin: 16px 0;
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Header */
.indexing-table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(139, 92, 246, 0.1));
    border-bottom: 1px solid var(--border-color, rgba(255, 255, 255, 0.1));
}

.indexing-table-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary, #fff);
    display: flex;
    align-items: center;
    gap: 8px;
}

.indexing-table-title i {
    color: #3b82f6;
}

.indexing-table-summary {
    display: flex;
    gap: 16px;
    font-size: 13px;
}

.indexed-count {
    color: #22c55e;
}

.not-indexed-count {
    color: #ef4444;
}

/* Table wrapper */
.indexing-table-wrapper {
    max-height: 400px;
    overflow-y: auto;
}

/* Table */
.indexing-table {
    width: 100%;
    border-collapse: collapse;
}

.indexing-table th,
.indexing-table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border-color, rgba(255, 255, 255, 0.05));
}

.indexing-table th {
    background: rgba(0, 0, 0, 0.2);
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary, #a0a0a0);
    position: sticky;
    top: 0;
    z-index: 1;
}

/* Column widths */
.col-select {
    width: 40px;
    text-align: center !important;
}

.col-url {
    width: auto;
}

.col-status {
    width: 120px;
}

.col-actions {
    width: 100px;
    text-align: center !important;
}

/* Rows */
.url-row {
    transition: background 0.2s ease;
}

.url-row:hover {
    background: rgba(255, 255, 255, 0.03);
}

.url-row.selected {
    background: rgba(59, 130, 246, 0.1);
}

.url-row.indexed {
    opacity: 0.7;
}

/* Checkboxes */
.select-all-urls,
.url-checkbox {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #3b82f6;
}

/* URL link */
.col-url a {
    color: var(--text-primary, #fff);
    text-decoration: none;
    font-size: 14px;
    word-break: break-all;
}

.col-url a:hover {
    color: #3b82f6;
    text-decoration: underline;
}

/* Status badges */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.status-badge.indexed {
    background: rgba(34, 197, 94, 0.15);
    color: #22c55e;
}

.status-badge.not-indexed {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

.status-badge.pending {
    background: rgba(245, 158, 11, 0.15);
    color: #f59e0b;
}

.status-badge.error {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

/* Action buttons */
.action-btn {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-secondary, #a0a0a0);
    cursor: pointer;
    transition: all 0.2s ease;
    margin: 0 2px;
}

.action-btn:hover {
    background: rgba(59, 130, 246, 0.2);
    color: #3b82f6;
}

.action-btn.index-btn:hover {
    background: rgba(34, 197, 94, 0.2);
    color: #22c55e;
}

/* Footer */
.indexing-table-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: rgba(0, 0, 0, 0.2);
    border-top: 1px solid var(--border-color, rgba(255, 255, 255, 0.1));
}

.selected-info {
    font-size: 14px;
    color: var(--text-secondary, #a0a0a0);
}

.selected-count {
    font-weight: 600;
    color: #3b82f6;
}

.batch-actions {
    display: flex;
    gap: 12px;
}

.batch-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.batch-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.inspect-selected-btn {
    background: rgba(59, 130, 246, 0.15);
    color: #3b82f6;
}

.inspect-selected-btn:hover:not(:disabled) {
    background: rgba(59, 130, 246, 0.25);
}

.index-selected-btn {
    background: linear-gradient(135deg, #22c55e, #16a34a);
    color: white;
}

.index-selected-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, #16a34a, #15803d);
    transform: translateY(-1px);
}

/* Progress bar */
.indexing-progress {
    padding: 16px 20px;
    background: rgba(0, 0, 0, 0.3);
    border-top: 1px solid var(--border-color, rgba(255, 255, 255, 0.1));
}

.progress-bar {
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 8px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #3b82f6, #8b5cf6);
    border-radius: 3px;
    transition: width 0.3s ease;
    width: 0%;
}

.progress-text {
    font-size: 13px;
    color: var(--text-secondary, #a0a0a0);
    text-align: center;
}

/* Quick action buttons for single pages */
.page-quick-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: var(--card-bg, #1a1a2e);
    border-radius: 8px;
    margin: 8px 0;
    border: 1px solid var(--border-color, rgba(255, 255, 255, 0.1));
}

.page-title {
    font-size: 14px;
    color: var(--text-primary, #fff);
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.quick-action-buttons {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.quick-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    background: #f7fafc;
    color: #1a202c;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.quick-action-btn:hover {
    background: rgba(59, 130, 246, 0.1);
    border-color: #3b82f6;
    color: #3b82f6;
}

.quick-action-btn.primary {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.2), rgba(22, 163, 74, 0.2));
    border-color: #22c55e;
    color: #166534;
}

.quick-action-btn.primary:hover {
    background: linear-gradient(135deg, #22c55e, #16a34a);
    border-color: #22c55e;
    color: white;
}

/* Toast animations */
@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .indexing-table-header {
        flex-direction: column;
        gap: 12px;
        align-items: flex-start;
    }
    
    .indexing-table-footer {
        flex-direction: column;
        gap: 12px;
    }
    
    .batch-actions {
        width: 100%;
    }
    
    .batch-btn {
        flex: 1;
        justify-content: center;
    }
    
    .col-actions {
        width: 80px;
    }
    
    .action-btn {
        width: 28px;
        height: 28px;
    }
    
    .page-quick-actions {
        flex-direction: column;
        gap: 10px;
        align-items: flex-start;
    }
    
    .quick-action-buttons {
        width: 100%;
    }
    
    .quick-action-btn {
        flex: 1;
        justify-content: center;
    }
}
