/* =============================================
   GPH2026 — Game-Feel Enhancement Layer
   Adds RPG / Cyberpunk game aesthetics on top
   of the existing dark sci-fi theme.
   ============================================= */

/* ─── 1. Animated Grid Background ─────────────────── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(0,240,255,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,240,255,0.03) 1px, transparent 1px);
  background-size: 40px 40px;
  animation: gridShift 20s linear infinite;
}

@keyframes gridShift {
  0%   { background-position: 0 0; }
  100% { background-position: 40px 40px; }
}

/* ─── 2. CRT Scan-line Overlay ─────────────────────── */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 3px,
    rgba(0,0,0,0.07) 3px,
    rgba(0,0,0,0.07) 4px
  );
  animation: scanMove 8s linear infinite;
}

@keyframes scanMove {
  0%   { background-position: 0 0; }
  100% { background-position: 0 200px; }
}

/* ─── 3. Game-feel Buttons ─────────────────────────── */
.btn {
  position: relative;
  overflow: hidden;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  font-size: 0.8rem;
  font-weight: 700;
  transition:
    transform 120ms ease,
    box-shadow 120ms ease,
    filter 120ms ease;
}

/* Ripple shine sweep on hover */
.btn::before {
  content: '';
  position: absolute;
  top: 0; left: -100%;
  width: 60%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.15), transparent);
  transform: skewX(-20deg);
  transition: left 0.4s ease;
}
.btn:hover::before { left: 160%; }

/* Press-down effect */
.btn:active {
  transform: scale(0.95) translateY(2px);
  box-shadow: 0 0 0 transparent !important;
}

/* Primary button glow */
.btn-primary {
  box-shadow: 0 0 12px rgba(0,240,255,0.3), 0 0 24px rgba(168,85,247,0.15);
}
.btn-primary:hover {
  box-shadow: 0 0 20px rgba(0,240,255,0.5), 0 0 40px rgba(168,85,247,0.3);
  transform: translateY(-2px);
  filter: brightness(1.15);
}

/* Danger button */
.btn-danger:hover {
  box-shadow: 0 0 20px rgba(239,68,68,0.5);
  transform: translateY(-2px);
  filter: brightness(1.15);
}

/* ─── 4. Game Cards ────────────────────────────────── */
.card {
  position: relative;
  overflow: hidden;
  transition:
    transform 200ms ease,
    box-shadow 200ms ease,
    border-color 200ms ease;
}

/* Card corner bracket decorations */
.card::before,
.card::after {
  content: '';
  position: absolute;
  width: 12px;
  height: 12px;
  border-color: var(--neon-cyan);
  border-style: solid;
  opacity: 0;
  transition: opacity 200ms ease;
}
.card::before {
  top: 6px; left: 6px;
  border-width: 1.5px 0 0 1.5px;
}
.card::after {
  bottom: 6px; right: 6px;
  border-width: 0 1.5px 1.5px 0;
}
.card:hover::before,
.card:hover::after { opacity: 1; }

.card:hover {
  transform: translateY(-4px);
  box-shadow:
    0 0 30px rgba(0,240,255,0.12),
    0 8px 32px rgba(0,0,0,0.6);
  border-color: rgba(0,240,255,0.25);
}

/* ─── 5. Stat Cards — XP-bar style ────────────────── */
.stat-card {
  position: relative;
  overflow: hidden;
  transition: transform 200ms ease, box-shadow 200ms ease;
}
.stat-card:hover {
  transform: translateY(-6px) scale(1.02);
  box-shadow: 0 0 40px rgba(0,240,255,0.2);
}

/* Animated highlight sweep */
.stat-card::after {
  content: '';
  position: absolute;
  top: 0; left: -200%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg,
    transparent 0%,
    rgba(0,240,255,0.06) 50%,
    transparent 100%);
  animation: statSweep 4s ease-in-out infinite;
}
@keyframes statSweep {
  0%   { left: -200%; }
  50%  { left: 200%; }
  100% { left: 200%; }
}

/* ─── 6. Navbar — HUD style ────────────────────────── */
.navbar {
  border-bottom: 1px solid rgba(0,240,255,0.1);
  box-shadow: 0 0 30px rgba(0,0,0,0.8), 0 2px 0 rgba(0,240,255,0.08);
}

.nav-link {
  position: relative;
}
.nav-link::after {
  content: '';
  position: absolute;
  bottom: -4px; left: 0;
  width: 0; height: 2px;
  background: var(--neon-cyan);
  box-shadow: 0 0 8px var(--neon-cyan);
  transition: width 200ms ease;
}
.nav-link:hover::after,
.nav-link.active::after { width: 100%; }

/* ─── 7. Form inputs — Terminal style ─────────────── */
.form-input,
.form-select,
.form-textarea {
  transition:
    border-color 200ms ease,
    box-shadow 200ms ease,
    background 200ms ease;
  font-family: var(--font-mono);
  letter-spacing: 0.02em;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: var(--neon-cyan) !important;
  box-shadow:
    0 0 0 3px rgba(0,240,255,0.12),
    0 0 16px rgba(0,240,255,0.1),
    inset 0 0 8px rgba(0,240,255,0.04);
  outline: none;
}

/* Cursor blink inside focused input */
.form-input:focus::placeholder { opacity: 0.3; }

/* ─── 8. Badge — Pixel style ───────────────────────── */
.badge {
  font-family: var(--font-mono);
  letter-spacing: 0.05em;
  font-size: 0.68rem;
  text-transform: uppercase;
}

.badge-green  { box-shadow: 0 0 8px rgba(34,197,94,0.4); }
.badge-yellow { box-shadow: 0 0 8px rgba(234,179,8,0.4); }
.badge-cyan   { box-shadow: 0 0 8px rgba(0,240,255,0.4); }
.badge-purple { box-shadow: 0 0 8px rgba(168,85,247,0.4); }

/* ─── 9. Table — Data-readout style ───────────────── */
.table tbody tr {
  transition: background 150ms ease, transform 150ms ease;
}
.table tbody tr:hover {
  background: rgba(0,240,255,0.05);
  transform: translateX(4px);
}

.table thead th {
  font-family: var(--font-mono);
  letter-spacing: 0.08em;
  font-size: 0.75rem;
  text-transform: uppercase;
  color: var(--neon-cyan);
  border-bottom: 1px solid rgba(0,240,255,0.2);
}

/* ─── 10. Flash Message — Achievement Toast ────────── */
.alert {
  position: relative;
  overflow: hidden;
  border-left: 3px solid var(--neon-cyan);
  animation: achievementPop 0.4s cubic-bezier(0.175,0.885,0.32,1.275);
}

@keyframes achievementPop {
  0%   { opacity: 0; transform: translateY(-20px) scale(0.9); }
  60%  { transform: translateY(4px) scale(1.02); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

.alert::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 3px; height: 100%;
  background: var(--neon-cyan);
  box-shadow: 0 0 10px var(--neon-cyan);
}

.alert-success { border-left-color: #22c55e; }
.alert-success::before { background: #22c55e; box-shadow: 0 0 10px #22c55e; }
.alert-error   { border-left-color: #ef4444; }
.alert-error::before   { background: #ef4444; box-shadow: 0 0 10px #ef4444; }

/* ─── 11. Progress bars — XP Bars ─────────────────── */
progress,
[role="progressbar"],
.progress-bar {
  border-radius: 2px;
  overflow: hidden;
  position: relative;
}

/* ─── 12. Page Transition ──────────────────────────── */
.page-enter {
  animation: pageSlideIn 0.35s ease forwards;
}

@keyframes pageSlideIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ─── 13. Selection cursor — crosshair on interactive ─ */
a, button, [role="button"] { cursor: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'><circle cx='12' cy='12' r='3' fill='none' stroke='%2300f0ff' stroke-width='1.5'/><line x1='12' y1='2' x2='12' y2='8' stroke='%2300f0ff' stroke-width='1.5'/><line x1='12' y1='16' x2='12' y2='22' stroke='%2300f0ff' stroke-width='1.5'/><line x1='2' y1='12' x2='8' y2='12' stroke='%2300f0ff' stroke-width='1.5'/><line x1='16' y1='12' x2='22' y2='12' stroke='%2300f0ff' stroke-width='1.5'/></svg>") 12 12, pointer; }

/* ─── 14. Admin header — Mission Briefing style ─────── */
.admin-header {
  position: relative;
  padding-left: 16px;
  border-left: 3px solid var(--neon-cyan);
}
.admin-header::before {
  content: 'MISSION:';
  position: absolute;
  top: -14px; left: 16px;
  font-size: 0.6rem;
  font-family: var(--font-mono);
  color: var(--neon-cyan);
  letter-spacing: 0.2em;
  opacity: 0.7;
}
.admin-header h1 {
  font-size: 1.3rem;
  letter-spacing: 0.05em;
}

/* ─── 15. Scrollbar — game control bar ─────────────── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: #050810; }
::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--neon-cyan), var(--neon-purple));
  border-radius: 4px;
}

/* ─── 16. Number counters / stats — odometer feel ──── */
.stat-value {
  font-family: var(--font-mono);
  letter-spacing: 0.1em;
  text-shadow: 0 0 20px currentColor;
}

/* ─── 17. Glowing dividers ──────────────────────────── */
hr {
  border: none;
  height: 1px;
  background: linear-gradient(90deg,
    transparent,
    rgba(0,240,255,0.4) 30%,
    rgba(168,85,247,0.4) 70%,
    transparent
  );
  margin: var(--space-lg) 0;
}
