/**
 * 表格操作按鈕共用樣式
 * 版本: 1.0.0
 * 更新日期: 2024-12-11
 */

/* ===== 操作欄位基本樣式 ===== */
.table-action-cell {
    white-space: nowrap;
    width: 1%;
    padding: 0.5rem !important;
    vertical-align: middle !important;
}

/* 操作欄放最左邊時的樣式 */
.table-action-cell.action-left {
    position: sticky;
    left: 0;
    background-color: inherit;
    z-index: 10;
}

/* ===== 下拉選單按鈕樣式 ===== */
.table-action-dropdown .dropdown-toggle {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    padding: 0.25rem 0.75rem;
    font-size: 16px !important;
    /* User request */
    border-radius: 0.375rem;
    min-width: 70px;
    height: 36px;
    /* Adjusted height for 16px font */
}

.table-action-dropdown .dropdown-toggle::after {
    margin-left: 0.5rem;
}

/* ===== 下拉選單項目樣式 ===== */
.table-action-dropdown .dropdown-menu {
    min-width: 140px;
    padding: 0.5rem 0;
    border-radius: 0.5rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.table-action-dropdown .dropdown-item {
    padding: 0.6rem 1rem;
    font-size: 16px !important;
    /* User request */
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.15s ease;
}

.table-action-dropdown .dropdown-item:hover {
    background-color: #f8f9fa;
}

.table-action-dropdown .dropdown-item.text-primary:hover {
    background-color: rgba(var(--bs-primary-rgb), 0.1);
}

.table-action-dropdown .dropdown-item.text-danger:hover {
    background-color: rgba(var(--bs-danger-rgb), 0.1);
}

.table-action-dropdown .dropdown-item.text-warning:hover {
    background-color: rgba(var(--bs-warning-rgb), 0.1);
}

.table-action-dropdown .dropdown-item.text-success:hover {
    background-color: rgba(var(--bs-success-rgb), 0.1);
}

.table-action-dropdown .dropdown-item.text-info:hover {
    background-color: rgba(var(--bs-info-rgb), 0.1);
}

.table-action-dropdown .dropdown-item.disabled {
    opacity: 0.5;
    pointer-events: none;
}

/* ===== 按鈕組樣式 ===== */
.table-action-buttons {
    display: flex;
    gap: 0.25rem;
    flex-wrap: nowrap;
}

.table-action-buttons .btn {
    padding: 0.25rem 0.5rem;
    font-size: 0.8rem;
}

/* ===== 過期/停用列的操作按鈕樣式 ===== */
tr.row-expired .table-action-dropdown .dropdown-toggle,
tr.row-disabled .table-action-dropdown .dropdown-toggle {
    background-color: #e9ecef !important;
    border-color: #ced4da !important;
    color: #495057 !important;
}

/* ===== RWD 響應式調整 ===== */
@media (max-width: 768px) {
    .table-action-dropdown .dropdown-toggle {
        padding: 0.25rem 0.5rem;
        font-size: 0.8rem;
        min-width: 60px;
    }

    .table-action-dropdown .dropdown-item {
        padding: 0.625rem 1rem;
        font-size: 0.95rem;
    }
}

/* ===== 暗色主題支援 ===== */
@media (prefers-color-scheme: dark) {
    .table-action-dropdown .dropdown-menu {
        background-color: #2d3748;
        border-color: #4a5568;
    }

    .table-action-dropdown .dropdown-item {
        color: #e2e8f0;
    }

    .table-action-dropdown .dropdown-item:hover {
        background-color: #4a5568;
    }
}




