/* ═══════════════════════════════════════════════════════ */
/*  ChessVIP PRO — Premium Injected Panel Styles          */
/*  Inspired by godly.website & jolyui.dev                */
/* ═══════════════════════════════════════════════════════ */

/* ── Status Panel — Glass Card ── */
#chess-suggester-panel {
  position: fixed;
  top: 10px;
  right: 10px;
  background: rgba(10, 10, 18, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 16px;
  padding: 16px 18px;
  color: #f1f5f9;
  font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
  font-size: 13px;
  z-index: 10000;
  min-width: 260px;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.03),
    0 12px 40px rgba(0, 0, 0, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  transition: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
  -webkit-font-smoothing: antialiased;
}

#chess-suggester-panel:hover {
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.06),
    0 16px 48px rgba(0, 0, 0, 0.5),
    0 0 24px rgba(59, 130, 246, 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
  transform: translateY(-2px);
}

/* ── Panel Header ── */
#chess-suggester-panel .panel-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

#chess-suggester-panel .panel-header h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, #4ade80, #22c55e);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

#chess-suggester-panel .panel-header .status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #4ade80;
  box-shadow: 0 0 10px rgba(74, 222, 128, 0.4);
  animation: pulse-glow 2s ease-in-out infinite;
}

@keyframes pulse-glow {

  0%,
  100% {
    opacity: 1;
    box-shadow: 0 0 8px rgba(74, 222, 128, 0.4);
  }

  50% {
    opacity: 0.6;
    box-shadow: 0 0 16px rgba(74, 222, 128, 0.6);
  }
}

#chess-suggester-panel .panel-header .status-dot.analyzing {
  background: #f59e0b;
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.4);
  animation: pulse-analyze 1.5s ease-in-out infinite;
}

@keyframes pulse-analyze {

  0%,
  100% {
    opacity: 1;
    box-shadow: 0 0 8px rgba(245, 158, 11, 0.4);
  }

  50% {
    opacity: 0.5;
    box-shadow: 0 0 18px rgba(245, 158, 11, 0.6);
  }
}

#chess-suggester-panel .panel-header .status-dot.error {
  background: #f87171;
  box-shadow: 0 0 10px rgba(248, 113, 113, 0.4);
}

/* ── Evaluation Section ── */
#chess-suggester-panel .eval-section {
  margin-bottom: 14px;
}

#chess-suggester-panel .eval-bar {
  height: 6px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 3px;
  overflow: hidden;
  position: relative;
}

#chess-suggester-panel .eval-indicator {
  position: absolute;
  height: 100%;
  background: linear-gradient(90deg, #22c55e, #4ade80);
  transition: width 0.5s ease;
  border-radius: 3px;
  box-shadow: 0 0 8px rgba(74, 222, 128, 0.3);
}

#chess-suggester-panel .eval-value {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: #4ade80;
  text-align: center;
  margin-top: 6px;
  text-shadow: 0 0 20px rgba(74, 222, 128, 0.2);
}

#chess-suggester-panel .eval-value.negative {
  color: #f87171;
  text-shadow: 0 0 20px rgba(248, 113, 113, 0.2);
}

/* ── Move Suggestions ── */
#chess-suggester-panel .moves-section {
  margin-top: 12px;
}

#chess-suggester-panel .move-item {
  display: flex;
  align-items: center;
  padding: 8px 10px;
  margin: 4px 0;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: 10px;
  transition: all 0.2s ease;
  cursor: default;
}

#chess-suggester-panel .move-item:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.08);
  transform: translateX(2px);
}

#chess-suggester-panel .move-rank {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 11px;
  margin-right: 10px;
  flex-shrink: 0;
}

#chess-suggester-panel .move-rank.rank-1 {
  background: linear-gradient(135deg, #fbbf24, #d97706);
  color: #1a0e00;
  box-shadow: 0 0 12px rgba(251, 191, 36, 0.3);
}

#chess-suggester-panel .move-rank.rank-2 {
  background: linear-gradient(135deg, #d1d5db, #9ca3af);
  color: #111;
}

#chess-suggester-panel .move-rank.rank-3 {
  background: linear-gradient(135deg, #d97706, #92400e);
  color: #fff;
}

#chess-suggester-panel .move-rank.rank-4 {
  background: linear-gradient(135deg, #a855f7, #7c3aed);
  color: #fff;
}

#chess-suggester-panel .move-rank.rank-5 {
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  color: #fff;
}

#chess-suggester-panel .move-notation {
  flex: 1;
  font-family: 'Inter', 'Courier New', monospace;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.01em;
}

#chess-suggester-panel .move-eval {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
  background: rgba(74, 222, 128, 0.1);
  border: 1px solid rgba(74, 222, 128, 0.15);
  color: #4ade80;
}

#chess-suggester-panel .move-eval.negative {
  background: rgba(248, 113, 113, 0.1);
  border-color: rgba(248, 113, 113, 0.15);
  color: #f87171;
}

/* ── Turn Indicator ── */
#chess-suggester-panel .turn-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  font-size: 12px;
  font-weight: 500;
  color: rgba(241, 245, 249, 0.6);
}

#chess-suggester-panel .turn-piece {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.15);
}

#chess-suggester-panel .turn-piece.white {
  background: #f1f5f9;
  box-shadow: 0 0 8px rgba(241, 245, 249, 0.2);
}

#chess-suggester-panel .turn-piece.black {
  background: #1e293b;
  border-color: rgba(255, 255, 255, 0.2);
}

/* ── Toggle Button (FAB) ── */
#chess-suggester-toggle {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: linear-gradient(135deg, #22c55e, #16a34a);
  border: 1px solid rgba(255, 255, 255, 0.1);
  cursor: pointer;
  z-index: 10001;
  box-shadow:
    0 4px 16px rgba(34, 197, 94, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

#chess-suggester-toggle:hover {
  transform: scale(1.08) translateY(-2px);
  box-shadow:
    0 8px 24px rgba(34, 197, 94, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

#chess-suggester-toggle:active {
  transform: scale(0.95);
}

#chess-suggester-toggle svg {
  width: 22px;
  height: 22px;
  fill: white;
}

/* ── Loading Spinner ── */
.chess-suggester-spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-top-color: #4ade80;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ── Arrow Styles ── */
.suggester-arrow {
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.suggester-arrow.best {
  fill: rgba(74, 222, 128, 0.8) !important;
}

.suggester-arrow.good {
  fill: rgba(251, 191, 36, 0.7) !important;
}

.suggester-arrow.ok {
  fill: rgba(249, 115, 22, 0.6) !important;
}

/* ── Rainbow Effect for Target Squares ── */
@keyframes rainbow-glow {
  0% {
    box-shadow: 0 0 12px 4px rgba(255, 0, 0, 0.6);
    border-color: #ff0000;
  }

  16% {
    box-shadow: 0 0 12px 4px rgba(255, 165, 0, 0.6);
    border-color: #ffa500;
  }

  32% {
    box-shadow: 0 0 12px 4px rgba(255, 255, 0, 0.6);
    border-color: #ffff00;
  }

  48% {
    box-shadow: 0 0 12px 4px rgba(0, 255, 0, 0.6);
    border-color: #00ff00;
  }

  64% {
    box-shadow: 0 0 12px 4px rgba(0, 191, 255, 0.6);
    border-color: #00bfff;
  }

  80% {
    box-shadow: 0 0 12px 4px rgba(138, 43, 226, 0.6);
    border-color: #8a2be2;
  }

  100% {
    box-shadow: 0 0 12px 4px rgba(255, 0, 0, 0.6);
    border-color: #ff0000;
  }
}

@keyframes rainbow-background {
  0% {
    background: linear-gradient(135deg, rgba(255, 0, 0, 0.25), rgba(255, 165, 0, 0.25));
  }

  16% {
    background: linear-gradient(135deg, rgba(255, 165, 0, 0.25), rgba(255, 255, 0, 0.25));
  }

  32% {
    background: linear-gradient(135deg, rgba(255, 255, 0, 0.25), rgba(0, 255, 0, 0.25));
  }

  48% {
    background: linear-gradient(135deg, rgba(0, 255, 0, 0.25), rgba(0, 191, 255, 0.25));
  }

  64% {
    background: linear-gradient(135deg, rgba(0, 191, 255, 0.25), rgba(138, 43, 226, 0.25));
  }

  80% {
    background: linear-gradient(135deg, rgba(138, 43, 226, 0.25), rgba(255, 0, 255, 0.25));
  }

  100% {
    background: linear-gradient(135deg, rgba(255, 0, 255, 0.25), rgba(255, 0, 0, 0.25));
  }
}

.rainbow-target-square {
  position: absolute;
  width: 12.5%;
  height: 12.5%;
  border: 3px solid #ff0000;
  border-radius: 6px;
  animation: rainbow-glow 2s linear infinite, rainbow-background 2s linear infinite;
  pointer-events: none;
  z-index: 99;
  box-sizing: border-box;
}

.rainbow-target-square.best {
  border-width: 4px;
  animation-duration: 1.5s;
}

.rainbow-target-square.good {
  border-width: 3px;
  animation-duration: 2s;
  opacity: 0.8;
}

.rainbow-target-square.ok {
  border-width: 2px;
  animation-duration: 2.5s;
  opacity: 0.6;
}