/* ═══════════════════════════════════════════════════════════════
   VOIDCYBER — training/style.css
   Cyber Academy Training Page — Duolingo Cyber-Funk Style
   Inherits same theme variables as main site
═══════════════════════════════════════════════════════════════ */

/* ── THEME VARIABLES (mirrored from main) ─────────────────── */
:root,
[data-theme="orange"] {
  --accent:       #FF6B00;
  --accent2:      #FFD700;
  --accent-glow:  #FF8C00;
  --bg:           #050505;
  --bg2:          #0a0a0a;
  --bg3:          #0f0f0f;
  --surface:      rgba(255,107,0,0.04);
  --surface2:     rgba(255,107,0,0.08);
  --border:       rgba(255,107,0,0.20);
  --border2:      rgba(255,107,0,0.35);
  --text:         #e8e8e8;
  --text2:        #aaa;
  --muted:        #555;
  --nav-bg:       rgba(5,5,5,0.93);
  --scanline-op:  0.35;
  --font-body:    'Fira Code', monospace;
  --font-title:   'Orbitron', monospace;
  --grid-color:   rgba(255,107,0,0.07);
  --particle-col: rgba(255,107,0,0.38);
  --cursor-col:   #FF6B00;

  /* Protocol colors — orange theme */
  --p0: #FF6B00; --p0-glow: rgba(255,107,0,0.4); --p0-floor: #b34a00;
  --p1: #FFD700; --p1-glow: rgba(255,215,0,0.35); --p1-floor: #b39600;
  --p2: #FF3366; --p2-glow: rgba(255,51,102,0.35); --p2-floor: #b32248;
  --p3: #00FFB3; --p3-glow: rgba(0,255,179,0.3);  --p3-floor: #009966;
  --p4: #FF8C00; --p4-glow: rgba(255,140,0,0.4);  --p4-floor: #b36200;
  --p5: #CC44FF; --p5-glow: rgba(204,68,255,0.35); --p5-floor: #8a00cc;
  --p6: #FF2222; --p6-glow: rgba(255,34,34,0.4);  --p6-floor: #aa0000;

  --connector-col: rgba(255,107,0,0.5);
  --module-key-col: #FF6B00;
}

[data-theme="blue"] {
  --accent:       #00F5FF;
  --accent2:      #0080FF;
  --accent-glow:  #00CCFF;
  --bg:           #020810;
  --bg2:          #050e1a;
  --bg3:          #071524;
  --surface:      rgba(0,245,255,0.04);
  --surface2:     rgba(0,245,255,0.08);
  --border:       rgba(0,245,255,0.18);
  --border2:      rgba(0,245,255,0.35);
  --text:         #ddf4ff;
  --text2:        #88c8d8;
  --muted:        #3a6070;
  --nav-bg:       rgba(2,8,16,0.93);
  --scanline-op:  0.25;
  --font-body:    'Fira Code', monospace;
  --font-title:   'Orbitron', monospace;
  --grid-color:   rgba(0,245,255,0.06);
  --particle-col: rgba(0,245,255,0.35);
  --cursor-col:   #00F5FF;

  --p0: #00F5FF; --p0-glow: rgba(0,245,255,0.4); --p0-floor: #007a88;
  --p1: #0080FF; --p1-glow: rgba(0,128,255,0.4); --p1-floor: #003fa8;
  --p2: #00FFB3; --p2-glow: rgba(0,255,179,0.35); --p2-floor: #007a55;
  --p3: #7744FF; --p3-glow: rgba(119,68,255,0.35); --p3-floor: #3300bb;
  --p4: #00CCFF; --p4-glow: rgba(0,204,255,0.4);  --p4-floor: #006688;
  --p5: #44AAFF; --p5-glow: rgba(68,170,255,0.35); --p5-floor: #1155aa;
  --p6: #FF6600; --p6-glow: rgba(255,102,0,0.4);  --p6-floor: #993d00;

  --connector-col: rgba(0,245,255,0.45);
  --module-key-col: #00F5FF;
}

[data-theme="clean"] {
  --accent:       #6366F1;
  --accent2:      #8B5CF6;
  --accent-glow:  #7C3AED;
  --bg:           #f4f4f8;
  --bg2:          #ffffff;
  --bg3:          #ebebf2;
  --surface:      rgba(99,102,241,0.05);
  --surface2:     rgba(99,102,241,0.10);
  --border:       rgba(99,102,241,0.15);
  --border2:      rgba(99,102,241,0.30);
  --text:         #111827;
  --text2:        #4B5563;
  --muted:        #9CA3AF;
  --nav-bg:       rgba(255,255,255,0.95);
  --scanline-op:  0;
  --font-body:    'Inter', sans-serif;
  --font-title:   'Inter', sans-serif;
  --grid-color:   rgba(99,102,241,0.06);
  --particle-col: rgba(99,102,241,0.25);
  --cursor-col:   #6366F1;

  --p0: #6366F1; --p0-glow: rgba(99,102,241,0.35); --p0-floor: #3a3daa;
  --p1: #8B5CF6; --p1-glow: rgba(139,92,246,0.3);  --p1-floor: #5a34c0;
  --p2: #EC4899; --p2-glow: rgba(236,72,153,0.3);  --p2-floor: #a01560;
  --p3: #10B981; --p3-glow: rgba(16,185,129,0.3);  --p3-floor: #047052;
  --p4: #F59E0B; --p4-glow: rgba(245,158,11,0.3);  --p4-floor: #b07008;
  --p5: #EF4444; --p5-glow: rgba(239,68,68,0.3);   --p5-floor: #aa1010;
  --p6: #06B6D4; --p6-glow: rgba(6,182,212,0.3);   --p6-floor: #0e7490;

  --connector-col: rgba(99,102,241,0.4);
  --module-key-col: #6366F1;
}

/* ── RESET ─────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.7;
  overflow-x: hidden;
  cursor: none;
  transition: background 0.4s, color 0.4s;
}
[data-theme="clean"] body { cursor: auto; }
[data-theme="clean"] .cursor,
[data-theme="clean"] #trailContainer { display: none; }

/* ── SCANLINES ─────────────────────────────────────────────── */
body::before {
  content: ''; position: fixed; inset: 0; pointer-events: none;
  background: repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(0,0,0,0.10) 2px, rgba(0,0,0,0.10) 4px);
  z-index: 1000; opacity: var(--scanline-op);
  transition: opacity 0.4s;
}

/* ── CURSOR ─────────────────────────────────────────────────── */
.cursor {
  position: fixed; width: 10px; height: 10px;
  background: var(--cursor-col); border-radius: 50%;
  pointer-events: none; z-index: 9999;
  transform: translate(-50%,-50%);
  transition: width .12s, height .12s, background .12s, border-radius .12s, box-shadow .12s;
  box-shadow: 0 0 8px var(--cursor-col), 0 0 16px rgba(255,107,0,0.4);
  mix-blend-mode: screen;
}
.cursor.hovering {
  width: 20px; height: 20px; border-radius: 4px;
  background: var(--accent2);
  box-shadow: 0 0 14px var(--accent2), 0 0 28px rgba(255,215,0,0.4);
}
.trail-dot {
  position: fixed; border-radius: 50%;
  background: var(--cursor-col); pointer-events: none; z-index: 9990;
  transform: translate(-50%,-50%);
  animation: trailFade 0.4s ease-out forwards;
}
@keyframes trailFade {
  0%   { opacity: 0.5; transform: translate(-50%,-50%) scale(1); }
  100% { opacity: 0;   transform: translate(-50%,-50%) scale(0.1); }
}

/* ── THEME SWITCHER ─────────────────────────────────────────── */
.theme-fab {
  position: fixed; bottom: 2rem; right: 2rem; z-index: 600;
}
.theme-fab-btn {
  width: 48px; height: 48px; border-radius: 50%;
  background: var(--accent); color: var(--bg);
  border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 0 20px var(--p0-glow, rgba(255,107,0,0.5));
  transition: transform 0.25s, box-shadow 0.25s;
}
.theme-fab-btn:hover { transform: rotate(30deg) scale(1.1); }
.theme-panel {
  position: absolute; bottom: 56px; right: 0;
  background: var(--bg2); border: 1px solid var(--border2);
  border-radius: 12px; padding: 12px 8px; min-width: 170px;
  display: none; flex-direction: column; gap: 4px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.6);
}
.theme-panel.open { display: flex; }
.theme-panel-title { font-size: 0.65rem; color: var(--muted); padding: 0 8px 6px; letter-spacing: 0.08em; }
.theme-opt {
  display: flex; align-items: center; gap: 8px; padding: 7px 10px;
  border-radius: 8px; border: none; background: transparent;
  color: var(--text2); cursor: pointer; transition: background 0.15s;
  font-family: var(--font-body); font-size: 0.8rem;
}
.theme-opt:hover { background: var(--surface2); }
.theme-opt.active { background: var(--surface2); color: var(--text); }
.t-dot { width: 14px; height: 14px; border-radius: 50%; flex-shrink: 0; }
.t-name { flex: 1; }
.t-check { opacity: 0; color: var(--accent); font-size: 0.9rem; }
.theme-opt.active .t-check { opacity: 1; }

/* ── SCROLL TOP ─────────────────────────────────────────────── */
.scroll-top {
  position: fixed; bottom: 5.5rem; right: 2.1rem; z-index: 500;
  width: 38px; height: 38px; border-radius: 8px;
  background: var(--surface2); border: 1px solid var(--border2);
  color: var(--accent); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none;
  transition: opacity 0.25s, transform 0.25s;
  stroke: currentColor;
}
.scroll-top.visible { opacity: 1; pointer-events: auto; }
.scroll-top:hover { transform: translateY(-2px); }

/* ══════════════════ NAVBAR ══════════════════════════════════ */
nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 500;
  padding: 0 2rem; border-bottom: 1px solid transparent;
  transition: background 0.4s, border-color 0.4s, backdrop-filter 0.4s;
}
nav.scrolled { 
  background: var(--nav-bg); 
  border-bottom-color: var(--border); 
  backdrop-filter: blur(20px); 
}
[data-theme="clean"] nav { 
  background: var(--nav-bg); 
  border-bottom: 1px solid var(--border); 
}

.nav-inner {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
  border-bottom: 1px solid var(--border);  /* ← AGGIUNGI QUESTO */
}

/* Logo */
.nav-logo-wrap { 
  display: flex; 
  align-items: center; 
  gap: 10px; 
  text-decoration: none; 
}
.nav-logo-svg { 
  width: 36px; 
  height: 36px; 
  color: var(--accent); 
  flex-shrink: 0; 
  transition: color 0.4s; 
}
.nav-logo-text {
  font-family: var(--font-title); 
  font-weight: 900; 
  font-size: 1.3rem;
  letter-spacing: 0.12em; 
  color: var(--accent);
  text-shadow: 0 0 14px var(--accent);
  transition: color 0.4s, text-shadow 0.4s;
}
[data-theme="clean"] .nav-logo-text { 
  text-shadow: none; 
  color: var(--accent); 
}
.logo-accent { color: var(--accent2); }
[data-theme="clean"] .logo-accent { color: var(--accent2); }

/* Nav links */
.nav-links { 
  display: flex; 
  gap: 1.8rem; 
  list-style: none; 
}
.nav-links a {
  font-family: var(--font-body); 
  font-size: 0.76rem; 
  font-weight: 500;
  letter-spacing: 0.08em; 
  color: var(--text2); 
  text-decoration: none;
  text-transform: uppercase; 
  position: relative; 
  padding-bottom: 3px;
  transition: color 0.25s;
}
.nav-links a::after {
  content: ''; 
  position: absolute; 
  bottom: 0; 
  left: 0;
  width: 0; 
  height: 1px;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  transition: width 0.3s;
}
.nav-links a:hover, 
.nav-links a.active { 
  color: var(--accent); 
}
.nav-links a:hover::after, 
.nav-links a.active::after { 
  width: 100%; 
}

.nav-right { 
  display: flex; 
  align-items: center; 
  gap: 1rem; 
}

/* Hamburger */
.hamburger { 
  display: none; 
  flex-direction: column; 
  gap: 5px; 
  background: none; 
  border: none; 
  cursor: pointer; 
  padding: 5px; 
}
.hamburger span { 
  display: block; 
  width: 24px; 
  height: 2px; 
  background: var(--accent); 
  transition: all 0.3s; 
}

/* ═══════════════════════════════════════════════════════════════
PROFILE DROPDOWN — Navbar Integration (ALLINEATO AL MAIN SITE)
═══════════════════════════════════════════════════════════════ */
.profile-dropdown { position: relative; }
.profile-avatar-wrap {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px; background: var(--surface);
  border: 1px solid var(--border); cursor: pointer;
  clip-path: polygon(8px 0, 100% 0, calc(100% - 8px) 100%, 0 100%);
  transition: border-color 0.2s, background 0.2s;
}
.profile-avatar-wrap:hover { border-color: var(--accent); background: var(--surface2); }
[data-theme="clean"] .profile-avatar-wrap { clip-path: none; border-radius: 999px; }
.profile-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  border: 2px solid var(--accent); object-fit: cover;
}
.profile-username {
  font-family: var(--font-body); font-size: 0.8rem;
  font-weight: 600; color: var(--text);
  max-width: 120px; overflow: hidden; text-overflow: ellipsis;
}
.dropdown-menu {
  position: absolute; top: 110%; right: 0;
  background: var(--bg3); border: 1px solid var(--border2);
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
  min-width: 220px; border-radius: 4px; overflow: hidden;
  display: none; z-index: 600; padding: 8px 0;
}
[data-theme="clean"] .dropdown-menu { box-shadow: 0 8px 32px rgba(99,102,241,0.15); }
.profile-stats {
  margin-top: 12px; padding: 12px;
  background: var(--surface); border: 1px solid var(--border);
}
.profile-stat {
  display: flex; justify-content: space-between;
  font-family: var(--font-body); font-size: 0.75rem;
  color: var(--text2); margin-bottom: 4px;
}
.profile-stat-label { display: flex !important; align-items: center; color: var(--muted); }
.profile-stat-value { color: var(--accent2); font-weight: 600; }
.profile-badges { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.profile-badge {
  font-family: var(--font-body); font-size: 0.65rem;
  padding: 2px 8px; background: var(--surface2);
  border: 1px solid var(--border); color: var(--accent);
  clip-path: polygon(4px 0, 100% 0, calc(100% - 4px) 100%, 0 100%);
}
[data-theme="clean"] .profile-badge { clip-path: none; border-radius: 999px; }
.profile-links {
  display: flex; flex-direction: column; gap: 4px;
  margin-top: 12px; padding-top: 12px;
  border-top: 1px solid var(--border);
}
.profile-link {
  font-family: var(--font-body); font-size: 0.75rem;
  color: var(--text2); text-decoration: none;
  padding: 6px 10px; transition: color 0.2s;
}
.profile-link:hover { color: var(--accent); }
.profile-logout {
  font-family: var(--font-body); font-size: 0.72rem;
  color: #FF5F57; background: none; border: none;
  cursor: pointer; text-align: left; padding: 6px 10px;
  transition: color 0.2s;
}
.profile-logout:hover { color: #ff3355; }
.profile-progress-block { margin-top: 10px; padding: 0 12px; }
.profile-progress-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 5px; }
.profile-progress-label { font-family: var(--font-body); font-size: 0.70rem; color: var(--text2); letter-spacing: 0.06em; }
.profile-progress-val { font-family: var(--font-body); font-size: 0.68rem; color: var(--accent2); font-weight: 600; }
.profile-progress-bar { width: 100%; height: 5px; background: var(--surface2); border: 1px solid var(--border); border-radius: 2px; overflow: hidden; position: relative; }
.profile-progress-fill {
  height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent2));
  box-shadow: 0 0 8px var(--accent); border-radius: 2px;
  transition: width 0.6s cubic-bezier(.4,0,.2,1); min-width: 0;
}
[data-theme="clean"] .profile-progress-fill { box-shadow: none; }
.profile-badges-section { margin-top: 12px; padding: 10px 12px; border-top: 1px solid var(--border); }
.profile-badges-title { font-family: var(--font-body); font-size: 0.65rem; color: var(--muted); letter-spacing: 0.15em; text-transform: uppercase; margin-bottom: 8px; }
.badge-locked {
  width: 30px; height: 30px; border-radius: 6px;
  background: var(--surface); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.9rem; opacity: 0.45; cursor: pointer;
  transition: opacity 0.2s, transform 0.2s;
}
.badge-locked:hover { opacity: 0.7; transform: scale(1.1); }
.profile-stat-label { display: flex !important; align-items: center; }

/* ═══════════════════════════════════════════════════════════════
   CYPHER IMAGE (PNG) — Navbar & Profile Dropdown
   ═══════════════════════════════════════════════════════════════ */
/* ═══════════════════════════════════════════════════════════════
   CYPHER IMAGE (PNG) — Navbar & Profile Dropdown
   ═══════════════════════════════════════════════════════════════ */
.cypher-img {
  display: inline-block;
  object-fit: contain;
  transition: transform 0.3s ease, filter 0.3s ease;
  pointer-events: none;
}

/* 1. Navbar (versione grande) */
.cypher-coin-wrap .cypher-img {
  width: 20px;
  height: 20px;
  filter: drop-shadow(0 0 5px var(--accent)) drop-shadow(0 0 12px var(--accent-glow));
  animation: cypherPulse 3s ease-in-out infinite;
}
.cypher-coin-wrap:hover .cypher-img {
  filter: drop-shadow(0 0 10px var(--accent2)) drop-shadow(0 0 22px var(--accent2));
  transform: scale(1.12) rotate(8deg);
}

/* 2. Dropdown Profilo (versione piccola, allineata al testo) */
.profile-stat-label .cypher-img {
  width: 24px;
  height: 24px;
  margin-right: 6px; /* MODIFICATO: da -5px a 6px per spazio corretto */
  vertical-align: middle;
  position: relative;
  top: -1px;
}

/* FAR RISALTARE LA SCRITTA CYPHER */
.profile-stat-label {
  display: flex !important;
  align-items: center;
  color: var(--accent) !important; /* MODIFICATO: da muted ad accent */
  font-weight: 600; /* AGGIUNTO: testo più bold */
  letter-spacing: 0.03em; /* AGGIUNTO: leggero spacing */
}

/* Ancora più evidenza per la prima stat (Cypher) */
.profile-stats .profile-stat:first-child .profile-stat-label {
  color: var(--accent2) !important; /* Oro/giallo nel tema orange */
  font-weight: 700; /* Più bold */
  text-shadow: 0 0 8px rgba(255, 215, 0, 0.3); /* Glow sottile */
}

@keyframes cypherPulse {
  0%, 100% { filter: drop-shadow(0 0 5px var(--accent)) drop-shadow(0 0 10px var(--accent-glow)); }
  50%      { filter: drop-shadow(0 0 9px var(--accent2)) drop-shadow(0 0 18px var(--accent)); }
}

/* Tema CLEAN: rimuove glow ma mantiene visibilità */
[data-theme="clean"] .cypher-img {
  filter: none !important;
  animation: none !important;
}
[data-theme="clean"] .cypher-coin-wrap:hover .cypher-img {
  transform: scale(1.08) rotate(8deg);
}
[data-theme="clean"] .profile-stat-label {
  color: var(--accent) !important;
  text-shadow: none !important;
  font-weight: 700;
}
[data-theme="clean"] .profile-stats .profile-stat:first-child .profile-stat-label {
  color: var(--accent) !important;
}

/* Tema BLUE */
[data-theme="blue"] .profile-stats .profile-stat:first-child .profile-stat-label {
  color: var(--accent) !important; /* Cyan brillante */
  text-shadow: 0 0 8px rgba(0, 245, 255, 0.4);
}
/* OTHERRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRR

/* Profile progress bars */
.profile-progress-block {
  margin-top: 10px; 
  padding: 0 12px;
}
.profile-progress-header {
  display: flex; 
  justify-content: space-between; 
  align-items: center;
  margin-bottom: 5px;
}
.profile-progress-label {
  font-family: var(--font-body); 
  font-size: 0.70rem;
  color: var(--text2); 
  letter-spacing: 0.06em;
}
.profile-progress-val {
  font-family: var(--font-body); 
  font-size: 0.68rem;
  color: var(--accent2); 
  font-weight: 600;
}
.profile-progress-bar {
  width: 100%; 
  height: 5px; 
  background: var(--surface2);
  border: 1px solid var(--border); 
  border-radius: 2px; 
  overflow: hidden;
  position: relative;
}
.profile-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  box-shadow: 0 0 8px var(--accent);
  border-radius: 2px;
  transition: width 0.6s cubic-bezier(.4,0,.2,1);
}
[data-theme="clean"] .profile-progress-fill {
  box-shadow: none;
}

.profile-badges-section {
  margin-top: 12px; 
  padding: 10px 12px;
  border-top: 1px solid var(--border);
}
.profile-badges-title {
  font-family: var(--font-body); 
  font-size: 0.65rem;
  color: var(--muted); 
  letter-spacing: 0.15em; 
  text-transform: uppercase;
  margin-bottom: 8px;
}

/* ══════════════════ ACADEMY HERO ════════════════════════════ */
.academy-hero {
  position: relative; padding: 120px 2rem 60px;
  overflow: hidden;
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
}
.hero-grid {
  position: absolute; inset: 0; pointer-events: none;
  background-image:
    linear-gradient(var(--grid-color) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-color) 1px, transparent 1px);
  background-size: 40px 40px;
  opacity: 0.6;
}
.academy-hero-scan {
  position: absolute; bottom: 0; left: 0; width: 100%; height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: 0.6;
}
.academy-hero-inner {
  position: relative; max-width: 760px; margin: 0 auto; text-align: center; z-index: 2;
}
.academy-hero-badge {
  display: inline-block; margin-bottom: 1rem;
  font-size: 0.72rem; color: var(--accent); letter-spacing: 0.15em;
  font-family: var(--font-body);
}
.academy-hero-title {
  font-family: var(--font-title); font-size: clamp(2.2rem, 6vw, 4rem);
  font-weight: 900; letter-spacing: 0.08em; line-height: 1.05;
  color: var(--text); margin-bottom: 0.7rem;
  text-shadow: 0 0 30px rgba(255,107,0,0.15);
}
[data-theme="blue"] .academy-hero-title { text-shadow: 0 0 30px rgba(0,245,255,0.15); }
[data-theme="clean"] .academy-hero-title { text-shadow: none; }
.academy-hero-sub {
  color: var(--text2); font-size: 0.85rem; margin-bottom: 2rem; letter-spacing: 0.04em;
}
.academy-progress-bar-wrap { text-align: left; }
.academy-progress-label {
  display: flex; justify-content: space-between;
  font-size: 0.72rem; color: var(--text2); margin-bottom: 6px; letter-spacing: 0.05em;
}
.academy-progress-track {
  position: relative; height: 8px; background: var(--surface2);
  border-radius: 4px; overflow: hidden;
  border: 1px solid var(--border);
}
.academy-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  border-radius: 4px; transition: width 0.6s ease;
}
.academy-progress-glow {
  position: absolute; top: 0; right: 0; bottom: 0; width: 60px;
  background: linear-gradient(90deg, transparent, var(--accent-glow));
  opacity: 0.3; border-radius: 4px;
}
.accent-color { color: var(--accent); }

/* ══════════════════ TRAINING MAIN ═══════════════════════════ */
.training-main {
  min-height: 100vh;
  padding: 60px 1.5rem 80px;
  background: var(--bg);
}
.training-path {
  max-width: 680px; margin: 0 auto;
  display: flex; flex-direction: column; align-items: center;
  gap: 0;
}

/* ── PATH CONNECTORS (vertical cyber lines) ─────────────────── */
.path-connector {
  width: 3px; height: 56px;
  background: linear-gradient(180deg, var(--accent), transparent);
  position: relative; flex-shrink: 0;
  opacity: 0.6;
}
.path-connector::before {
  content: ''; position: absolute;
  left: 50%; transform: translateX(-50%);
  top: 0; bottom: 0; width: 1px;
  background: var(--connector-col);
  box-shadow: 0 0 8px var(--connector-col);
}
.path-connector::after {
  content: ''; position: absolute;
  left: 50%; transform: translateX(-50%);
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent);
  bottom: 0; margin-left: -4px;
}
.path-connector-start::before { background: linear-gradient(180deg, transparent, var(--connector-col)); }
.path-connector-end::after { display: none; }

/* ── PROTOCOL BLOCK ─────────────────────────────────────────── */
.protocol-block {
  width: 100%;
  display: flex; flex-direction: column; align-items: center;
}

/* ══════════════════ PROTOCOL BUTTON (3D FLAT DUOLINGO) ══════ */
.protocol-btn {
  position: relative;
  width: 100%; max-width: 600px;
  background: none; border: none; cursor: pointer; padding: 0;
  font-family: var(--font-body);
  transition: transform 0.12s, filter 0.2s;
}
.protocol-btn:active { transform: translateY(3px); }
.protocol-btn.locked { cursor: not-allowed; }
.protocol-btn.locked:active { transform: none; }

/* The visible face */
.proto-btn-inner {
  display: flex; align-items: center; gap: 1.2rem;
  padding: 18px 22px; border-radius: 14px;
  position: relative; z-index: 2;
  border: 2px solid;
  transition: box-shadow 0.2s, background 0.2s;
}

/* The 3D floor / shadow piece */
.proto-btn-floor {
  position: absolute; left: 0; right: 0; bottom: -4px;
  height: 14px; border-radius: 0 0 14px 14px; z-index: 1;
  border: 2px solid transparent;
  transition: height 0.12s, bottom 0.12s;
}
.protocol-btn:not(.locked):active .proto-btn-floor {
  height: 4px; bottom: -2px;
}

/* ── Protocol color themes ─────────────── */
/* Protocol 0 — Networking */
.proto-networking .proto-btn-inner {
  background: linear-gradient(135deg, rgba(255,107,0,0.12), rgba(255,107,0,0.04));
  border-color: var(--p0);
  box-shadow: 0 0 20px var(--p0-glow), inset 0 1px 0 rgba(255,255,255,0.05);
  color: var(--p0);
}
.proto-networking .proto-btn-floor { background: var(--p0-floor); border-color: var(--p0-floor); }
.proto-networking:hover:not(.locked) .proto-btn-inner { box-shadow: 0 0 34px var(--p0-glow), inset 0 1px 0 rgba(255,255,255,0.08); }

/* Protocol 1 — Crypto */
.proto-crypto .proto-btn-inner {
  background: linear-gradient(135deg, rgba(255,215,0,0.1), rgba(255,215,0,0.03));
  border-color: var(--p1);
  box-shadow: 0 0 20px var(--p1-glow), inset 0 1px 0 rgba(255,255,255,0.05);
  color: var(--p1);
}
.proto-crypto .proto-btn-floor { background: var(--p1-floor); border-color: var(--p1-floor); }
.proto-crypto:hover:not(.locked) .proto-btn-inner { box-shadow: 0 0 34px var(--p1-glow), inset 0 1px 0 rgba(255,255,255,0.08); }

/* Protocol 2 — Web */
.proto-web .proto-btn-inner {
  background: linear-gradient(135deg, rgba(255,51,102,0.1), rgba(255,51,102,0.03));
  border-color: var(--p2);
  box-shadow: 0 0 20px var(--p2-glow), inset 0 1px 0 rgba(255,255,255,0.05);
  color: var(--p2);
}
.proto-web .proto-btn-floor { background: var(--p2-floor); border-color: var(--p2-floor); }
.proto-web:hover:not(.locked) .proto-btn-inner { box-shadow: 0 0 34px var(--p2-glow), inset 0 1px 0 rgba(255,255,255,0.08); }

/* Protocol 3 — OSINT */
.proto-osint .proto-btn-inner {
  background: linear-gradient(135deg, rgba(0,255,179,0.1), rgba(0,255,179,0.03));
  border-color: var(--p3);
  box-shadow: 0 0 20px var(--p3-glow), inset 0 1px 0 rgba(255,255,255,0.05);
  color: var(--p3);
}
.proto-osint .proto-btn-floor { background: var(--p3-floor); border-color: var(--p3-floor); }
.proto-osint:hover:not(.locked) .proto-btn-inner { box-shadow: 0 0 34px var(--p3-glow); }

/* Protocol 4 — System */
.proto-system .proto-btn-inner {
  background: linear-gradient(135deg, rgba(255,140,0,0.1), rgba(255,140,0,0.03));
  border-color: var(--p4);
  box-shadow: 0 0 20px var(--p4-glow), inset 0 1px 0 rgba(255,255,255,0.05);
  color: var(--p4);
}
.proto-system .proto-btn-floor { background: var(--p4-floor); border-color: var(--p4-floor); }
.proto-system:hover:not(.locked) .proto-btn-inner { box-shadow: 0 0 34px var(--p4-glow); }

/* Protocol 5 — Reverse */
.proto-reverse .proto-btn-inner {
  background: linear-gradient(135deg, rgba(204,68,255,0.1), rgba(204,68,255,0.03));
  border-color: var(--p5);
  box-shadow: 0 0 20px var(--p5-glow), inset 0 1px 0 rgba(255,255,255,0.05);
  color: var(--p5);
}
.proto-reverse .proto-btn-floor { background: var(--p5-floor); border-color: var(--p5-floor); }
.proto-reverse:hover:not(.locked) .proto-btn-inner { box-shadow: 0 0 34px var(--p5-glow); }

/* Protocol 6 — Advanced */
.proto-advanced .proto-btn-inner {
  background: linear-gradient(135deg, rgba(255,34,34,0.1), rgba(255,34,34,0.03));
  border-color: var(--p6);
  box-shadow: 0 0 20px var(--p6-glow), inset 0 1px 0 rgba(255,255,255,0.05);
  color: var(--p6);
}
.proto-advanced .proto-btn-floor { background: var(--p6-floor); border-color: var(--p6-floor); }
.proto-advanced:hover:not(.locked) .proto-btn-inner { box-shadow: 0 0 34px var(--p6-glow); }

/* Locked state overlay */
.protocol-btn.locked .proto-btn-inner {
  filter: saturate(0.25) brightness(0.6);
  cursor: not-allowed;
}
.protocol-btn.locked .proto-btn-floor { filter: saturate(0.2) brightness(0.5); }

/* ── Protocol inner content ─────────────────────────────────── */
.proto-icon-wrap {
  width: 54px; height: 54px; border-radius: 12px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: currentColor;
  opacity: 1;
}
.proto-icon-wrap svg { color: var(--bg2); }
.proto-icon { width: 30px; height: 30px; }

.proto-info { flex: 1; text-align: left; }
.proto-tag { font-size: 0.62rem; letter-spacing: 0.15em; opacity: 0.7; margin-bottom: 2px; font-family: var(--font-body); }
.proto-name { font-family: var(--font-title); font-size: 1rem; font-weight: 700; color: var(--text); line-height: 1.2; }
.proto-desc { font-size: 0.72rem; color: var(--text2); margin-top: 2px; }

.proto-meta { text-align: center; flex-shrink: 0; min-width: 52px; }
.proto-modules-count { font-family: var(--font-title); font-size: 1.1rem; font-weight: 700; color: currentColor; }
.proto-meta-label { font-size: 0.62rem; color: var(--text2); margin-top: 1px; }
.proto-lock-badge { font-size: 1.2rem; margin-top: 4px; }
.proto-chevron { font-size: 0.8rem; margin-top: 4px; color: currentColor; transition: transform 0.25s; }
.proto-chevron.open { transform: rotate(180deg); }

/* ══════════════════ MODULES CONTAINER ═══════════════════════ */
.modules-container {
  width: 100%; max-width: 600px;
  padding: 12px 0 4px;
  animation: expandIn 0.3s ease;
}
@keyframes expandIn {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.modules-path {
  display: flex; flex-wrap: wrap; justify-content: center;
  gap: 12px 20px; position: relative; padding: 16px 10px;
  border: 1px solid var(--border); border-radius: 12px;
  background: var(--surface);
}
.modules-path.locked-path { background: rgba(0,0,0,0.2); }

/* Cyber connecting line inside modules */
.module-line {
  display: none; /* hidden — visual connection is done by border */
}

/* ── MODULE NODE ─────────────────────────────────────────────── */
.module-node {
  display: flex; flex-direction: column; align-items: center; gap: 5px;
  cursor: pointer; transition: transform 0.15s;
  width: 70px;
}
.module-node:hover:not(.locked) { transform: translateY(-3px); }
.module-node.locked { cursor: not-allowed; opacity: 0.45; }

.module-key-wrap {
  width: 48px; height: 48px; border-radius: 50%;
  background: var(--surface2); border: 2px solid var(--module-key-col);
  display: flex; align-items: center; justify-content: center;
  position: relative; flex-shrink: 0;
  box-shadow: 0 0 12px rgba(255,107,0,0.2), 0 4px 0 rgba(255,107,0,0.3);
  transition: box-shadow 0.2s, background 0.2s;
}
.module-node:not(.locked):hover .module-key-wrap {
  background: rgba(255,107,0,0.15);
  box-shadow: 0 0 22px rgba(255,107,0,0.5), 0 4px 0 rgba(255,107,0,0.4);
}
[data-theme="blue"] .module-key-wrap {
  border-color: var(--module-key-col);
  box-shadow: 0 0 12px rgba(0,245,255,0.2), 0 4px 0 rgba(0,245,255,0.25);
}
[data-theme="clean"] .module-key-wrap {
  border-color: var(--module-key-col);
  box-shadow: 0 0 8px rgba(99,102,241,0.2), 0 4px 0 rgba(99,102,241,0.3);
}

.module-node.locked .module-key-wrap {
  border-color: var(--muted);
  box-shadow: 0 2px 0 rgba(0,0,0,0.5);
  background: var(--surface);
}

.module-key {
  width: 22px; height: 22px; color: var(--module-key-col);
}
.lock-icon svg { width: 18px; height: 18px; color: var(--muted); }

.module-label {
  font-size: 0.62rem; color: var(--text2); text-align: center;
  line-height: 1.3; letter-spacing: 0.02em;
  max-width: 68px;
}
.module-node.locked .module-label { color: var(--muted); }

/* Completed module state */
.module-node.completed .module-key-wrap {
  background: var(--accent); border-color: var(--accent);
  box-shadow: 0 0 18px var(--accent), 0 4px 0 var(--accent-glow);
}
.module-node.completed .module-key { color: var(--bg); }

/* ══════════════════ FINAL NODE ══════════════════════════════ */
.final-node {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  margin-top: 12px; padding-top: 20px;
}
.final-node-ring {
  width: 80px; height: 80px; border-radius: 50%;
  border: 2px solid var(--border);
  box-shadow: 0 0 30px var(--surface2);
  position: absolute;
  animation: ringPulse 3s ease-in-out infinite;
  opacity: 0.4;
}
@keyframes ringPulse {
  0%,100% { transform: scale(1); opacity: 0.3; }
  50%      { transform: scale(1.12); opacity: 0.6; }
}
.final-node-inner {
  position: relative; z-index: 2;
  width: 64px; height: 64px; border-radius: 50%;
  background: var(--surface); border: 2px solid var(--border2);
  display: flex; align-items: center; justify-content: center;
  color: var(--accent); opacity: 0.4;
}
.final-node-label {
  font-family: var(--font-title); font-size: 0.65rem;
  color: var(--muted); letter-spacing: 0.1em;
}

/* ══════════════════ MODULE MODAL ════════════════════════════ */
.modal-overlay {
  position: fixed; inset: 0; z-index: 800;
  background: rgba(0,0,0,0.75); backdrop-filter: blur(8px);
  display: none; align-items: center; justify-content: center; padding: 1.5rem;
}
.modal-overlay.open { display: flex; }

.modal-box {
  background: var(--bg2); border: 1px solid var(--border2);
  border-radius: 16px; max-width: 480px; width: 100%;
  padding: 28px; position: relative;
  box-shadow: 0 16px 60px rgba(0,0,0,0.7), 0 0 40px var(--surface2);
  animation: modalIn 0.2s ease;
}
@keyframes modalIn {
  from { opacity: 0; transform: scale(0.94) translateY(10px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}
.modal-close {
  position: absolute; top: 14px; right: 14px;
  width: 32px; height: 32px; border-radius: 8px;
  background: var(--surface2); border: 1px solid var(--border);
  color: var(--text2); cursor: pointer; font-size: 0.9rem;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.15s, color 0.15s;
}
.modal-close:hover { background: var(--surface2); color: var(--text); }
.modal-header { margin-bottom: 1.2rem; }
.modal-tag { font-size: 0.65rem; color: var(--accent); letter-spacing: 0.12em; margin-bottom: 6px; }
.modal-title { font-family: var(--font-title); font-size: 1.4rem; color: var(--text); margin-bottom: 6px; }
.modal-desc { font-size: 0.82rem; color: var(--text2); line-height: 1.6; }
.modal-soon { text-align: center; padding: 20px 0; }
.modal-soon-icon { font-size: 2.5rem; margin-bottom: 10px; }
.modal-soon-title { font-family: var(--font-title); font-size: 1.1rem; color: var(--accent); margin-bottom: 6px; }
.modal-soon-sub { font-size: 0.8rem; color: var(--text2); line-height: 1.6; margin-bottom: 1.2rem; }

/* ── Shared buttons ─────────────────────────────────────────── */
.btn-primary {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 6px; padding: 10px 22px; border-radius: 8px;
  background: var(--accent); color: var(--bg);
  font-family: var(--font-title); font-size: 0.78rem; font-weight: 700;
  letter-spacing: 0.06em; text-decoration: none; border: none; cursor: pointer;
  transition: box-shadow 0.2s, transform 0.15s, filter 0.15s;
  box-shadow: 0 0 16px rgba(255,107,0,0.35), 0 4px 0 var(--p0-floor, #b34a00);
  position: relative; top: 0;
}
.btn-primary:hover { filter: brightness(1.1); box-shadow: 0 0 24px rgba(255,107,0,0.5), 0 4px 0 var(--p0-floor, #b34a00); }
.btn-primary:active { transform: translateY(3px); box-shadow: 0 0 12px rgba(255,107,0,0.3), 0 1px 0 var(--p0-floor, #b34a00); }
.btn-modal { margin-top: 0.5rem; }

/* ══════════════════ FOOTER ══════════════════════════════════ */
footer {
  background: var(--bg2); border-top: 1px solid var(--border);
  padding: 2rem;
}
.footer-inner {
  max-width: 1280px; margin: 0 auto;
  display: flex; flex-wrap: wrap; gap: 1.5rem;
  align-items: center; justify-content: space-between;
}
.footer-logo-wrap { display: flex; align-items: center; gap: 8px; }
.footer-logo-svg { width: 24px; height: 28px; color: var(--accent); }
.footer-logo-text { font-family: var(--font-title); font-size: 0.85rem; font-weight: 900; color: var(--text); }
.footer-copy { font-size: 0.72rem; color: var(--text2); text-align: center; }
.footer-sub { color: var(--muted); font-size: 0.68rem; }
.footer-links { display: flex; gap: 1rem; }
.footer-links a { font-size: 0.75rem; color: var(--text2); text-decoration: none; transition: color 0.2s; }
.footer-links a:hover { color: var(--accent); }

/* ══════════════════ RESPONSIVE ══════════════════════════════ */
@media (max-width: 680px) {
  .nav-links { display: none; }
  .nav-links.open {
    display: flex; flex-direction: column;
    position: absolute; top: 60px; left: 0; right: 0;
    background: var(--nav-bg); border-bottom: 1px solid var(--border);
    padding: 12px;
  }
  .nav-hamburger {
    display: flex; flex-direction: column; gap: 4px;
    background: none; border: none; cursor: pointer; padding: 8px;
  }
  .nav-hamburger span { display: block; width: 20px; height: 2px; background: var(--text); border-radius: 1px; }

  .proto-btn-inner { flex-wrap: wrap; gap: 0.8rem; padding: 14px 16px; }
  .proto-info { min-width: 0; }
  .proto-name { font-size: 0.88rem; }
  .proto-desc { display: none; }

  .academy-hero { padding: 100px 1.2rem 40px; }
  .academy-hero-title { font-size: 2rem; }

  .modules-path { gap: 10px 14px; }
  .module-node { width: 60px; }
  .module-key-wrap { width: 42px; height: 42px; }
  .module-key { width: 18px; height: 18px; }
  .module-label { font-size: 0.58rem; }
}

/* ── Scan animation on module open ──────────────────────────── */
@keyframes scanLine {
  0%   { transform: translateY(-100%); }
  100% { transform: translateY(100%); }
}
.modules-container::before {
  content: ''; position: absolute; left: 0; top: 0;
  width: 100%; height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: 0; pointer-events: none;
}

/* FIX FINALE: impedisce qualsiasi spostamento verticale del profilo */
.nav-right {
  align-items: center;
  height: 100%;
}

.profile-avatar-wrap * {
  transition: none; /* evita micro-spostamenti */
}

/* ── EXTRA NAV ITEMS: Learn & Shop ─────────────────────────── */
.nav-links .nav-learn-link {
  color: var(--accent) !important;
  font-weight: 600 !important;
  letter-spacing: 0.12em !important;
}
.nav-links .nav-learn-link::after {
  background: linear-gradient(90deg, var(--accent), var(--accent2)) !important;
}
.nav-links .nav-shop-link {
  color: var(--accent2) !important;
  font-weight: 600 !important;
}
.nav-links .nav-shop-link::after {
  background: linear-gradient(90deg, var(--accent2), var(--accent)) !important;
}