/* ========================================
   CURSOR CUSTOMIZADO - MIRA DE PRECISÃO
   ======================================== */

/* Esconder cursor padrão */
* {
  cursor: none !important;
}

/* Exceções: mostrar cursor padrão em iframes (vídeos do YouTube) */
iframe,
iframe * {
  cursor: auto !important;
}

/* Cursor customizado - Mira de Precisão */
.custom-cursor {
  position: fixed;
  top: 0;
  left: 0;
  width: 40px;
  height: 40px;
  pointer-events: none;
  z-index: 999999;
  transform: translate(-50%, -50%);
  transition: opacity 0.2s ease;
  will-change: transform;
}

/* Mira de Precisão SVG */
.cursor-crosshair {
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 0 8px rgba(255, 50, 50, 0.8));
  animation: cursor-pulse 2s ease-in-out infinite;
}

@keyframes cursor-pulse {
  0%, 100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.1);
    opacity: 0.9;
  }
}

/* Trail/Rastro do cursor */
.cursor-trail {
  position: fixed;
  width: 8px;
  height: 8px;
  background: rgba(255, 50, 50, 0.6);
  border-radius: 50%;
  pointer-events: none;
  z-index: 999998;
  box-shadow: 0 0 10px rgba(255, 50, 50, 0.8);
  will-change: transform, opacity;
}

/* Efeito quando hover em elementos clicáveis */
body.cursor-hover .cursor-crosshair {
  filter: drop-shadow(0 0 12px rgba(255, 50, 50, 1));
  animation: cursor-active 0.5s ease-in-out infinite;
  transition: filter 0.15s ease;
}

@keyframes cursor-active {
  0%, 100% {
    transform: scale(1) rotate(0deg);
  }
  50% {
    transform: scale(1.15) rotate(90deg);
  }
}

/* Estados de scale serão controlados pelo JavaScript para evitar conflitos */

/* Esconder quando sai da janela */
body.cursor-hidden .custom-cursor,
body.cursor-hidden .cursor-trail {
  opacity: 0;
}

/* Cursor em inputs e áreas de texto */
input:hover,
textarea:hover,
select:hover,
input:focus,
textarea:focus,
select:focus {
  cursor: text !important;
}

/* Mostrar cursor padrão em inputs quando focado */
input,
textarea,
select {
  cursor: text !important;
}

/* Desabilitar cursor customizado em mobile */
@media (max-width: 768px) {
  * {
    cursor: auto !important;
  }

  .custom-cursor,
  .cursor-trail {
    display: none !important;
  }
}
