/**
 * Entity Table Styles - BOMAtlas
 * Clean, dark theme table for entity browsing
 */

.entity-table-wrapper {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: #0f1923;
    border-radius: 12px;
    overflow: hidden;
}

.entity-table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: #15202b;
    border-bottom: 1px solid #2d3748;
}

.entity-table-search {
    flex: 1;
    max-width: 400px;
}

.table-search-input {
    width: 100%;
    padding: 10px 16px;
    background: #1e2d3d;
    border: 1px solid #3d4f5f;
    border-radius: 8px;
    color: #e2e8f0;
    font-size: 14px;
    transition: border-color 0.2s;
}

.table-search-input:focus {
    outline: none;
    border-color: #00B4D8;
}

.table-search-input::placeholder {
    color: #64748b;
}

.entity-table-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.entity-count {
    color: #94a3b8;
    font-size: 14px;
}

.table-btn {
    padding: 8px 16px;
    background: #1e2d3d;
    border: 1px solid #3d4f5f;
    border-radius: 6px;
    color: #e2e8f0;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
}

.table-btn:hover {
    background: #2d3e4f;
    border-color: #00B4D8;
}

.entity-table-container {
    flex: 1;
    overflow-y: auto;
    overflow-x: auto;
}

.entity-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.entity-table th {
    position: sticky;
    top: 0;
    background: #15202b;
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
    color: #94a3b8;
    border-bottom: 2px solid #2d3748;
    white-space: nowrap;
    z-index: 10;
}

.entity-table th.sortable {
    cursor: pointer;
    user-select: none;
    transition: color 0.2s;
}

.entity-table th.sortable:hover {
    color: #e2e8f0;
}

.entity-table th.active {
    color: #00B4D8;
}

.entity-table th .sort-icon {
    display: inline-block;
    margin-left: 6px;
    width: 0;
    height: 0;
    vertical-align: middle;
}

.entity-table th.sortable .sort-icon::after {
    content: '↕';
    opacity: 0.4;
    font-size: 11px;
}

.entity-table th.active.asc .sort-icon::after {
    content: '↑';
    opacity: 1;
}

.entity-table th.active.desc .sort-icon::after {
    content: '↓';
    opacity: 1;
}

.entity-table tbody tr {
    border-bottom: 1px solid #1e2d3d;
    transition: background 0.15s;
}

.entity-table tbody tr:hover {
    background: rgba(0, 180, 216, 0.08);
    cursor: pointer;
}

.entity-table tbody tr.selected {
    background: rgba(0, 180, 216, 0.15);
}

.entity-table td {
    padding: 12px 16px;
    color: #e2e8f0;
    vertical-align: middle;
}

.entity-table .col-name {
    font-weight: 500;
}

.entity-table .col-city,
.entity-table .col-state {
    color: #94a3b8;
}

.entity-table .empty-row td {
    text-align: center;
    padding: 48px;
    color: #64748b;
}

/* Source badges */
.source-badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    color: white;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

/* Website links */
.website-link {
    color: #00B4D8;
    text-decoration: none;
    transition: color 0.2s;
}

.website-link:hover {
    color: #38bdf8;
    text-decoration: underline;
}

/* Detail tags */
.detail-tag {
    display: inline-block;
    padding: 2px 6px;
    margin-right: 4px;
    margin-bottom: 2px;
    background: #1e2d3d;
    border-radius: 3px;
    font-size: 11px;
    color: #94a3b8;
}

.detail-tag.type {
    background: #2d3e4f;
    color: #cbd5e1;
}

.detail-tag.program {
    background: #064e3b;
    color: #6ee7b7;
}

.detail-tag.industry {
    background: #4c1d95;
    color: #c4b5fd;
}

.detail-tag.cert {
    background: #7c2d12;
    color: #fdba74;
}

.detail-more {
    font-size: 11px;
    color: #64748b;
}

/* Pagination */
.entity-table-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: #15202b;
    border-top: 1px solid #2d3748;
}

.page-btn {
    padding: 8px 16px;
    background: #1e2d3d;
    border: 1px solid #3d4f5f;
    border-radius: 6px;
    color: #e2e8f0;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
}

.page-btn:hover:not(:disabled) {
    background: #2d3e4f;
    border-color: #00B4D8;
}

.page-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.page-info {
    color: #94a3b8;
    font-size: 13px;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .entity-table-header {
        flex-direction: column;
        gap: 12px;
    }

    .entity-table-search {
        max-width: 100%;
        width: 100%;
    }

    .entity-table-actions {
        width: 100%;
        justify-content: space-between;
    }

    .entity-table th,
    .entity-table td {
        padding: 10px 12px;
        font-size: 12px;
    }

    .entity-table .col-details {
        display: none;
    }

    .detail-tag {
        display: none;
    }
}

/* Scrollbar styling */
.entity-table-container::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.entity-table-container::-webkit-scrollbar-track {
    background: #15202b;
}

.entity-table-container::-webkit-scrollbar-thumb {
    background: #3d4f5f;
    border-radius: 4px;
}

.entity-table-container::-webkit-scrollbar-thumb:hover {
    background: #4d5f6f;
}
