/**
 * Z-Index Hierarchy
 * Centralized z-index management for consistent layering
 * 
 * 分层管理 z-index，确保组件层级一致性
 */

export const Z_INDEX = {
  /**
   * Base layer - Normal content
   * 基础层 - 普通内容
   */
  BASE: 0,

  /**
   * Dropdown layer - Dropdown menus and selects (in normal pages)
   * 下拉层 - 普通页面的下拉菜单和选择框
   */
  DROPDOWN: 50,
  
  /**
   * Modal Dropdown layer - Dropdowns in modal (below modal container & header)
   * Modal 下拉层 - Modal 中的下拉框（低于 Modal 容器和标题）
   */
  MODAL_DROPDOWN: 80,

  /**
   * Sticky layer - Sticky headers and navigation
   * 粘性层 - 粘性头部和导航
   */
  STICKY: 60,

  /**
   * Modal backdrop layer - Modal overlay/backdrop
   * Modal 背景层
   */
  MODAL_BACKDROP: 90,

  /**
   * Modal layer - Modal dialogs and drawers
   * Modal 层 - 对话框和抽屉
   */
  MODAL: 100,

  /**
   * Popover layer - Popovers and tooltips inside modals
   * 弹出层 - Modal 内的弹出层和选择框
   */
  POPOVER: 110,

  /**
   * Toast layer - Global notifications
   * 通知层 - 全局通知消息
   */
  TOAST: 200,

  /**
   * Tooltip layer - Temporary tooltips (highest priority)
   * 工具提示层 - 临时提示信息（最高优先级）
   */
  TOOLTIP: 300,
} as const;

/**
 * Tailwind CSS z-index classes mapping
 * Tailwind CSS z-index 类映射
 */
export const Z_INDEX_CLASSES = {
  BASE: 'z-0',
  DROPDOWN: 'z-[50]',
  STICKY: 'z-[60]',
  MODAL_BACKDROP: 'z-[90]',
  MODAL: 'z-[100]',
  POPOVER: 'z-[110]',
  TOAST: 'z-[200]',
  TOOLTIP: 'z-[300]',
} as const;

export type ZIndexLayer = keyof typeof Z_INDEX;

