/* 메이플스토리 테마 커서 - 프로토타입 전용 */

:root {
  /* 오버레이 커서 오프셋 (조정 가능) */
  --cursor-overlay-offset-x: 0px;
  --cursor-overlay-offset-y: 0px;
  
  /* 기본 커서 */
  --cursor-default-static: url('../cursors/maple/static/point.cur') 0 0, auto;
  --cursor-default: var(--cursor-default-static);

  /* 링크 / 버튼 */
  --cursor-link-static: url('../cursors/maple/static/point_click.cur') 0 0, auto;
  --cursor-link: var(--cursor-link-static);

  /* 드래그 / 그랩 */
  --cursor-grab-static: url('../cursors/maple/static/grab.cur') 0 0, grab;
  --cursor-grab: var(--cursor-grab-static);

  /* 로딩 / 대기 */
  --cursor-wait-static: url('../cursors/maple/static/meso_coin_gold.cur') 0 0, wait;
  --cursor-wait: var(--cursor-wait-static);

  /* 백그라운드 작업 */
  --cursor-working-static: url('../cursors/maple/static/point_dice.cur') 0 0, progress;
  --cursor-working: var(--cursor-working-static);

  /* 금지 */
  --cursor-unavailable-static: url('../cursors/maple/static/point_not_allowed.cur') 0 0, not-allowed;
  --cursor-unavailable: var(--cursor-unavailable-static);

  /* 도움말 */
  --cursor-help-static: url('../cursors/maple/static/magnifying_glass_click.cur') 0 0, help;
  --cursor-help: var(--cursor-help-static);

  /* 버튼 클릭 */
  --cursor-button-click-static: url('../cursors/maple/static/point_click.cur') 0 0, pointer;
  --cursor-button-click: var(--cursor-button-click-static);

  /* 위치, 인물 */
  --cursor-location-static: url('../cursors/maple/static/point_house.cur') 0 0, crosshair;
  --cursor-location: var(--cursor-location-static);

  --cursor-person-static: url('../cursors/maple/static/point_present.cur') 0 0, cell;
  --cursor-person: var(--cursor-person-static);

  /* 리사이즈 */
  --cursor-resize-vertical-static: url('../cursors/maple/static/point_vertical_green.cur') 0 0, ns-resize;
  --cursor-resize-vertical: var(--cursor-resize-vertical-static);

  --cursor-resize-horizontal-static: url('../cursors/maple/static/point_horizontal_green.cur') 0 0, ew-resize;
  --cursor-resize-horizontal: var(--cursor-resize-horizontal-static);

  --cursor-resize-diagonal1-static: url('../cursors/maple/static/point_diagonal_green.cur') 0 0, nesw-resize;
  --cursor-resize-diagonal1: var(--cursor-resize-diagonal1-static);

  --cursor-resize-diagonal2-static: url('../cursors/maple/static/point_diagonal_2_green.cur') 0 0, nwse-resize;
  --cursor-resize-diagonal2: var(--cursor-resize-diagonal2-static);

  /* 마우스 버튼 눌림 */
  --cursor-pressed-static: url('../cursors/maple/static/point_low.cur') 0 0, pointer;
  --cursor-pressed: var(--cursor-pressed-static);
}

/* Overlay element for animated GIF cursor (follower) */
.maple-cursor-overlay {
  pointer-events: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 0;
  height: 0;
  z-index: 2147483647;
}

.maple-cursor-overlay__image {
  position: absolute;
  display: block;
  width: auto;
  height: auto;
  max-width: 64px;
  max-height: 64px;
  transform: translate(var(--cursor-overlay-offset-x), var(--cursor-overlay-offset-y));
  image-rendering: optimizeQuality;
  pointer-events: none;
}

/* 오버레이 활성화 시 모든 네이티브 커서 숨김 (최우선 순위) */
html.maple-cursor-overlay-active,
html.maple-cursor-overlay-active *,
html.maple-cursor-overlay-active body,
html.maple-cursor-overlay-active button,
html.maple-cursor-overlay-active .btn,
html.maple-cursor-overlay-active [role="button"],
html.maple-cursor-overlay-active a,
html.maple-cursor-overlay-active li,
html.maple-cursor-overlay-active .switch,
html.maple-cursor-overlay-active input,
html.maple-cursor-overlay-active .slider,
html.maple-cursor-overlay-active .job-pill,
html.maple-cursor-overlay-active div button,
html.maple-cursor-overlay-active div .btn,
html.maple-cursor-overlay-active div [role="button"],
html.maple-cursor-overlay-active div .job-pill,
html.maple-cursor-overlay-active div li,
html.maple-cursor-overlay-active section button,
html.maple-cursor-overlay-active section .btn,
html.maple-cursor-overlay-active section [role="button"],
html.maple-cursor-overlay-active section .job-pill,
html.maple-cursor-overlay-active section li,
html.maple-cursor-overlay-active #jobGrid li a,
html.maple-cursor-overlay-active .skill-item,
html.maple-cursor-overlay-active .skill-grid .skill-item,
html.maple-cursor-overlay-active #skillSelectionSection .skill-label-wrapper,
html.maple-cursor-overlay-active #skillSelectionSection .skill-left-content,
html.maple-cursor-overlay-active #skillSelectionSection .skill-name,
html.maple-cursor-overlay-active #skillSelectionSection .skill-name-en,
html.maple-cursor-overlay-active #skillSelectionSection .skill-category-label,
html.maple-cursor-overlay-active #skillSelectionSection .optional,
html.maple-cursor-overlay-active #skillSelectionSection .three-stage-toggle,
html.maple-cursor-overlay-active #skillSelectionSection .toggle-slider,
html.maple-cursor-overlay-active #skillSelectionSection .mode-labels,
html.maple-cursor-overlay-active #skillSelectionSection .exact-label,
html.maple-cursor-overlay-active #skillSelectionSection .guide-label,
html.maple-cursor-overlay-active #skillSelectionSection .flexible-label,
html.maple-cursor-overlay-active #skillSelectionSection .mode-badge,
html.maple-cursor-overlay-active .three-stage-toggle,
html.maple-cursor-overlay-active .toggle-slider,
html.maple-cursor-overlay-active .mode-labels,
html.maple-cursor-overlay-active .exact-label,
html.maple-cursor-overlay-active .guide-label,
html.maple-cursor-overlay-active .flexible-label,
html.maple-cursor-overlay-active .mode-badge {
  cursor: none !important;
}

html,
body {
  cursor: var(--cursor-default);
}

/* 상태별 클래스 (애니메이션 우선) */
html.maple-cursor--default { cursor: var(--cursor-default); }
html.maple-cursor--link { cursor: var(--cursor-link); }
html.maple-cursor--grab { cursor: var(--cursor-grab); }
html.maple-cursor--wait { cursor: var(--cursor-wait); }
html.maple-cursor--working { cursor: var(--cursor-working); }
html.maple-cursor--unavailable { cursor: var(--cursor-unavailable); }
html.maple-cursor--help { cursor: var(--cursor-help); }
html.maple-cursor--location { cursor: var(--cursor-location); }
html.maple-cursor--person { cursor: var(--cursor-person); }
html.maple-cursor--resize-vertical { cursor: var(--cursor-resize-vertical); }
html.maple-cursor--resize-horizontal { cursor: var(--cursor-resize-horizontal); }
html.maple-cursor--resize-diagonal1 { cursor: var(--cursor-resize-diagonal1); }
html.maple-cursor--resize-diagonal2 { cursor: var(--cursor-resize-diagonal2); }
html.maple-cursor--pressed { cursor: var(--cursor-pressed); }

/* 요소별 기본 커서 설정 */
html button,
html .btn,
html [role="button"],
html .job-pill,
html li,
body button,
body .btn,
body [role="button"],
body .job-pill,
body li,
div button,
div .btn,
div [role="button"],
div .job-pill,
div li,
section button,
section .btn,
section [role="button"],
section .job-pill,
section li,
.switch,
.switch input,
.switch .slider {
  cursor: var(--cursor-button-click) !important;
}

/* 직업 카드와 스킬 아이템은 버튼 클릭 커서 사용 */
#jobGrid li a,
.skill-item,
.skill-grid .skill-item,
#skillSelectionSection .skill-label-wrapper,
#skillSelectionSection .skill-left-content,
#skillSelectionSection .skill-name,
#skillSelectionSection .skill-name-en,
#skillSelectionSection .skill-category-label,
#skillSelectionSection .optional,
/* 모드 선택 토글 요소들 */
#skillSelectionSection .three-stage-toggle,
#skillSelectionSection .toggle-slider,
#skillSelectionSection .mode-labels,
#skillSelectionSection .exact-label,
#skillSelectionSection .guide-label,
#skillSelectionSection .flexible-label,
#skillSelectionSection .mode-badge {
  cursor: var(--cursor-button-click) !important;
}

/* 일반 링크는 링크 커서 사용 */
nav a,
a[href] {
  cursor: var(--cursor-link);
}

a[href]:hover {
  cursor: var(--cursor-link);
}

button:hover,
.btn:hover,
[role="button"]:hover {
  cursor: var(--cursor-button-click);
}

button:disabled,
.btn:disabled,
[role="button"]:disabled,
.is-disabled,
[aria-disabled="true"] {
  cursor: var(--cursor-unavailable) !important;
}

.dropzone,
[aria-dropeffect],
[data-draggable="true"],
.drag-handle {
  cursor: var(--cursor-grab);
}

.loading,
[aria-busy="true"],
.is-loading {
  cursor: var(--cursor-wait);
}

[title],
[aria-label*="도움"],
[data-tooltip] {
  cursor: var(--cursor-help);
}

.resize-handle {
  cursor: var(--cursor-resize-diagonal1);
}

.resize-handle.vertical {
  cursor: var(--cursor-resize-vertical);
}

.resize-handle.horizontal {
  cursor: var(--cursor-resize-horizontal);
}

/* 접근성: 애니메이션 비활성 시 정적 커서로 대체 */
@media (prefers-reduced-motion: reduce) {
  html,
  body { cursor: var(--cursor-default-static); }

  html.maple-cursor--default { cursor: var(--cursor-default-static); }
  html.maple-cursor--link { cursor: var(--cursor-link-static); }
  html.maple-cursor--grab { cursor: var(--cursor-grab-static); }
  html.maple-cursor--wait { cursor: var(--cursor-wait-static); }
  html.maple-cursor--working { cursor: var(--cursor-working-static); }
  html.maple-cursor--unavailable { cursor: var(--cursor-unavailable-static); }
  html.maple-cursor--help { cursor: var(--cursor-help-static); }
  html.maple-cursor--location { cursor: var(--cursor-location-static); }
  html.maple-cursor--person { cursor: var(--cursor-person-static); }
  html.maple-cursor--resize-vertical { cursor: var(--cursor-resize-vertical-static); }
  html.maple-cursor--resize-horizontal { cursor: var(--cursor-resize-horizontal-static); }
  html.maple-cursor--resize-diagonal1 { cursor: var(--cursor-resize-diagonal1-static); }
  html.maple-cursor--resize-diagonal2 { cursor: var(--cursor-resize-diagonal2-static); }
  html.maple-cursor--pressed { cursor: var(--cursor-pressed-static); }

  html button,
  html .btn,
  html [role="button"],
  html .job-pill,
  html li,
  body button,
  body .btn,
  body [role="button"],
  body .job-pill,
  body li,
  .switch,
  .switch input,
  .switch .slider { cursor: var(--cursor-button-click-static); }

  /* 직업 카드와 스킬 아이템은 버튼 클릭 커서 사용 */
  #jobGrid li a,
  .skill-item,
  .skill-grid .skill-item,
  #skillSelectionSection .skill-label-wrapper,
  #skillSelectionSection .skill-left-content,
  #skillSelectionSection .skill-name,
  #skillSelectionSection .skill-name-en,
  #skillSelectionSection .skill-category-label,
  #skillSelectionSection .optional,
  /* 모드 선택 토글 요소들 */
  #skillSelectionSection .three-stage-toggle,
  #skillSelectionSection .toggle-slider,
  #skillSelectionSection .mode-labels,
  #skillSelectionSection .exact-label,
  #skillSelectionSection .guide-label,
  #skillSelectionSection .flexible-label,
  #skillSelectionSection .mode-badge { cursor: var(--cursor-button-click-static); }

  nav a,
  a[href] { cursor: var(--cursor-link-static); }

  button:disabled,
  .btn:disabled,
  [role="button"]:disabled,
  .is-disabled,
  [aria-disabled="true"] { cursor: var(--cursor-unavailable-static); }

  .dropzone,
  [aria-dropeffect],
  [data-draggable="true"],
  .drag-handle { cursor: var(--cursor-grab-static); }

  .loading,
  [aria-busy="true"],
  .is-loading { cursor: var(--cursor-wait-static); }

  [title],
  [aria-label*="도움"],
  [data-tooltip] { cursor: var(--cursor-help-static); }

  .resize-handle { cursor: var(--cursor-resize-diagonal1-static); }
  .resize-handle.vertical { cursor: var(--cursor-resize-vertical-static); }
  .resize-handle.horizontal { cursor: var(--cursor-resize-horizontal-static); }
}

/* 터치 기기: 기본 커서 */
@media (pointer: coarse) {
  html,
  body,
  html[class*="maple-cursor--"],
  body[class*="maple-cursor--"] {
    cursor: auto;
  }
}
