/**
 * standard-action-menu.css
 * 操作選單統一樣式 — 基於 tippy.js
 * 
 * 搭配 action-menu.utils.js 使用
 * 全域載入於 _Layout.cshtml
 */

/* =============================================
   觸發按鈕
   ============================================= */

/* 包含觸發按鈕的 td 移除內距，高度交給行高控制 */
td:has(> .action-menu-trigger) {
    padding: 0 !important;
    height: 1px;
    /* CSS trick: 讓子元素 height:100% 能撐滿 */
}

.action-menu-trigger {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    border: none;
    border-radius: 0;
    background: transparent;
    color: #64748b;
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 0;
    font-size: 26px;
    line-height: 1;
}

.action-menu-trigger:hover {
    background: rgba(124, 58, 237, 0.08);
    color: #7c3aed;
    box-shadow: none;
}

.action-menu-trigger:active,
.action-menu-trigger[aria-expanded="true"] {
    background: rgba(124, 58, 237, 0.12);
    color: #7c3aed;
}

/* =============================================
   Tippy 主題覆蓋
   ============================================= */

.tippy-box[data-theme~='action-menu'] {
    background: #fff;
    color: #334155;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12),
        0 2px 8px rgba(0, 0, 0, 0.06);
    padding: 0;
    font-size: 14px;
}

.tippy-box[data-theme~='action-menu'] .tippy-content {
    padding: 6px;
}

.tippy-box[data-theme~='action-menu'] .tippy-arrow {
    color: #fff;
}

/* 箭頭邊框效果 */
.tippy-box[data-theme~='action-menu'] .tippy-arrow::before {
    border-bottom-color: #e2e8f0;
}

/* =============================================
   選單清單
   ============================================= */

.action-menu-list {
    list-style: none;
    margin: 0;
    padding: 0;
    min-width: 160px;
}

/* =============================================
   選單項目
   ============================================= */

.action-menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 14px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s ease;
    font-size: 14px;
    line-height: 1.4;
    color: #334155;
    user-select: none;
    white-space: nowrap;
}

.action-menu-item i {
    font-size: 15px;
    width: 18px;
    text-align: center;
    flex-shrink: 0;
    opacity: 0.7;
}

.action-menu-item:hover {
    background: linear-gradient(135deg, #f5f3ff 0%, #ede9fe 100%);
    color: #7c3aed;
}

.action-menu-item:hover i {
    opacity: 1;
}

.action-menu-item:active {
    background: #ede9fe;
    transform: scale(0.98);
}

/* ── 危險操作（紅色） ── */
.action-menu-item.danger {
    color: #dc2626;
}

.action-menu-item.danger i {
    opacity: 0.8;
}

.action-menu-item.danger:hover {
    background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
    color: #b91c1c;
}

/* ── 成功操作（綠色） ── */
.action-menu-item.success {
    color: #16a34a;
}

.action-menu-item.success:hover {
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
    color: #15803d;
}

/* ── 警告操作（橘色） ── */
.action-menu-item.warning {
    color: #d97706;
}

.action-menu-item.warning:hover {
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
    color: #b45309;
}

/* ── 停用項目 ── */
.action-menu-item.disabled {
    color: #94a3b8;
    cursor: not-allowed;
    opacity: 0.6;
}

.action-menu-item.disabled:hover {
    background: none;
    color: #94a3b8;
    transform: none;
}

/* =============================================
   分隔線
   ============================================= */

.action-menu-divider {
    height: 1px;
    background: #e2e8f0;
    margin: 4px 8px;
    list-style: none;
}

/* =============================================
   狀態列（保留相容性：用於表格左側色條）
   ============================================= */

.action-status-bar {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    border-radius: 2px 0 0 2px;
}

/* =============================================
   RWD
   ============================================= */

@media (max-width: 768px) {
    .action-menu-trigger {
        font-size: 20px;
    }

    .action-menu-item {
        padding: 8px 12px;
        font-size: 13px;
    }
}