/* ===============================================
   TEMA ALLINEATO ALLO STYLE.CSS PRINCIPALE
=============================================== */

:root {
  --accent: crimson;
  --accent-rgb: 220,20,60;
  --text-strong: #e6e6e6;
}

body.theme-necro {
  --accent: crimson;
  --accent-rgb: 220,20,60;
  --text-strong: #ffb6c1;
}

body.theme-dark {
  --accent: #00bcd4;
  --accent-rgb: 0,188,212;
  --text-strong: #dffbff;
}

body.theme-xpop {
  --accent: #c56bff;
  --accent-rgb: 197,107,255;
  --text-strong: #f2d4ff;
}

body.theme-rainbow {
  --accent: #fff;
  --accent-rgb: 255,255,255;
  --text-strong: #fff;
}

/* ===============================================
   PAGE LAYOUT – vetro unificato
=============================================== */

.tutorial-page {
  max-width: 1100px;
  margin: 100px auto;
  padding: 40px 40px 60px;

  text-align: center;
  color: var(--text-strong);

  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur));
  border-radius: 22px;
  border: 1px solid var(--accent-soft);
  box-shadow:
    0 15px 40px rgba(0,0,0,.6),
    inset 0 0 25px rgba(0,0,0,.35);
}

body.theme-rainbow .tutorial-page {
  border-radius: 0;
  border: 2px solid transparent;
  border-image: var(--rainbow-gradient) 1;
  background: rgba(255,255,255,0.15);
  box-shadow:
    0 0 35px rgba(255,255,255,0.4),
    inset 0 0 25px rgba(0,0,0,0.5);
}

.tutorial-section {
  margin-top: 60px;
  padding-bottom: 40px;
  border-bottom: 1px solid rgba(255,255,255,0.10);
}

.tutorial-page p,
.tutorial-section p,
.tutorial-section li {
  max-width: 800px;
  margin: 12px auto;
  text-align: left;
  line-height: 1.65;
  font-size: 16px;
  color: var(--text-strong);
}

/* ===============================================
   WARNING BOX – dinamico per tema
=============================================== */

.warning {
  position: relative;
  padding: 18px 26px;
  margin: 35px auto;
  max-width: 950px;

  font-weight: 650;
  text-align: left;
  border-radius: 14px;

  background: rgba(0,0,0,0.35);
  backdrop-filter: blur(calc(var(--glass-blur) - 3px));
  border-left: 5px solid var(--accent);
  color: var(--text-strong);

  box-shadow:
    0 0 16px rgba(var(--accent-rgb),0.5),
    inset 0 0 20px rgba(0,0,0,0.4);
}

.warning::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(circle at 10% 120%, rgba(var(--accent-rgb),0.15), transparent 80%);
  opacity: .35;
  pointer-events: none;
}

/* Rainbow */
body.theme-rainbow .warning {
  border-radius: 0;
  border-left: 4px solid transparent;
  border-image: var(--rainbow-gradient) 1;
  background: rgba(255,255,255,0.15);
  color: #fff;
}

.snippet-title {
  text-align: left;
  margin: 40px 0 10px;
  font-size: 20px;
  font-weight: 700;
  color: var(--accent);
  text-shadow: 0 0 6px rgba(var(--accent-rgb),0.4);
}

.code-wrapper {
  position: relative;
  margin: 15px 0 32px;
}

.copy-btn {
  position: absolute;
  top: 8px;
  right: 12px;

  padding: 4px 10px;
  font-size: 12px;

  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: 6px;
  color: #fff;

  transition: .2s ease;
}

.copy-btn:hover {
  background: var(--accent);
  color: #000;
}

.code-block {
  background: rgba(0,0,0,0.55);
  border: 1px solid rgba(255,255,255,0.12);
  border-left: 5px solid var(--accent);

  padding: 22px 22px 22px 65px;

  border-radius: 14px;
  max-height: 650px;
  overflow-x: auto;

  white-space: pre;
  font-family: Consolas, monospace;
  font-size: 14px;
  color: #eee;
  line-height: 1.38;

  counter-reset: line;
}

.code-block.error {
  border-left-color: #ff4444;
  background: rgba(70,0,0,0.45);
  color: #ffaaaa;
}

body.theme-rainbow .code-block {
  border-radius: 0;
  border-left: 4px solid transparent;
  border-image: var(--rainbow-gradient) 1;

  background: rgba(255,255,255,0.12);
  backdrop-filter: blur(22px) saturate(200%);

  box-shadow:
    0 0 25px rgba(255,255,255,0.3),
    inset 0 0 25px rgba(255,255,255,0.1),
    inset 0 0 12px rgba(0,0,0,0.6);
}

.code-block span {
  display: block;
  counter-increment: line;
  position: relative;
}

.code-block span::before {
  content: counter(line);
  position: absolute;
  left: -45px;
  width: 35px;
  text-align: right;
  color: rgba(255,255,255,0.3);
  font-size: 12px;
  user-select: none;
}

.code-block span:hover {
  background: rgba(255,255,255,0.08);
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 18px;
  margin-top: 30px;
}

.gallery-item img {
  width: 100%;
  border-radius: 6px;
  opacity: 0.85;
  transition: .25s ease;
}

.gallery-item img:hover {
  opacity: 1;
  transform: scale(1.03);
}

