/*
 * Neon Highlight Frame
 * Shows a glowing neon border around the area where a skill is working.
 * Light disperses outward from edges (box-shadow layering).
 */

#neon-highlight-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 500;
}

.neon-frame {
  position: absolute;
  border: 2px solid var(--neon-color, #00d4ff);
  border-radius: 8px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.4s ease;

  /* Multi-layer glow: inner tight → outer dispersed */
  box-shadow:
    /* Inner glow */
    inset 0 0 8px  var(--neon-color, #00d4ff),
    inset 0 0 16px rgba(0, 212, 255, 0.3),
    /* Edge glow (tight) */
    0 0 6px  var(--neon-color, #00d4ff),
    0 0 12px var(--neon-color, #00d4ff),
    /* Mid dispersion */
    0 0 24px rgba(0, 212, 255, 0.5),
    0 0 40px rgba(0, 212, 255, 0.25),
    /* Outer dispersion (scattered light) */
    0 0 60px rgba(0, 212, 255, 0.15),
    0 0 90px rgba(0, 212, 255, 0.08);
}

.neon-frame.visible {
  opacity: 1;
}

/* Breathing animation — subtle pulse */
.neon-frame.pulse {
  animation: neon-pulse 2s ease-in-out infinite;
}

@keyframes neon-pulse {
  0%, 100% {
    box-shadow:
      inset 0 0 8px  var(--neon-color, #00d4ff),
      inset 0 0 16px rgba(0, 212, 255, 0.3),
      0 0 6px  var(--neon-color, #00d4ff),
      0 0 12px var(--neon-color, #00d4ff),
      0 0 24px rgba(0, 212, 255, 0.5),
      0 0 40px rgba(0, 212, 255, 0.25),
      0 0 60px rgba(0, 212, 255, 0.15),
      0 0 90px rgba(0, 212, 255, 0.08);
    border-color: var(--neon-color, #00d4ff);
  }
  50% {
    box-shadow:
      inset 0 0 12px var(--neon-color, #00d4ff),
      inset 0 0 24px rgba(0, 212, 255, 0.4),
      0 0 10px var(--neon-color, #00d4ff),
      0 0 20px var(--neon-color, #00d4ff),
      0 0 36px rgba(0, 212, 255, 0.6),
      0 0 56px rgba(0, 212, 255, 0.35),
      0 0 80px rgba(0, 212, 255, 0.2),
      0 0 120px rgba(0, 212, 255, 0.1);
    border-color: #33eeff;
  }
}

/* Edge particle effect — tiny dots scattered along the border */
.neon-frame::before,
.neon-frame::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}

.neon-frame::before {
  width: 4px;
  height: 4px;
  background: var(--neon-color, #00d4ff);
  box-shadow:
    0 0 6px var(--neon-color, #00d4ff),
    0 0 12px var(--neon-color, #00d4ff);
  animation: neon-particle-tl 3s ease-in-out infinite;
  top: -2px;
  left: 20%;
}

.neon-frame::after {
  width: 3px;
  height: 3px;
  background: var(--neon-color, #00d4ff);
  box-shadow:
    0 0 4px var(--neon-color, #00d4ff),
    0 0 10px var(--neon-color, #00d4ff);
  animation: neon-particle-br 3.5s ease-in-out infinite 0.5s;
  bottom: -2px;
  right: 15%;
}

@keyframes neon-particle-tl {
  0%, 100% { opacity: 0.3; transform: translateY(0); }
  50% { opacity: 1; transform: translateY(-4px); }
}

@keyframes neon-particle-br {
  0%, 100% { opacity: 0.2; transform: translateX(0); }
  50% { opacity: 0.9; transform: translateX(4px); }
}

/* Fade-in with slight scale */
.neon-frame.entering {
  animation: neon-enter 0.5s ease-out forwards;
}

@keyframes neon-enter {
  0% {
    opacity: 0;
    transform: scale(1.02);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

/* Label badge (top-right corner) */
.neon-label {
  position: absolute;
  top: -10px;
  right: 12px;
  background: var(--neon-color, #00d4ff);
  color: #000;
  font-size: 10px;
  font-weight: 700;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  padding: 2px 8px;
  border-radius: 4px;
  white-space: nowrap;
  box-shadow:
    0 0 8px var(--neon-color, #00d4ff),
    0 0 16px rgba(0, 212, 255, 0.4);
}

/* Color variants */
.neon-frame.color-cyan    { --neon-color: #00d4ff; }
.neon-frame.color-green   { --neon-color: #00ff88; }
.neon-frame.color-purple  { --neon-color: #b366ff; }
.neon-frame.color-orange  { --neon-color: #ff8800; }
.neon-frame.color-pink    { --neon-color: #ff3388; }
.neon-frame.color-yellow  { --neon-color: #ffdd00; }
