/**
 * TINGLE DIGITAL - Custom Cursor Styles
 * Light Theme - Nova Paleta 2025
 *
 * @version 2.0.0
 */

/* ============================================
 * HIDE DEFAULT CURSOR
 * ============================================ */

.has-custom-cursor {
  cursor: auto;
}

.has-custom-cursor a,
.has-custom-cursor button,
.has-custom-cursor [role="button"],
.has-custom-cursor input[type="submit"],
.has-custom-cursor input[type="button"] {
  cursor: auto;
}

/* ============================================
 * MAIN CURSOR
 * ============================================ */

.custom-cursor {
  position: fixed;
  top: 0;
  left: 0;
  width: 40px;
  height: 40px;
  border: 2px solid var(--tingle-coral);
  border-radius: 50%;
  pointer-events: none;
  z-index: var(--z-cursor);
  transform: translate(-50%, -50%);
  transition:
    width 0.3s var(--ease-bounce),
    height 0.3s var(--ease-bounce),
    border-color 0.3s ease,
    background-color 0.3s ease,
    opacity 0.3s ease;
  mix-blend-mode: difference;
  opacity: 0;
}

/* ============================================
 * CURSOR DOT
 * ============================================ */

.custom-cursor-dot {
  position: fixed;
  top: 0;
  left: 0;
  width: 8px;
  height: 8px;
  background: var(--tingle-turquoise);
  border-radius: 50%;
  pointer-events: none;
  z-index: var(--z-cursor);
  transform: translate(-50%, -50%);
  transition:
    width 0.15s ease,
    height 0.15s ease,
    background 0.15s ease,
    opacity 0.3s ease;
  opacity: 0;
}

/* ============================================
 * HOVER STATE
 * ============================================ */

.custom-cursor.cursor-hover {
  width: 60px;
  height: 60px;
  background: rgba(255, 112, 76, 0.1);
  border-color: var(--tingle-turquoise);
}

.custom-cursor.cursor-hover + .custom-cursor-dot,
.cursor-hover ~ .custom-cursor-dot {
  width: 4px;
  height: 4px;
}

/* ============================================
 * VIEW STATE (for project cards)
 * ============================================ */

.custom-cursor.cursor-view {
  width: 100px;
  height: 100px;
  background: var(--tingle-coral);
  border-color: var(--tingle-coral);
  mix-blend-mode: normal;
}

.custom-cursor.cursor-view::after {
  content: 'VIEW';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: white;
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: var(--font-bold);
  letter-spacing: 2px;
  text-transform: uppercase;
}

/* ============================================
 * DRAG STATE (for sliders)
 * ============================================ */

.custom-cursor.cursor-drag {
  width: 80px;
  height: 80px;
  background: rgba(2, 176, 181, 0.1);
  border-color: var(--tingle-turquoise);
}

.custom-cursor.cursor-drag::after {
  content: '↔';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: var(--tingle-turquoise);
  font-size: 24px;
}

/* ============================================
 * EXPAND STATE (for expandable items)
 * ============================================ */

.custom-cursor.cursor-expand {
  width: 70px;
  height: 70px;
  background: rgba(255, 112, 76, 0.1);
  border-color: var(--tingle-coral);
}

.custom-cursor.cursor-expand::after {
  content: '+';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: var(--tingle-coral);
  font-size: 28px;
  font-weight: var(--font-light);
}

/* ============================================
 * PLAY STATE (for videos)
 * ============================================ */

.custom-cursor.cursor-play {
  width: 80px;
  height: 80px;
  background: var(--tingle-magenta);
  border-color: var(--tingle-magenta);
  mix-blend-mode: normal;
}

.custom-cursor.cursor-play::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 55%;
  transform: translate(-50%, -50%);
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 10px 0 10px 16px;
  border-color: transparent transparent transparent white;
}

/* ============================================
 * LOADING STATE
 * ============================================ */

.custom-cursor.cursor-loading {
  animation: cursor-spin 1s linear infinite;
}

@keyframes cursor-spin {
  from {
    transform: translate(-50%, -50%) rotate(0deg);
  }
  to {
    transform: translate(-50%, -50%) rotate(360deg);
  }
}

/* ============================================
 * HIDDEN STATE
 * ============================================ */

.custom-cursor.cursor-hidden,
.custom-cursor-dot.cursor-hidden {
  opacity: 0 !important;
  visibility: hidden;
}

/* ============================================
 * TEXT CURSOR STATE
 * ============================================ */

.custom-cursor.cursor-text {
  width: 4px;
  height: 30px;
  border-radius: 2px;
  border: none;
  background: var(--tingle-coral);
  animation: blink-cursor 1s infinite;
}

@keyframes blink-cursor {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

/* ============================================
 * MAGNETIC EFFECT FEEDBACK
 * ============================================ */

.custom-cursor.cursor-magnetic {
  transform: translate(-50%, -50%) scale(1.2);
  background: rgba(255, 112, 76, 0.05);
}

/* ============================================
 * COLOR VARIANTS
 * ============================================ */

.custom-cursor.cursor-turquoise {
  border-color: var(--tingle-turquoise);
}

.custom-cursor.cursor-coral {
  border-color: var(--tingle-coral);
}

.custom-cursor.cursor-amber {
  border-color: var(--tingle-amber);
}

.custom-cursor.cursor-magenta {
  border-color: var(--tingle-magenta);
}

/* Legacy */
.custom-cursor.cursor-cyan {
  border-color: var(--tingle-turquoise);
}

.custom-cursor.cursor-gold {
  border-color: var(--tingle-amber);
}

/* ============================================
 * CUSTOM TEXT CONTENT
 * ============================================ */

.custom-cursor[data-text]::after {
  content: attr(data-text);
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: white;
  font-family: var(--font-body);
  font-size: 10px;
  font-weight: var(--font-bold);
  letter-spacing: 1px;
  text-transform: uppercase;
  white-space: nowrap;
}

.custom-cursor[data-text=""]:after {
  content: none;
}

/* ============================================
 * CLICK FEEDBACK
 * ============================================ */

.custom-cursor.clicking {
  transform: translate(-50%, -50%) scale(0.9);
  transition: transform 0.1s ease;
}

/* ============================================
 * RESPONSIVE - DISABLE ON TOUCH
 * ============================================ */

@media (pointer: coarse) {
  .custom-cursor,
  .custom-cursor-dot {
    display: none !important;
  }

  .has-custom-cursor {
    cursor: auto;
  }

  .has-custom-cursor a,
  .has-custom-cursor button {
    cursor: pointer;
  }
}

/* ============================================
 * REDUCED MOTION
 * ============================================ */

@media (prefers-reduced-motion: reduce) {
  .custom-cursor,
  .custom-cursor-dot {
    transition: none;
  }

  .custom-cursor.cursor-loading {
    animation: none;
  }
}
