/**
 * 後台管理 - 表格樣式
 * Admin Table Styles
 * 黑金/白金主題 (Black-Gold / White-Gold Theme)
 */

/* ==================== 表格樣式 ==================== */
.table-container {
    background-color: var(--admin-bg-elevated);
    border: 1px solid rgba(212, 165, 32, 0.1);
    border-radius: 0.75rem;
    overflow: hidden;
    min-height: 150px;
}

.light-theme .table-container {
    background: linear-gradient(165deg, rgba(255, 255, 255, 0.99) 0%, rgba(255, 253, 248, 1) 100%);
    border: 1px solid rgba(184, 134, 11, 0.12);
    box-shadow: 0 4px 15px rgba(184, 134, 11, 0.08);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th,
.data-table td {
    padding: 0.875rem 1rem;
    text-align: left;
}

.data-table th {
    background-color: rgba(212, 165, 32, 0.05);
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #888;
    border-bottom: 1px solid rgba(212, 165, 32, 0.15);
}

.data-table th.sortable {
    cursor: pointer;
    user-select: none;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.data-table th.sortable:hover {
    background-color: rgba(212, 165, 32, 0.1);
    color: var(--admin-primary);
}

.data-table th .sort-icon {
    margin-left: 0.5rem;
    font-size: 0.625rem;
    opacity: 0.5;
    transition: opacity 0.2s ease, color 0.2s ease;
}

.data-table th.sortable:hover .sort-icon {
    opacity: 0.8;
}

.data-table th .sort-icon.active {
    opacity: 1;
    color: var(--admin-primary);
}

.light-theme .data-table th {
    background-color: rgba(184, 134, 11, 0.05);
    color: #666;
    border-bottom-color: rgba(184, 134, 11, 0.15);
}

.light-theme .data-table th.sortable:hover {
    background-color: rgba(184, 134, 11, 0.1);
    color: var(--admin-primary-dark);
}

.light-theme .data-table th .sort-icon.active {
    color: var(--admin-primary-dark);
}

.data-table tbody tr {
    border-bottom: 1px solid rgba(212, 165, 32, 0.08);
    transition: background-color 0.2s ease;
}

/* 斑馬紋樣式 - 奇數列 */
.data-table tbody tr:nth-child(odd) {
    background-color: rgba(255, 255, 255, 0.02);
}

/* 斑馬紋樣式 - 偶數列 */
.data-table tbody tr:nth-child(even) {
    background-color: rgba(0, 0, 0, 0.15);
}

.data-table tbody tr:hover {
    background-color: rgba(212, 165, 32, 0.08);
}

.light-theme .data-table tbody tr {
    border-bottom-color: rgba(184, 134, 11, 0.08);
}

/* 淺色主題斑馬紋 */
.light-theme .data-table tbody tr:nth-child(odd) {
    background-color: #fff;
}

.light-theme .data-table tbody tr:nth-child(even) {
    background-color: rgba(184, 134, 11, 0.02);
}

.light-theme .data-table tbody tr:hover {
    background-color: rgba(184, 134, 11, 0.08);
}

.data-table tbody tr:last-child {
    border-bottom: none;
}

.actions-cell {
    display: flex;
    gap: 0.5rem;
}

/* Badge 樣式 */
.role-badge,
.status-badge {
    display: inline-block;
    padding: 0.25rem 0.625rem;
    border-radius: 1rem;
    font-size: 0.75rem;
    font-weight: 500;
}

/* 角色欄位容器 */
.role-cell {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    align-items: center;
}

.role-cell .role-badge {
    margin: 0;
    white-space: nowrap;
}

.role-badge.role-empty {
    background-color: rgba(107, 114, 128, 0.2);
    color: #6b7280;
}

.role-badge.role-admin {
    background-color: rgba(212, 165, 32, 0.2);
    color: var(--admin-primary);
}

.role-badge.role-user {
    background-color: rgba(212, 165, 32, 0.2);
    color: var(--admin-primary);
}

.light-theme .role-badge.role-user {
    background-color: rgba(184, 134, 11, 0.15);
    color: var(--admin-primary-dark);
}

.role-badge.role-viewer {
    background-color: rgba(156, 39, 176, 0.2);
    color: #9c27b0;
}

.role-badge.role-guest {
    background-color: rgba(158, 158, 158, 0.2);
    color: #9e9e9e;
}

.role-badge.role-developer {
    background-color: rgba(255, 193, 7, 0.2);
    color: #ffc107;
}

/* 遊戲角色樣式 - Game Role Styles */
.role-badge.role-game,
.role-badge[class*="role-game_"] {
    background-color: rgba(244, 67, 54, 0.2);
    color: #f44336;
}

.role-badge.role-game_llg {
    background-color: rgba(244, 67, 54, 0.2);
    color: #f44336;
}

.role-badge.role-game_fada {
    background-color: rgba(244, 67, 54, 0.2);
    color: #f44336;
}

.role-badge.role-game_combo {
    background-color: rgba(244, 67, 54, 0.2);
    color: #f44336;
}

.role-badge.role-game_account_verifier {
    background-color: rgba(244, 67, 54, 0.2);
    color: #f44336;
}

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

.status-badge.status-inactive,
.status-badge.inactive {
    background-color: rgba(255, 107, 107, 0.2);
    color: #ff6b6b;
}

/* 遊戲帳號標籤 */
.game-account-badge {
    display: inline-block;
    padding: 0.25rem 0.625rem;
    border-radius: 1rem;
    font-size: 0.75rem;
    font-weight: 500;
    background-color: rgba(158, 158, 158, 0.2);
    color: #9e9e9e;
}

.game-account-badge.is-game {
    background-color: rgba(76, 175, 80, 0.2);
    color: #4caf50;
}

/* 環境 URL 樣式 */
.env-url {
    display: inline-block;
    max-width: 20rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 0.8125rem;
    color: var(--admin-primary);
    background-color: rgba(212, 165, 32, 0.1);
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
}

.light-theme .env-url {
    color: var(--admin-primary-dark);
    background-color: rgba(184, 134, 11, 0.1);
}

/* ==================== 分頁 ==================== */
.pagination {
    display: flex;
    justify-content: center;
    gap: 0.25rem;
    margin-top: 1.5rem;
}

.pagination button {
    padding: 0.5rem 0.875rem;
    background-color: #2a2a2a;
    border: 1px solid rgba(212, 165, 32, 0.2);
    border-radius: 0.375rem;
    color: #b0b0b0;
    cursor: pointer;
    transition: all 0.2s ease;
}

.pagination button:hover,
.pagination button.active {
    background: linear-gradient(135deg, #d4a520 0%, #b8860b 100%);
    border-color: var(--admin-primary);
    color: #fff;
    box-shadow: 0 4px 12px rgba(212, 165, 32, 0.3);
}

.light-theme .pagination button {
    background-color: #f5f5f5;
    border-color: rgba(184, 134, 11, 0.15);
    color: #666;
}

.light-theme .pagination button:hover,
.light-theme .pagination button.active {
    background: linear-gradient(135deg, #d4a520 0%, #b8860b 100%);
    border-color: var(--admin-primary-dark);
    color: #fff;
}
