/* ═══════════════════════════════════════════════════════════════
   VOIDCYBER — training/training.css
   Cyber Academy — extends ../style.css with academy-specific UI
   v2.1 — 3D circular module nodes + glow hover + theme toggle support
   ═══════════════════════════════════════════════════════════════ */

/* ─────────── 1. NAV LOGO SVG (override) ─────────── */
.nav-logo-mark {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  filter: drop-shadow(0 2px 6px rgba(59, 130, 246, 0.25));
  transition: filter .25s ease, transform .25s ease;
}
.nav-logo:hover .nav-logo-mark {
  filter: drop-shadow(0 4px 12px rgba(59, 130, 246, 0.45));
  transform: translateY(-1px);
}
.nav-logo-svg {
  width: 100%;
  height: 100%;
  display: block;
  overflow: visible;
}
[data-theme="dark"] .nav-logo-mark {
  filter: drop-shadow(0 2px 8px rgba(34, 211, 238, 0.35));
}
[data-theme="dark"] .nav-logo:hover .nav-logo-mark {
  filter: drop-shadow(0 4px 14px rgba(34, 211, 238, 0.55));
}

/* ─────────── 2. ACADEMY HERO TWEAKS ─────────── */
.academy-hero {
  padding: clamp(40px, 6vw, 72px) 0 clamp(40px, 6vw, 72px);
}
.academy-hero .hero-title {
  font-size: clamp(2rem, 4.2vw, 3.2rem);
}

/* Progress card under hero */
.academy-progress-card {
  max-width: 560px;
  margin: 32px auto 0;
  padding: 18px 22px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-md);
  text-align: left;
}
.apc-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}
.apc-label {
  font-family: var(--font-mono);
  font-size: .78rem;
  font-weight: 600;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: .08em;
}
.apc-count {
  font-family: var(--font-mono);
  font-size: .92rem;
  font-weight: 700;
  color: var(--text);
}
.apc-bar {
  height: 8px;
  background: var(--border);
  border-radius: 999px;
  overflow: hidden;
}
.apc-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), #6366f1);
  border-radius: 999px;
  transition: width .5s ease;
}

/* ─────────── 3. PROTOCOLS LIST ─────────── */
.protocols-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-width: 980px;
  margin: 0 auto;
}

.protocol-block {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
  transition: border-color .2s ease, box-shadow .2s ease;
}
.protocol-block:hover {
  border-color: var(--accent-ring);
  box-shadow: var(--shadow-md);
}

/* The clickable bar */
.protocol-btn {
  width: 100%;
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  align-items: center;
  gap: 18px;
  padding: 18px 22px;
  background: transparent;
  text-align: left;
  cursor: pointer;
  transition: background .15s ease;
}
.protocol-btn:hover { background: var(--bg-alt); }

.protocol-btn.locked {
  opacity: .55;
  cursor: not-allowed;
}
.protocol-btn.locked:hover { background: transparent; }

.proto-num-badge {
  width: 48px;
  height: 48px;
  border-radius: var(--r-md);
  background: var(--accent-soft);
  color: var(--accent);
  font-family: var(--font-mono);
  font-weight: 800;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.protocol-btn.locked .proto-num-badge {
  background: var(--surface-2);
  color: var(--text-soft);
}

.proto-info { min-width: 0; }
.proto-tag {
  font-family: var(--font-mono);
  font-size: .7rem;
  font-weight: 700;
  color: var(--text-soft);
  letter-spacing: .12em;
  text-transform: uppercase;
  margin-bottom: 4px;
}
.proto-name {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 3px;
}
.proto-desc {
  font-size: .88rem;
  color: var(--text-muted);
}

.proto-meta {
  text-align: right;
  flex-shrink: 0;
}
.proto-modules-count {
  font-family: var(--font-mono);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text);
}
.proto-meta-label {
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text-soft);
  margin-top: 2px;
}

.proto-chevron {
  width: 20px;
  height: 20px;
  color: var(--text-soft);
  transition: transform .25s ease;
  flex-shrink: 0;
}
.proto-chevron.open { transform: rotate(180deg); }

/* ─────────── 4. MODULES GRID — 3D CIRCLES + GLOW HOVER ─────────── */
.modules-container {
  border-top: 1px solid var(--border);
  background: var(--bg-alt);
  padding: 28px 22px 30px;
}
.modules-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 22px 18px;
  justify-items: center;
}

/* Each module = vertical card: 3D circle on top + label below */
.module-node {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 6px 4px 10px;
  cursor: pointer;
  user-select: none;
  width: 100%;
  max-width: 140px;
  transition: transform .25s cubic-bezier(.34,1.56,.64,1);
}
.module-node.locked { cursor: not-allowed; }

/* ── 3D CIRCLE ICON ── */
.module-icon {
  position: relative;
  width: 76px;
  height: 76px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;

  /* 3D effect via radial gradient + shadows */
  background:
    radial-gradient(circle at 32% 28%, rgba(255,255,255,0.55) 0%, rgba(255,255,255,0) 55%),
    radial-gradient(circle at 50% 50%, var(--accent) 0%, var(--accent-hover) 100%);
  color: #ffffff;
  box-shadow:
    0 6px 14px rgba(0, 102, 255, 0.30),
    0 2px 4px rgba(11, 18, 32, 0.12),
    inset 0 -3px 6px rgba(0, 0, 0, 0.18),
    inset 0 2px 3px rgba(255, 255, 255, 0.35);
  transition:
    transform .3s cubic-bezier(.34,1.56,.64,1),
    box-shadow .3s ease,
    filter .3s ease;
}
.module-icon::before {
  /* glossy top highlight */
  content: "";
  position: absolute;
  top: 6px; left: 14px; right: 14px;
  height: 22px;
  border-radius: 50%;
  background: linear-gradient(180deg, rgba(255,255,255,0.45), rgba(255,255,255,0));
  pointer-events: none;
  filter: blur(2px);
}
.module-icon::after {
  /* outer glow ring (for hover) */
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0, 102, 255, 0.45) 0%, rgba(0, 102, 255, 0) 70%);
  opacity: 0;
  transition: opacity .3s ease;
  z-index: -1;
}
.module-icon svg {
  width: 32px;
  height: 32px;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,0.25));
  position: relative;
  z-index: 1;
}

/* Locked state */
.module-icon.lock {
  background:
    radial-gradient(circle at 32% 28%, rgba(255,255,255,0.30) 0%, rgba(255,255,255,0) 55%),
    radial-gradient(circle at 50% 50%, var(--surface-2) 0%, var(--border) 100%);
  color: var(--text-soft);
  box-shadow:
    0 4px 10px rgba(11, 18, 32, 0.10),
    inset 0 -3px 5px rgba(0, 0, 0, 0.10),
    inset 0 2px 3px rgba(255, 255, 255, 0.20);
}
.module-icon.lock svg {
  filter: none;
}

/* ── HOVER (only on unlocked) ── */
.module-node.unlocked:hover { transform: translateY(-4px); }
.module-node.unlocked:hover .module-icon {
  transform: scale(1.06);
  box-shadow:
    0 12px 28px rgba(0, 102, 255, 0.55),
    0 4px 8px rgba(11, 18, 32, 0.18),
    inset 0 -3px 6px rgba(0, 0, 0, 0.18),
    inset 0 2px 3px rgba(255, 255, 255, 0.45),
    0 0 0 4px rgba(0, 102, 255, 0.18);
  filter: brightness(1.08) saturate(1.1);
}
.module-node.unlocked:hover .module-icon::after { opacity: 1; }

/* ── COMPLETED state ── */
.module-node.completed .module-icon {
  background:
    radial-gradient(circle at 32% 28%, rgba(255,255,255,0.55) 0%, rgba(255,255,255,0) 55%),
    radial-gradient(circle at 50% 50%, #10b981 0%, #059669 100%);
  box-shadow:
    0 6px 14px rgba(16, 185, 129, 0.40),
    0 2px 4px rgba(11, 18, 32, 0.12),
    inset 0 -3px 6px rgba(0, 0, 0, 0.18),
    inset 0 2px 3px rgba(255, 255, 255, 0.35);
}
.module-node.completed .module-icon::after {
  background: radial-gradient(circle, rgba(16, 185, 129, 0.45) 0%, rgba(16, 185, 129, 0) 70%);
}
.module-node.completed:hover .module-icon {
  box-shadow:
    0 12px 28px rgba(16, 185, 129, 0.55),
    0 4px 8px rgba(11, 18, 32, 0.18),
    inset 0 -3px 6px rgba(0, 0, 0, 0.18),
    inset 0 2px 3px rgba(255, 255, 255, 0.45),
    0 0 0 4px rgba(16, 185, 129, 0.18);
}

/* ── DARK THEME tweaks ── */
[data-theme="dark"] .module-icon {
  background:
    radial-gradient(circle at 32% 28%, rgba(255,255,255,0.30) 0%, rgba(255,255,255,0) 55%),
    radial-gradient(circle at 50% 50%, var(--accent) 0%, #1e5fc7 100%);
  box-shadow:
    0 6px 18px rgba(61, 139, 255, 0.45),
    0 2px 4px rgba(0, 0, 0, 0.40),
    inset 0 -3px 6px rgba(0, 0, 0, 0.35),
    inset 0 2px 3px rgba(255, 255, 255, 0.25);
}
[data-theme="dark"] .module-icon::after {
  background: radial-gradient(circle, rgba(61, 139, 255, 0.55) 0%, rgba(61, 139, 255, 0) 70%);
}
[data-theme="dark"] .module-node.unlocked:hover .module-icon {
  box-shadow:
    0 14px 32px rgba(61, 139, 255, 0.70),
    0 4px 10px rgba(0, 0, 0, 0.40),
    inset 0 -3px 6px rgba(0, 0, 0, 0.35),
    inset 0 2px 3px rgba(255, 255, 255, 0.30),
    0 0 0 4px rgba(61, 139, 255, 0.25);
}
[data-theme="dark"] .module-icon.lock {
  background:
    radial-gradient(circle at 32% 28%, rgba(255,255,255,0.10) 0%, rgba(255,255,255,0) 55%),
    radial-gradient(circle at 50% 50%, var(--surface-2) 0%, var(--bg-soft) 100%);
  box-shadow:
    0 4px 12px rgba(0, 0, 0, 0.35),
    inset 0 -3px 5px rgba(0, 0, 0, 0.25),
    inset 0 2px 3px rgba(255, 255, 255, 0.10);
}

/* ── LABEL under the circle ── */
.module-label {
  font-size: .85rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.25;
  text-align: center;
  transition: color .2s ease;
}
.module-node.locked .module-label { color: var(--text-soft); }
.module-node.unlocked:hover .module-label { color: var(--accent); }

/* ─────────── 5. MODULE MODAL ─────────── */
.vc-modal {
  position: fixed;
  inset: 0;
  background: rgba(11, 18, 32, 0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 20px;
  opacity: 0;
  transition: opacity .2s ease;
}
.vc-modal.open {
  display: flex;
  opacity: 1;
}
.vc-modal-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: clamp(22px, 4vw, 36px);
  max-width: 520px;
  width: 100%;
  position: relative;
  box-shadow: var(--shadow-lg);
  transform: translateY(12px);
  transition: transform .25s ease;
}
.vc-modal.open .vc-modal-card { transform: translateY(0); }

.vc-modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s ease, color .15s ease;
}
.vc-modal-close:hover { background: var(--border); color: var(--text); }

.vc-modal-tag {
  font-family: var(--font-mono);
  font-size: .76rem;
  font-weight: 600;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: .08em;
  margin-bottom: 10px;
}
.vc-modal-title {
  font-size: 1.5rem;
  margin-bottom: 8px;
  color: var(--text);
}
.vc-modal-desc {
  color: var(--text-muted);
  font-size: .95rem;
  margin-bottom: 18px;
}

.vc-modal-coming {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--accent-soft);
  border: 1px solid var(--accent-ring);
  border-radius: var(--r-md);
  margin-bottom: 22px;
}
.vc-modal-coming-icon {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.vc-modal-coming-title {
  font-weight: 700;
  font-size: .95rem;
  color: var(--text);
}
.vc-modal-coming-sub {
  font-size: .82rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.vc-modal-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.vc-modal-actions .btn { flex: 1; min-width: 140px; }

/* ─────────── 6. TOAST ─────────── */
.vc-toast-wrap {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 110;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}
.vc-toast {
  background: var(--text);
  color: var(--bg);
  padding: 10px 18px;
  border-radius: var(--r-md);
  font-size: .9rem;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  animation: toastIn .3s ease, toastOut .3s ease 1.9s forwards;
}
@keyframes toastIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes toastOut {
  to { opacity: 0; transform: translateY(-8px); }
}

/* ─────────── 7. RESPONSIVE ─────────── */
@media (max-width: 720px) {
  .protocol-btn {
    grid-template-columns: auto 1fr auto;
    gap: 12px;
    padding: 14px 16px;
  }
  .protocol-btn .proto-chevron { display: none; }
  .proto-num-badge { width: 40px; height: 40px; font-size: 1rem; }
  .proto-name { font-size: 1.02rem; }
  .proto-desc { font-size: .82rem; }

  .modules-container { padding: 22px 16px 24px; }
  .modules-grid {
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 18px 12px;
  }
  .module-icon { width: 64px; height: 64px; }
  .module-icon svg { width: 26px; height: 26px; }
  .module-label { font-size: .78rem; }
}

@media (max-width: 480px) {
  .modules-grid { grid-template-columns: repeat(3, 1fr); gap: 18px 8px; }
  .module-icon { width: 58px; height: 58px; }
  .module-icon svg { width: 24px; height: 24px; }
  .vc-modal-actions { flex-direction: column; }
  .vc-modal-actions .btn { width: 100%; }
}
