/* =========================================
   CURSOR CUSTOMIZADO INTERATIVO - MELHORADO
   ========================================= */

/* Esconder cursor padrão */
* {
  cursor: none !important;
}

/* Cursor customizado - cores adaptáveis aos temas */
.custom-cursor {
  position: fixed;
  top: 0;
  left: 0;
  width: 12px;
  height: 12px;
  background: linear-gradient(45deg, #16a34a, #22c55e);
  border-radius: 50%;
  pointer-events: none;
  z-index: 9999;
  transition: all 0.08s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  transform: translate(-50%, -50%);
  box-shadow: 0 0 10px rgba(22, 163, 74, 0.3);
}

/* Cursor no tema claro - verde vibrante */
[data-theme="light"] .custom-cursor {
  background: linear-gradient(45deg, #16a34a, #22c55e);
  box-shadow: 0 0 10px rgba(22, 163, 74, 0.4);
}

/* Cursor no tema escuro - verde brilhante */
[data-theme="dark"] .custom-cursor {
  background: linear-gradient(45deg, #16a34a, #22c55e);
  box-shadow: 0 0 12px rgba(34, 197, 94, 0.5);
}

.cursor-trail {
  position: fixed;
  top: 0;
  left: 0;
  width: 32px;
  height: 32px;
  border: 2px solid rgba(22, 163, 74, 0.4);
  border-radius: 50%;
  pointer-events: none;
  z-index: 9998;
  transition: all 0.12s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  transform: translate(-50%, -50%);
}

/* Trail no tema claro */
[data-theme="light"] .cursor-trail {
  border-color: rgba(22, 163, 74, 0.5);
}

/* Trail no tema escuro */
[data-theme="dark"] .cursor-trail {
  border-color: rgba(34, 197, 94, 0.6);
}

/* Estados do cursor - mais dinâmicos com variações de tema */
.custom-cursor.hover {
  width: 24px;
  height: 24px;
  background: linear-gradient(45deg, #15803d, #16a34a, #22c55e);
  background-size: 200% 200%;
  animation: gradientPulse 1.5s ease infinite;
  box-shadow: 0 0 20px rgba(22, 163, 74, 0.6);
  transition: all 0.05s ease;
}

/* Hover no tema claro - verde vibrante */
[data-theme="light"] .custom-cursor.hover {
  background: linear-gradient(45deg, #15803d, #16a34a, #22c55e);
  box-shadow: 0 0 20px rgba(22, 163, 74, 0.7);
}

/* Hover no tema escuro - verde brilhante */
[data-theme="dark"] .custom-cursor.hover {
  background: linear-gradient(45deg, #16a34a, #22c55e, #10b981);
  box-shadow: 0 0 25px rgba(34, 197, 94, 0.8);
}

.cursor-trail.hover {
  width: 48px;
  height: 48px;
  border-width: 2px;
  transition: all 0.08s ease;
}

/* Trail hover no tema claro */
[data-theme="light"] .cursor-trail.hover {
  border-color: rgba(22, 163, 74, 0.7);
}

/* Trail hover no tema escuro */
[data-theme="dark"] .cursor-trail.hover {
  border-color: rgba(34, 197, 94, 0.8);
}

.custom-cursor.click {
  width: 8px;
  height: 8px;
  background: #dc2626;
  box-shadow: 0 0 25px rgba(220, 38, 38, 1);
  transition: all 0.03s ease;
}

/* Click - mesmo em ambos os temas (vermelho) */
[data-theme="light"] .custom-cursor.click,
[data-theme="dark"] .custom-cursor.click {
  background: #dc2626;
  box-shadow: 0 0 25px rgba(220, 38, 38, 1);
}

.cursor-trail.click {
  width: 60px;
  height: 60px;
  border-color: rgba(220, 38, 38, 0.8);
  border-width: 3px;
  transition: all 0.05s ease;
}

/* Animação de gradiente mais suave */
@keyframes gradientPulse {
  0%, 100% { 
    background-position: 0% 50%;
    transform: translate(-50%, -50%) scale(1);
  }
  50% { 
    background-position: 100% 50%;
    transform: translate(-50%, -50%) scale(1.1);
  }
}

/* Partículas do cursor - mais dinâmicas */
.cursor-particle {
  position: fixed;
  width: 3px;
  height: 3px;
  background: linear-gradient(45deg, #16a34a, #22c55e);
  border-radius: 50%;
  pointer-events: none;
  z-index: 9997;
  opacity: 0;
  animation: particleExplosion 0.8s ease-out forwards;
}

@keyframes particleExplosion {
  0% {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
  100% {
    opacity: 0;
    transform: scale(0.5) translateY(-30px);
  }
}

/* Efeito especial para botões e links - cores adaptáveis aos temas */
.custom-cursor.button {
  width: 40px;
  height: 40px;
  background: conic-gradient(#16a34a, #22c55e, #10b981, #059669, #16a34a);
  animation: spinGradient 2s linear infinite, buttonPulse 1s ease-in-out infinite;
  box-shadow: 
    0 0 20px rgba(22, 163, 74, 0.6),
    inset 0 0 10px rgba(255, 255, 255, 0.2);
  transition: all 0.05s ease;
}

/* Button no tema claro */
[data-theme="light"] .custom-cursor.button {
  background: conic-gradient(#16a34a, #22c55e, #10b981, #059669, #16a34a);
  box-shadow: 
    0 0 25px rgba(22, 163, 74, 0.7),
    inset 0 0 10px rgba(255, 255, 255, 0.3);
}

/* Button no tema escuro */
[data-theme="dark"] .custom-cursor.button {
  background: conic-gradient(#22c55e, #10b981, #059669, #047857, #22c55e);
  box-shadow: 
    0 0 30px rgba(34, 197, 94, 0.8),
    inset 0 0 15px rgba(255, 255, 255, 0.2);
}

.cursor-trail.button {
  width: 70px;
  height: 70px;
  border: 3px solid rgba(22, 163, 74, 0.8);
  box-shadow: 
    0 0 30px rgba(22, 163, 74, 0.4),
    inset 0 0 20px rgba(22, 163, 74, 0.1);
  transition: all 0.08s ease;
}

/* Trail button no tema claro */
[data-theme="light"] .cursor-trail.button {
  border-color: rgba(22, 163, 74, 0.8);
  box-shadow: 
    0 0 30px rgba(22, 163, 74, 0.5),
    inset 0 0 20px rgba(22, 163, 74, 0.1);
}

/* Trail button no tema escuro */
[data-theme="dark"] .cursor-trail.button {
  border-color: rgba(34, 197, 94, 0.9);
  box-shadow: 
    0 0 35px rgba(34, 197, 94, 0.6),
    inset 0 0 25px rgba(34, 197, 94, 0.1);
}

@keyframes spinGradient {
  0% { transform: translate(-50%, -50%) rotate(0deg); }
  100% { transform: translate(-50%, -50%) rotate(360deg); }
}

@keyframes buttonPulse {
  0%, 100% { box-shadow: 0 0 20px rgba(22, 163, 74, 0.6); }
  50% { box-shadow: 0 0 40px rgba(22, 163, 74, 0.9); }
}

/* Cursor para texto - cores adaptáveis aos temas */
.custom-cursor.text {
  width: 2px;
  height: 24px;
  background: linear-gradient(to bottom, #16a34a, #22c55e);
  border-radius: 2px;
  animation: textBlink 1.2s infinite;
  transition: all 0.05s ease;
}

/* Text cursor no tema claro */
[data-theme="light"] .custom-cursor.text {
  background: linear-gradient(to bottom, #16a34a, #22c55e);
}

/* Text cursor no tema escuro */
[data-theme="dark"] .custom-cursor.text {
  background: linear-gradient(to bottom, #22c55e, #10b981);
}

.cursor-trail.text {
  width: 24px;
  height: 36px;
  border-radius: 6px;
  border-color: rgba(22, 163, 74, 0.5);
  transition: all 0.08s ease;
}

/* Trail text no tema claro */
[data-theme="light"] .cursor-trail.text {
  border-color: rgba(22, 163, 74, 0.6);
}

/* Trail text no tema escuro */
[data-theme="dark"] .cursor-trail.text {
  border-color: rgba(34, 197, 94, 0.7);
}

@keyframes textBlink {
  0%, 50% { opacity: 1; }
  51%, 100% { opacity: 0.3; }
}

/* Estado magnético para elementos interativos */
.custom-cursor.magnetic {
  transition: all 0.1s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* Responsividade - desabilitar no mobile */
@media (max-width: 768px) {
  * {
    cursor: auto !important;
  }
  
  .custom-cursor,
  .cursor-trail,
  .cursor-particle {
    display: none !important;
  }
}

/* Esconder elementos de cursor quando não suportado */
@media (pointer: coarse) {
  .custom-cursor,
  .cursor-trail,
  .cursor-particle {
    display: none !important;
  }
  
  * {
    cursor: auto !important;
  }
}
