/**
 * 🖱️ Custom Cursor Styles
 * Pixel Art 2D Game Cursor System
 */

/* ===== BASE CURSOR STYLES ===== */
* {
  cursor: url('./default.cur'), auto !important;
}

/* Remove default cursor outline on focus */
*:focus {
  outline: none;
}

/* ===== INTERACTIVE ELEMENTS ===== */
button,
a,
.clickable,
.interactive,
.pixel-button,
[role="button"],
input[type="button"],
input[type="submit"],
select {
  cursor: url('./link.cur'), pointer !important;
}

/* Hover state for buttons */
button:hover,
a:hover,
.clickable:hover,
.interactive:hover {
  cursor: url('./link.cur'), pointer !important;
}

/* Active/Pressed state */
button:active,
a:active,
.clickable:active {
  cursor: url('./link.cur'), pointer !important;
}

/* ===== TEXT INPUT ELEMENTS ===== */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="search"],
input[type="number"],
textarea,
.text-input,
[contenteditable="true"] {
  cursor: url('./Text-Select.cur'), text !important;
}

/* ===== DISABLED ELEMENTS ===== */
button:disabled,
input:disabled,
select:disabled,
textarea:disabled,
.disabled,
[disabled],
[aria-disabled="true"] {
  cursor: url('./default.cur'), not-allowed !important;
  opacity: 0.5;
}

/* ===== DRAGGABLE ELEMENTS ===== */
.draggable {
  cursor: url('./default.cur'), grab !important;
}

.draggable:active,
.dragging {
  cursor: url('./default.cur'), grabbing !important;
}

/* ===== GAME SPECIFIC CURSORS ===== */

/* Canvas (Phaser game area) */
canvas {
  cursor: url('./default.cur'), auto !important;
}

/* Farm tiles */
.farm-tile {
  cursor: url('./default.cur'), auto !important;
}

.farm-tile.interactive:hover {
  cursor: url('./link.cur'), pointer !important;
}

/* Shop UI */
.shop-container,
.shop-panel {
  cursor: url('./default.cur'), auto !important;
}

.shop-item,
.shop-button {
  cursor: url('./link.cur'), pointer !important;
}

/* HUD elements */
.hud-container {
  cursor: url('./default.cur'), auto !important;
}

.hud-button,
.seed-selector {
  cursor: url('./link.cur'), pointer !important;
}

/* Menu items */
.menu-item,
.menu-button {
  cursor: url('./link.cur'), pointer !important;
}

/* ===== CURSOR ANIMATIONS ===== */

/* Smooth cursor transitions */
* {
  transition: cursor 0.1s ease;
}

/* Pulse effect for important buttons */
@keyframes cursor-pulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.1);
  }
}

.cursor-pulse {
  animation: cursor-pulse 1s ease-in-out infinite;
}

/* Wiggle effect for interactive elements */
@keyframes cursor-wiggle {
  0%, 100% {
    transform: rotate(0deg);
  }
  25% {
    transform: rotate(-5deg);
  }
  75% {
    transform: rotate(5deg);
  }
}

.cursor-wiggle:hover {
  animation: cursor-wiggle 0.5s ease-in-out;
}

/* ===== CURSOR TRAILS (Optional) ===== */

/* Pixel trail effect */
.cursor-trail {
  position: fixed;
  width: 8px;
  height: 8px;
  background: #FFD700;
  border: 2px solid #000;
  pointer-events: none;
  z-index: 9999;
  animation: trail-fade 0.5s ease-out forwards;
}

@keyframes trail-fade {
  0% {
    opacity: 1;
    transform: scale(1);
  }
  100% {
    opacity: 0;
    transform: scale(0.5);
  }
}

/* ===== CURSOR GLOW EFFECT ===== */

/* Glow for special interactions */
.cursor-glow {
  position: relative;
}

.cursor-glow::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle, rgba(255, 215, 0, 0.3) 0%, transparent 70%);
  transform: translate(-50%, -50%);
  pointer-events: none;
  animation: glow-pulse 2s ease-in-out infinite;
}

@keyframes glow-pulse {
  0%, 100% {
    opacity: 0.5;
    transform: translate(-50%, -50%) scale(1);
  }
  50% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.2);
  }
}

/* ===== PIXEL ART SPECIFIC ===== */

/* Ensure cursors are pixel-perfect */
canvas,
.pixel-art,
.game-container {
  image-rendering: pixelated;
  image-rendering: -moz-crisp-edges;
  image-rendering: crisp-edges;
}

/* ===== RESPONSIVE CURSORS ===== */

/* Scale cursors on smaller screens */
@media (max-width: 768px) {
  * {
    cursor: url('./default.cur'), auto !important;
  }
  
  button,
  a,
  .clickable {
    cursor: url('./link.cur'), pointer !important;
  }
}

/* ===== ACCESSIBILITY ===== */

/* High contrast mode */
@media (prefers-contrast: high) {
  * {
    cursor: auto !important;
  }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    animation: none !important;
  }
}

/* ===== DEBUG MODE ===== */

/* Show cursor boundaries in debug mode */
body.cursor-debug * {
  outline: 1px dashed rgba(255, 0, 0, 0.3);
}

body.cursor-debug *:hover {
  outline: 2px solid rgba(255, 0, 0, 0.8);
}

