/* ==========================================================================
   ARCHCRAFT LUXURY CUSTOM MOUSE CURSOR SYSTEM
   Replication of CaseThemes Archcraft custom cursor & magnetic follower
   ========================================================================== */

/* Hide custom cursor on mobile, tablet & touch devices */
@media screen and (max-width: 991px), (hover: none), (pointer: coarse) {
  .pxl-cursor,
  .pxl-js-cursor {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
  }
}

/* Base Cursor Container */
@media screen and (min-width: 992px) and (hover: hover) {
  .pxl-cursor,
  .pxl-js-cursor {
    position: fixed;
    top: 0;
    left: 0;
    width: 40px;
    height: 40px;
    margin: 0;
    padding: 0;
    pointer-events: none;
    z-index: 9999999;
    opacity: 0;
    visibility: hidden;
    transform: translate(-100px, -100px);
    transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1),
                visibility 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: transform;
    contain: layout style;
  }

  .pxl-cursor.is-enabled {
    opacity: 1;
    visibility: visible;
  }

  .pxl-cursor.is-hidden {
    opacity: 0 !important;
    visibility: hidden !important;
  }

  /* Internal Centering Wrapper */
  .pxl-cursor-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  /* Follower Ring & Inner Pointer Dot */
  .pxl-cursor--follower,
  .pxl-js-follower {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 36px;
    height: 36px;
    margin-top: -18px;
    margin-left: -18px;
    border-radius: 50%;
    border: 1.5px solid #CAA05C;
    background-color: transparent;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1),
                width 0.28s cubic-bezier(0.16, 1, 0.3, 1),
                height 0.28s cubic-bezier(0.16, 1, 0.3, 1),
                margin 0.28s cubic-bezier(0.16, 1, 0.3, 1),
                background-color 0.25s ease,
                border-color 0.25s ease,
                box-shadow 0.3s ease;
    pointer-events: none;
  }

  /* Central Precision Dot */
  .pxl-cursor--follower::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 6px;
    height: 6px;
    margin-top: -3px;
    margin-left: -3px;
    border-radius: 50%;
    background-color: #CAA05C;
    transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1),
                opacity 0.2s ease,
                background-color 0.2s ease;
    pointer-events: none;
  }

  /* --------------------------------------------------------------------------
     INTERACTIVE HOVER STATE (.is-active)
     Expands softly over links, buttons, and clickable controls
     -------------------------------------------------------------------------- */
  .pxl-cursor.is-active .pxl-cursor--follower {
    transform: scale(1.6);
    background-color: rgba(202, 160, 92, 0.16);
    border-color: #CAA05C;
    box-shadow: 0 0 20px rgba(202, 160, 92, 0.25);
  }

  .pxl-cursor.is-active .pxl-cursor--follower::before {
    transform: scale(0);
    opacity: 0;
  }

  /* --------------------------------------------------------------------------
     CLICK / MOUSE DOWN STATE (.is-mouse-down)
     Spring compression on click
     -------------------------------------------------------------------------- */
  .pxl-cursor.is-mouse-down .pxl-cursor--follower {
    transform: scale(0.82) !important;
    background-color: rgba(202, 160, 92, 0.35) !important;
    border-color: #CAA05C !important;
  }

  /* --------------------------------------------------------------------------
     DRAG BADGE (.has-drap)
     Expands into a luxury golden circle with "DRAG" typography on sliders
     -------------------------------------------------------------------------- */
  .pxl-cursor.has-drap .pxl-cursor--follower {
    width: 82px;
    height: 82px;
    margin-top: -41px;
    margin-left: -41px;
    transform: scale(1);
    background-color: #CAA05C;
    border-color: #CAA05C;
    box-shadow: 0 12px 32px rgba(202, 160, 92, 0.45);
  }

  .pxl-cursor.has-drap .pxl-cursor--follower::before {
    display: none;
    opacity: 0;
  }

  .pxl-cursor--drap,
  .pxl-js-drap {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.8);
    font-family: 'Bricolage Grotesque', -apple-system, sans-serif;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: #FFFFFF;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.22s ease, transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 3;
    user-select: none;
  }

  .pxl-cursor.has-drap .pxl-cursor--drap {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }

  /* --------------------------------------------------------------------------
     LABEL BADGE (.has-label)
     Expands into a luxury badge with custom text (e.g., "VIEW", "EXPLORE")
     -------------------------------------------------------------------------- */
  .pxl-cursor.has-label .pxl-cursor--follower {
    width: 82px;
    height: 82px;
    margin-top: -41px;
    margin-left: -41px;
    transform: scale(1);
    background-color: #CAA05C;
    border-color: #CAA05C;
    box-shadow: 0 12px 32px rgba(202, 160, 92, 0.45);
  }

  .pxl-cursor.has-label .pxl-cursor--follower::before {
    display: none;
    opacity: 0;
  }

  .pxl-cursor--label,
  .pxl-js-label {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.8);
    font-family: 'Bricolage Grotesque', -apple-system, sans-serif;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: #FFFFFF;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.22s ease, transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 3;
    user-select: none;
  }

  .pxl-cursor.has-label .pxl-cursor--label {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }

  /* --------------------------------------------------------------------------
     ICON BADGE (.has-icon)
     -------------------------------------------------------------------------- */
  .pxl-cursor--icon,
  .pxl-js-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.8);
    font-size: 14px;
    color: #FFFFFF;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.22s ease, transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .pxl-cursor.has-icon .pxl-cursor--icon {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }

  .pxl-cursor.has-icon .pxl-cursor--follower {
    width: 60px;
    height: 60px;
    margin-top: -30px;
    margin-left: -30px;
    background-color: #CAA05C;
    border-color: #CAA05C;
  }

  .pxl-cursor.has-icon .pxl-cursor--follower::before {
    display: none;
    opacity: 0;
  }

  /* Hide OS pointer over DRAG / VIEW containers for pure luxury aesthetic */
  [data-cursor-drap],
  [data-cursor-drap] * {
    cursor: none !important;
  }
  [data-cursor-label],
  [data-cursor-label] * {
    cursor: none !important;
  }
  /* Restore pointer on interactive controls inside badges */
  [data-cursor-drap] a,
  [data-cursor-drap] button,
  [data-cursor-drap] .btn,
  [data-cursor-label] a,
  [data-cursor-label] button,
  [data-cursor-label] .btn {
    cursor: pointer !important;
  }
}
