/* ==========================================================================
   GMR KIT · TACTICAL OPTICS, 3D PARALLAX & CRT GLITCH (AAA SCUM OPS)
   ========================================================================== */

/* --------------------------------------------------------------------------
   01. SELECTOR DE MODOS ÓPTICOS EN HEADER
   -------------------------------------------------------------------------- */
.btn-optics-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(14, 18, 24, 0.9);
  border: 1px solid var(--border-med);
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 1px;
  padding: 6px 14px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

.btn-optics-toggle:hover {
  background: rgba(255, 106, 0, 0.12);
  border-color: var(--tac-orange-bright);
  color: #fff;
  box-shadow: 0 0 12px rgba(255, 106, 0, 0.3);
}

.optics-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--tac-orange);
  box-shadow: 0 0 6px var(--tac-orange);
  transition: all 0.25s ease;
}

/* --------------------------------------------------------------------------
   02. MODO VISIÓN NOCTURNA (NVG - NIGHT VISION GOGGLES)
   -------------------------------------------------------------------------- */
body.optics-nvg {
  --bg-main: #020a04;
  --bg-card: #041407;
  --bg-card-hover: #07220e;
  --bg-panel: #030d05;
  --bg-input: #020803;
  --border-subtle: #083313;
  --border-med: #0f5220;
  --border-bright: #1b8a37;
  --tac-orange: #00ff66;
  --tac-orange-bright: #33ff88;
  --tac-orange-glow: rgba(0, 255, 102, 0.35);
  --tac-orange-dim: rgba(0, 255, 102, 0.15);
  --grad-orange: linear-gradient(135deg, #00b347 0%, #00ff66 100%);
  --grad-orange-hover: linear-gradient(135deg, #00d052 0%, #33ff88 100%);
  --text-white: #e6ffed;
  --text-muted: #70d68f;
  --text-dim: #3a8a53;
  --text-mono: #a3ffbf;
}

body.optics-nvg::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 99998;
  background: 
    radial-gradient(ellipse at center, transparent 40%, rgba(0, 20, 5, 0.75) 85%, rgba(0, 10, 2, 0.96) 100%),
    repeating-linear-gradient(0deg, rgba(0, 255, 102, 0.05) 0px, rgba(0, 255, 102, 0.05) 1px, transparent 1px, transparent 3px);
  mix-blend-mode: overlay;
}

body.optics-nvg .optics-dot {
  background: #00ff66;
  box-shadow: 0 0 10px #00ff66;
}

body.optics-nvg .weapon-img,
body.optics-nvg .catalog-img {
  filter: sepia(100%) hue-rotate(85deg) saturate(280%) brightness(1.15) contrast(1.1);
}

/* --------------------------------------------------------------------------
   03. MODO TÉRMICO / FLIR (FORWARD LOOKING INFRARED)
   -------------------------------------------------------------------------- */
body.optics-thermal {
  --bg-main: #0a0806;
  --bg-card: #15100a;
  --bg-card-hover: #221810;
  --bg-panel: #110c07;
  --bg-input: #0c0805;
  --border-subtle: #302014;
  --border-med: #523520;
  --border-bright: #8a5830;
  --tac-orange: #ff9900;
  --tac-orange-bright: #ffcc00;
  --tac-orange-glow: rgba(255, 153, 0, 0.35);
  --tac-orange-dim: rgba(255, 153, 0, 0.15);
  --grad-orange: linear-gradient(135deg, #cc6600 0%, #ffcc00 100%);
  --grad-orange-hover: linear-gradient(135deg, #e67300 0%, #ffdb4d 100%);
  --text-white: #fff8e7;
  --text-muted: #d4a97d;
  --text-dim: #8c6a47;
  --text-mono: #ffe4b3;
}

body.optics-thermal::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 99998;
  background: 
    radial-gradient(circle at center, transparent 60%, rgba(10, 5, 0, 0.7) 95%),
    repeating-linear-gradient(90deg, rgba(255, 204, 0, 0.02) 0px, transparent 2px, transparent 4px);
}

body.optics-thermal .optics-dot {
  background: #ffcc00;
  box-shadow: 0 0 10px #ffcc00;
}

body.optics-thermal .weapon-img,
body.optics-thermal .catalog-img {
  filter: contrast(1.4) brightness(1.2) drop-shadow(0 0 8px rgba(255, 170, 0, 0.5));
}

/* --------------------------------------------------------------------------
   04. EFECTO DE GLITCH E INTERFERENCIA CRT MILITAR AL CAMBIAR DE PESTAÑA
   -------------------------------------------------------------------------- */
#hud-glitch-overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 99999;
  opacity: 0;
  background: rgba(255, 106, 0, 0.04);
  overflow: hidden;
  transition: opacity 0.08s ease;
}

#hud-glitch-overlay.active {
  opacity: 1;
  animation: hudGlitchFlash 0.18s steps(2) forwards;
}

@keyframes hudGlitchFlash {
  0% {
    clip-path: inset(10% 0 75% 0);
    transform: translate(-3px, 2px);
    background: rgba(0, 208, 255, 0.08);
  }
  25% {
    clip-path: inset(65% 0 15% 0);
    transform: translate(4px, -2px);
    background: rgba(255, 34, 51, 0.12);
  }
  50% {
    clip-path: inset(35% 0 45% 0);
    transform: translate(-4px, 1px);
    background: rgba(255, 106, 0, 0.1);
  }
  75% {
    clip-path: inset(80% 0 5% 0);
    transform: translate(2px, -3px);
  }
  100% {
    clip-path: inset(0 0 0 0);
    transform: translate(0, 0);
    opacity: 0;
  }
}

/* --------------------------------------------------------------------------
   05. EFECTO 3D TILT / PARALLAX EN TARJETAS DE ARMAS Y OUTFITS
   -------------------------------------------------------------------------- */
.weapon-card,
.outfit-card {
  perspective: 1000px;
  transform-style: preserve-3d;
  transition: transform 0.18s ease-out, border-color 0.2s ease, box-shadow 0.25s ease;
  will-change: transform;
  position: relative;
}

.weapon-card:hover,
.outfit-card:hover {
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.8), 0 0 20px var(--tac-orange-glow);
  z-index: 10;
}

/* Reflejo metálico holográfico que sigue el cursor */
.card-specular-glare {
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  opacity: 0;
  background: radial-gradient(circle 220px at var(--mouse-x, 50%) var(--mouse-y, 50%), rgba(255, 255, 255, 0.12) 0%, transparent 80%);
  transition: opacity 0.25s ease;
  z-index: 3;
}

.weapon-card:hover .card-specular-glare,
.outfit-card:hover .card-specular-glare {
  opacity: 1;
}

/* Botón de inspección táctica en cada tarjeta */
.btn-card-inspect {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-med);
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 1px;
  padding: 5px 10px;
  border-radius: 3px;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-top: 4px;
}

.btn-card-inspect:hover {
  background: rgba(0, 208, 255, 0.15);
  border-color: #00d0ff;
  color: #fff;
  box-shadow: 0 0 10px rgba(0, 208, 255, 0.4);
}
