/* ===== Variabili Globali ===== */
/* Palette colori: Tema scuro con accenti verde neon (stile terminale/hacker) */
:root {
  --bg-color: #000000;
  --bg-secondary: #111111;
  --text-color: #00ff66;
  --text-hover: #66ffcc;
  --shadow-strong: rgba(0, 255, 102, 0.66);
  --shadow-weak: rgba(0, 255, 102, 0.2);
  --header-height: 70px;
}

/* ===== Header fisso ===== */
/* Posizionato in alto (fixed) sopra ogni altro elemento (z-index: 1000) */
header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  min-height: var(--header-height);
  padding: 0.50rem 0.50rem; /* aggiunto padding interno */
  background-color: var(--bg-color);
  border-bottom: 2px solid var(--text-color);
  display: flex;
  justify-content: center;
  align-items: center;
  color: var(--text-color);
  font-family: "Courier New", monospace;
  font-size: 2rem;
  z-index: 1000;
  box-shadow: 0 2px 10px var(--shadow-strong);
  box-sizing: border-box;
  text-align: center; /* Centra testo se va a capo */
}

/* ===== Contenuto principale ===== */
/* Padding-top dinamico: compensa l'altezza dell'header fisso per evitare sovrapposizioni */
#content {
  padding-top: calc(var(--header-height) + 3rem); /* Spazio dinamico per l'header */
  padding-left: 1em;
  padding-right: 1em;
  font-size: 18px;
  line-height: 1.6;
  max-width: 800px;
  margin: 0 auto;
  box-sizing: border-box;
}

#content p {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 1rem;
  box-sizing: border-box;
}

/* ===== Back Home Link (Viewer) ===== */
#back-home {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 1em;
  box-sizing: border-box;
}

/* ===== Body & Global Styles ===== */
body {
  background-color: var(--bg-color);
  color: var(--text-color);
  font-family: "Courier New", Courier, monospace;
  margin: 0;
  padding: 1rem;
  line-height: 1.6;
}

/* ===== Heading ===== */
h1 {
  font-size: 2.5rem;
  text-align: center;
  margin-bottom: 2rem;
}

/* ===== Liste (ul, li) ===== */
ul {
  list-style-type: none;
  padding: 0;
  max-width: 600px;
  margin: 0 auto;
}

li {
  margin: 0.5rem 0;
}

/* Stile card per la lista video (simile a bio-feed) */
#video-list li {
  border: 1px solid var(--text-color);
  border-radius: 6px;
  padding: 1rem;
  margin-bottom: 1rem;
  box-shadow: 0 0 10px var(--shadow-strong);
  background-color: var(--bg-secondary);
}

/* ===== Menu Box (Index) ===== */
#menu {
  max-width: 800px;
  width: 100%;
  background-color: var(--bg-secondary);
  border: 1px solid var(--text-color);
  border-radius: 6px;
  padding: 2rem;
  margin: 2rem auto;
  box-shadow: 0 0 10px var(--shadow-strong);
  box-sizing: border-box;
  text-align: left;
}

/* ===== Link ===== */
a {
  color: var(--text-color);
  text-decoration: none;
  font-weight: bold;
  position: relative;
  transition: all 0.3s ease;
}

a::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 0;
  height: 2px;
  background-color: var(--text-color);
  transition: width 0.3s ease;
}

a:hover {
  color: var(--text-hover);
  text-shadow: 0 0 5px var(--text-color), 0 0 10px var(--text-color);
}

a:hover::after {
  width: 100%;
}

#contact {
  max-width: 800px; /* come #intro */
  width: 100%;
  margin: 2rem auto; /* margine verticale e centratura orizzontale */
  padding: 0;
  box-sizing: border-box;
}

/* ===== Form ===== */
/* Stile unificato per il form di contatto, allineato visivamente agli altri box */
form {
  max-width: 800px;
  width: 100%;
  margin: 2rem auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  background-color: var(--bg-secondary);
  padding: 2rem;
  border: 1px solid var(--text-color);
  border-radius: 6px;
  box-shadow: 0 0 10px var(--shadow-strong);
  box-sizing: border-box;
}

form h2 {
  margin-top: 0;
  text-align: center;
}

form label {
  font-weight: bold;
  color: var(--text-color);
}

form input,
form textarea {
  background-color: var(--bg-color);
  color: var(--text-color);
  border: 1px solid var(--text-color);
  padding: 0.75rem;
  font-family: "Courier New", Courier, monospace;
  font-size: 1rem;
  resize: vertical;
}

/* ===== Correzione autocomplete per i campi input ===== */
/* Hack per sovrascrivere lo stile di default (giallo/bianco) che Chrome applica all'autocompletamento */
input:-webkit-autofill,
textarea:-webkit-autofill {
  box-shadow: 0 0 0 1000px var(--bg-color) inset !important;
  -webkit-text-fill-color: var(--text-color) !important;
}

/* Focus styling */
form input:focus,
form textarea:focus {
  outline: none;
  border-color: var(--text-hover);
  box-shadow: 0 0 5px var(--text-color);
}

form button {
  background-color: var(--text-color);
  color: var(--bg-color);
  font-weight: bold;
  font-family: "Courier New", Courier, monospace;
  padding: 0.75rem;
  border: none;
  cursor: pointer;
  transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

form button:hover {
  background-color: var(--text-hover);
  box-shadow: 0 0 10px var(--text-color), 0 0 20px var(--text-color);
}

/* ===== Intro block ===== */
/* Box di testo introduttivi: usati in Home, Video e Liminal per coerenza visiva */
.intro {
  background-color: var(--bg-secondary);
  border: 1px solid var(--text-color);
  border-radius: 6px;
  padding: 2rem;
  margin: 1rem auto 2rem;
  max-width: 800px;
  width: 100%;
  box-sizing: border-box;
  font-size: 1.1rem;
  line-height: 1.7;
  color: var(--text-color);
  box-shadow: 0 0 10px var(--shadow-strong);
  font-style: italic;
}

/* ===== Footer disclaimer ===== */
/* Footer stilizzato come avviso di sistema */
#footer-disclaimer {
  position: relative; /* da fixed a relative */
  width: 100%;
  background-color: var(--bg-secondary);
  color: var(--text-color);
  padding: 1rem 2rem;
  border-top: 2px solid var(--text-color);
  box-shadow: none; /* togli ombra */
  font-family: "Courier New", Courier, monospace;
  font-size: 0.9rem;
  box-sizing: border-box;
  margin-top: 2rem;
}

#footer-close-btn {
  position: absolute;
  top: 0.3rem;
  right: 1rem;
  background: transparent;
  border: none;
  color: var(--text-color);
  font-weight: bold;
  font-size: 1.4rem;
  cursor: pointer;
  font-family: monospace;
}

#footer-close-btn:hover {
  color: var(--text-hover);
}

/* ===== Responsive per mobile ===== */
/* Adattamenti per schermi piccoli (< 600px) */
@media (max-width: 600px) {
  body {
    padding: 0.5rem;
  }

  h1 {
    font-size: 2rem;
  }

  header {
    font-size: 1.2rem; /* Riduce font header su mobile per evitare wrap eccessivi */
  }

  li {
    font-size: 1rem;
  }

  #content {
    font-size: 1rem; /* corretto da 18px a 1rem (16px) */
  }
}
