/* ============================================
   Table Styles
   Base table styling for data presentation
   ============================================ */

.table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-primary);
    color: var(--text-primary);
}

.table thead {
    background: var(--bg-secondary);
    border-bottom: 2px solid var(--border-color);
}

.table th {
    padding: 1rem;
    text-align: left;
    font-weight: var(--font-semibold);
    color: var(--text-primary);
    white-space: nowrap;
}

.table td {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-secondary);
}

.table tbody tr {
    transition: var(--transition-fast);
}

/* Hover state for table rows */
.table-hover tbody tr:hover {
    background: var(--bg-hover);
    cursor: pointer;
}

/* Responsive table wrapper */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.table-responsive table {
    min-width: 100%;
}

/* Compact table variant */
.table-compact th,
.table-compact td {
    padding: 0.5rem 0.75rem;
}

/* Striped table variant */
.table-striped tbody tr:nth-of-type(odd) {
    background: rgba(0, 0, 0, 0.02);
}

/* Dark mode adjustments */
.table {
    background: var(--bg-secondary);
}

.table thead {
    background: rgba(255, 255, 255, 0.05);
}

.table-striped tbody tr:nth-of-type(odd) {
    background: rgba(255, 255, 255, 0.02);
}

.table-hover tbody tr:hover {
    background: rgba(255, 255, 255, 0.05);
}

/* Action buttons in tables */
.table .actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.table .btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
}

/* Status badges in tables */
.table .badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: var(--font-semibold);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.table .badge-success {
    background: var(--color-success);
    color: white;
}

.table .badge-warning {
    background: var(--color-warning);
    color: var(--text-dark);
}

.table .badge-danger {
    background: var(--color-danger);
    color: white;
}

/* Empty state */
.table-empty {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-muted);
}

.table-empty svg {
    width: 64px;
    height: 64px;
    margin-bottom: 1rem;
    opacity: 0.3;
}

/* Loading state */
.table-loading {
    position: relative;
    min-height: 200px;
}

.table-loading::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 32px;
    height: 32px;
    border: 3px solid var(--border-color);
    border-top-color: var(--color-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .table {
        font-size: 0.9rem;
    }
    
    .table th,
    .table td {
        padding: 0.75rem 0.5rem;
    }
    
    /* Hide less important columns on mobile */
    .table .d-none-mobile {
        display: none;
    }
}
