/*
 * Centralized cursor management for Spongmonkeys project
 * This file defines cursor styles for all states
 * Cursor is now set to be even smaller (approximately 10% of original size)
 */

/*
 * Force the custom cursor on ALL elements, including iframes and their contents
 */

html,
body,
*,
*::before,
*::after {
    cursor: url('../media/cursor.webp') 3 3, auto !important;
}

/* Apply to all elements within iframes */
iframe {
    cursor: url('../media/cursor.webp') 3 3, auto !important;
}

/* Ensure cursor applies to all document elements */
:root,
:root * {
    cursor: url('../media/cursor.webp') 3 3, auto !important;
}

/* Specific cursor states with higher specificity */
html *:hover,
body *:hover,
a:hover,
button:hover,
input:hover,
select:hover,
.grid-item:hover,
[role="button"]:hover,
.btn:hover,
.window-title-bar button:hover {
    cursor: url('../media/cursor.webp') 3 3, pointer !important;
}

/* Text selection cursor with higher specificity */
html input,
body input,
html textarea,
body textarea,
[contenteditable="true"],
p,
h1,
h2,
h3,
h4,
h5,
h6,
span,
div:not(button *),
.window-content p,
.window-content div,
.window-content span,
iframe body,
iframe p,
iframe div,
iframe span {
    cursor: url('../media/cursor.webp') 3 3, text !important;
}

/* Wait cursor */
*:is(:waiting, .loading),
html.loading *,
body.loading * {
    cursor: url('../media/cursor.webp') 3 3, wait !important;
}

/* Not-allowed cursor */
html *:disabled,
body *:disabled,
.disabled,
[aria-disabled="true"] {
    cursor: url('../media/cursor.webp') 3 3, not-allowed !important;
}

/* Move cursor */
.draggable,
.window-title-bar,
.window-header {
    cursor: url('../media/cursor.webp') 3 3, move !important;
}

/* Resize cursors */
.resizable-e,
.window-resize-e {
    cursor: url('../media/cursor.webp') 3 3, e-resize !important;
}

.resizable-w,
.window-resize-w {
    cursor: url('../media/cursor.webp') 3 3, w-resize !important;
}

.resizable-n,
.window-resize-n {
    cursor: url('../media/cursor.webp') 3 3, n-resize !important;
}

.resizable-s,
.window-resize-s {
    cursor: url('../media/cursor.webp') 3 3, s-resize !important;
}

.resizable-ne,
.window-resize-ne {
    cursor: url('../media/cursor.webp') 3 3, ne-resize !important;
}

.resizable-nw,
.window-resize-nw {
    cursor: url('../media/cursor.webp') 3 3, nw-resize !important;
}

.resizable-se,
.window-resize-se {
    cursor: url('../media/cursor.webp') 3 3, se-resize !important;
}

.resizable-sw,
.window-resize-sw {
    cursor: url('../media/cursor.webp') 3 3, sw-resize !important;
}

/* Explicitly target scrollbar elements */
::-webkit-scrollbar,
::-webkit-scrollbar-button,
::-webkit-scrollbar-track,
::-webkit-scrollbar-track-piece,
::-webkit-scrollbar-thumb,
::-webkit-scrollbar-corner {
    cursor: url('../media/cursor.webp') 3 3, auto !important;
}

/* Target elements within iframes specifically */
iframe html,
iframe body,
iframe * {
    cursor: url('../media/cursor.webp') 3 3, auto !important;
}

/* Ensure cursor is applied to all window content */
.window-content,
.window-content *,
.window iframe,
.window iframe * {
    cursor: url('../media/cursor.webp') 3 3, auto !important;
}