/* ============================================================
   REPLIKA · CURSOR PERSONALIZADO GLOBAL (toda la app: dashboard + login)
   Montado por js/cursor.js. Cursor nativo oculto; el cursor NUNCA cambia
   de forma (sin I-beam ni pointer): solo feedback de clic (escala) y un
   anillo al clic derecho. La hojilla (is-blade) la activa MasterCut.
   ============================================================ */
/* Cursor de replika como cursor NATIVO (imagen): lo dibuja el sistema, no la
   página, así que nunca se congela ni desaparece aunque la página vaya lenta
   (antes era un div movido por JS y en equipos modestos "se perdía").
   Misma flecha y sombra; en campos de texto se deja la I nativa. */
html {
  cursor: url("../assets/CURSOR_BLANCO_24.png") 5 5, auto;
  cursor: -webkit-image-set(url("../assets/CURSOR_BLANCO_24.png") 1x, url("../assets/CURSOR_BLANCO_48.png") 2x) 5 5, auto;
  cursor: image-set(url("../assets/CURSOR_BLANCO_24.png") 1x, url("../assets/CURSOR_BLANCO_48.png") 2x) 5 5, auto;
}
:root[data-theme="light"] {
  cursor: url("../assets/CURSOR_NEGRO_24.png") 5 5, auto;
  cursor: -webkit-image-set(url("../assets/CURSOR_NEGRO_24.png") 1x, url("../assets/CURSOR_NEGRO_48.png") 2x) 5 5, auto;
  cursor: image-set(url("../assets/CURSOR_NEGRO_24.png") 1x, url("../assets/CURSOR_NEGRO_48.png") 2x) 5 5, auto;
}
/* La forma no cambia al pasar por botones o enlaces (mismo criterio de siempre) */
html *:not(input):not(textarea):not(select):not([contenteditable="true"]) { cursor: inherit; }

/* Solo en los modos especiales (hojilla de MasterCut, manos del Workflow) se
   oculta el nativo y se pinta el div de js/cursor.js. */
html.mc-cursor-on, html.mc-cursor-on * { cursor: none !important; }
.mc-cursor:not(.is-blade):not(.is-grab):not(.is-grabbing) { display: none; }

.mc-cursor {
  position: fixed;
  top: 0; left: 0;
  z-index: 100000;
  pointer-events: none;
  will-change: transform;
  transition: opacity .15s ease;
}
.mc-cursor-img {
  width: 24px; height: 24px;
  margin: -5px 0 0 -5px;   /* hotspot cerca de la punta */
  background: url("../assets/CURSOR_BLANCO_64.png") center/contain no-repeat;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,.55));
  transition: transform .08s ease;
}
.mc-cursor.is-down .mc-cursor-img { transform: scale(.82); }
:root[data-theme="light"] .mc-cursor-img { background-image: url("../assets/CURSOR_NEGRO_64.png"); }

/* hojilla — cuando la herramienta cuchilla de MasterCut está activa */
.mc-cursor-blade {
  position: absolute;
  width: 30px; height: 30px;
  margin: -3px 0 0 -3px;
  display: none;
  stroke: #fff; stroke-width: 1.8; fill: rgba(255,255,255,.14);
  stroke-linejoin: round; stroke-linecap: round;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,.6));
}
:root[data-theme="light"] .mc-cursor-blade { stroke: #111; fill: rgba(0,0,0,.1); filter: drop-shadow(0 1px 2px rgba(255,255,255,.5)); }
.mc-cursor.is-blade .mc-cursor-img { display: none; }
.mc-cursor.is-blade .mc-cursor-blade { display: block; }

/* manos — arrastrar un lienzo (Workflow Studio).
   Misma mecánica que la hojilla: una clase cambia la forma. `is-grab` es la
   mano abierta (se puede agarrar) y `is-grabbing` la cerrada (agarrando). */
.mc-cursor-hand, .mc-cursor-fist {
  position: absolute;
  width: 26px; height: 26px;
  margin: -4px 0 0 -6px;
  display: none;
  stroke: #fff; stroke-width: 1.7; fill: rgba(0,0,0,.35);
  stroke-linejoin: round; stroke-linecap: round;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,.6));
}
:root[data-theme="light"] .mc-cursor-hand,
:root[data-theme="light"] .mc-cursor-fist { stroke: #111; fill: rgba(255,255,255,.5); filter: drop-shadow(0 1px 2px rgba(255,255,255,.6)); }
.mc-cursor.is-grab .mc-cursor-img,
.mc-cursor.is-grabbing .mc-cursor-img { display: none; }
.mc-cursor.is-grab .mc-cursor-hand { display: block; }
.mc-cursor.is-grabbing .mc-cursor-fist { display: block; }
/* La mano cerrada manda sobre la abierta: al apretar se ve el puño aunque
   siga activo el modo "se puede agarrar". */
.mc-cursor.is-grabbing .mc-cursor-hand { display: none; }
/* Y no encoge al pulsar: el cambio de forma ya dice que se ha agarrado */
.mc-cursor.is-grabbing.is-down .mc-cursor-fist { transform: none; }

/* anillo del clic derecho — la ÚNICA animación */
.mc-cursor-ring {
  position: absolute;
  width: 30px; height: 30px;
  margin: -15px 0 0 -15px;
  border: 2px solid rgba(255,255,255,.75);
  border-radius: 50%;
  opacity: 0;
  transform: scale(.2);
}
:root[data-theme="light"] .mc-cursor-ring { border-color: rgba(0,0,0,.55); }
.mc-cursor.is-rclick .mc-cursor-ring { animation: mc-rclick .5s var(--ease-out-cine, cubic-bezier(.16,1,.3,1)); }
@keyframes mc-rclick {
  0%   { opacity: .85; transform: scale(.2); }
  100% { opacity: 0; transform: scale(1.7); }
}
@media (prefers-reduced-motion: reduce) { .mc-cursor.is-rclick .mc-cursor-ring { animation: none; } }
