/* UI Widget Table CSS - WordPress Content AI */

/* ===== TABLE STYLES ===== */

/* Base Table Styles */
table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Table Header */
th {
    background: rgba(52, 152, 219, 0.2);
    color: #ecf0f1;
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    border-bottom: 2px solid rgba(52, 152, 219, 0.3);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-transform: uppercase;
    font-size: 0.9rem;
    letter-spacing: 0.5px;
}

/* Table Body */
td {
    padding: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    color: #bdc3c7;
    word-wrap: break-word;
    overflow-wrap: break-word;
    vertical-align: top;
}

/* Table Row Hover Effect */
tr:hover {
    background: rgba(255, 255, 255, 0.05);
    transition: background 0.3s ease;
}

/* Table Row Alternating Colors */
tr:nth-child(even) {
    background: rgba(255, 255, 255, 0.02);
}

tr:nth-child(even):hover {
    background: rgba(255, 255, 255, 0.08);
}

/* Table Container */
.table-container {
    overflow-x: auto;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

/* Table Wrapper */
.table-wrapper {
    overflow-x: auto;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Responsive Table */
@media (max-width: 768px) {
    table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }
    
    th, td {
        padding: 0.75rem;
        font-size: 0.85rem;
    }
    
    th {
        font-size: 0.8rem;
    }
}

/* Table with Fixed Layout */
.table-fixed {
    table-layout: fixed;
}

/* Table with Auto Layout */
.table-auto {
    table-layout: auto;
}

/* Compact Table */
.table-compact th,
.table-compact td {
    padding: 0.5rem;
    font-size: 0.85rem;
}

/* Large Table */
.table-large th,
.table-large td {
    padding: 1.5rem;
    font-size: 1.1rem;
}

/* Table with Borders */
.table-bordered th,
.table-bordered td {
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Table Striped */
.table-striped tr:nth-child(odd) {
    background: rgba(255, 255, 255, 0.02);
}

.table-striped tr:nth-child(odd):hover {
    background: rgba(255, 255, 255, 0.08);
}

/* Table with Centered Content */
.table-centered th,
.table-centered td {
    text-align: center;
}

/* Table with Right Aligned Content */
.table-right th,
.table-right td {
    text-align: right;
}

/* Table with Left Aligned Content */
.table-left th,
.table-left td {
    text-align: left;
}

/* Table Caption */
caption {
    caption-side: bottom;
    padding: 0.5rem;
    color: #bdc3c7;
    font-size: 0.9rem;
    text-align: center;
}

/* Table Footer */
tfoot th,
tfoot td {
    background: rgba(52, 152, 219, 0.1);
    font-weight: 600;
    border-top: 2px solid rgba(52, 152, 219, 0.3);
}

/* Empty State */
.table-empty {
    text-align: center;
    padding: 3rem;
    color: #bdc3c7;
}

.table-empty-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.table-empty h3 {
    color: #ecf0f1;
    margin-bottom: 0.5rem;
}

.table-empty p {
    color: #bdc3c7;
}

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

.table-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    margin: -20px 0 0 -20px;
    border: 3px solid rgba(52, 152, 219, 0.3);
    border-top: 3px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Table Pagination */
.table-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1rem;
    padding: 1rem;
}

.pagination-btn {
    padding: 0.5rem 1rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.05);
    color: #ecf0f1;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    font-size: 0.9rem;
}

.pagination-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
}

.pagination-btn.active {
    background: #3498db;
    border-color: #3498db;
    color: white;
}

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

/* Table Search and Filter */
.table-controls {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.table-search {
    flex: 1;
    min-width: 200px;
}

.table-search input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.05);
    color: #ecf0f1;
}

.table-search input:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

.table-filter {
    min-width: 150px;
}

.table-filter select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.05);
    color: #ecf0f1;
}

.table-filter select:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

/* Responsive Controls */
@media (max-width: 768px) {
    .table-controls {
        flex-direction: column;
    }
    
    .table-search,
    .table-filter {
        min-width: 100%;
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    tr {
        transition: none;
    }
    
    .table-loading::after {
        animation: none;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    th {
        background: #2c3e50;
        color: #ffffff;
        border-bottom: 2px solid #34495e;
    }
    
    td {
        color: #ecf0f1;
        border-bottom: 1px solid #34495e;
    }
    
    tr:hover {
        background: #34495e;
    }
}
