/* RESET E BASE */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* Lo scroll si fa sul body, scrollbar a destra */
html, body {
  width: 100%;
  min-height: 100vh;
  font-family: 'Nunito Sans', sans-serif;
  background: black;
  color: white;
  overflow-y: scroll;  /* Ecco la scrollbar a destra */
}

/* Sfondo Matrix a larghezza/altezza piene */
canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
}

/* Contenitore chat centrato, niente position absolute,
   così la scrollbar copre tutto il body */
.chat-container {
  position: relative;
  z-index: 1;
  max-width: 600px;
  width: 100%;
  margin: 0 auto;       /* centratura orizzontale */
  padding: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  /* Lasciamo min-height al body, così la pagina scorre */
}

.logo {
  text-align: center;
  margin-bottom: 1rem;
}

.logo img {
  width: 80px;
}

/* MESSAGGI */
.message {
  padding: 1.1rem 1.5rem;
  border-radius: 1rem;
  max-width: 80%;
  font-size: 1.2rem;
  background: #2c2c2c;
  box-shadow: 0 0 5px rgba(255, 0, 255, 0.15);
  line-height: 1.6;
  letter-spacing: 0.2px;
  animation: fadeIn 0.6s ease-out forwards;
}

.bot {
  align-self: flex-start;
  background: #1f1f1f;
}

.user {
  align-self: flex-end;
  background: var(--accent-color);
}

/* ANIMAZIONE DI FADE */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* OPZIONI (pulsanti) */
.options {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 1rem;
  animation: fadeIn 1s ease-out forwards;
}

.option-btn {
  padding: 1rem 2rem;
  border-radius: 1rem;
  font-size: 1.2rem;
  font-weight: 700;
  border: none;
  cursor: pointer;
  background: #444;
  color: white;
  transition: all 0.3s ease;
}

.option-btn:hover {
  background: var(--accent-color);
}

/* CTA e LOGO tool */
.tool-logo {
  width: 120px;
  margin: 1rem auto;
  display: block;
}

.cta-btn {
  margin-top: 1.5rem;
  padding: 1rem 2.5rem;
  border: none;
  border-radius: 1rem;
  font-size: 1.1rem;
  cursor: pointer;
  background-color: var(--accent-color);
  color: white;
}

/* BOTTONE INDIETRO -> BIANCO! */
.back-btn {
  background: none !important;
  border: none !important;
  color: #fff !important; /* Forzato bianco */
  margin-top: 1rem;
  cursor: pointer;
  align-self: flex-start;
  font-size: 1rem;
  text-decoration: underline;
}

/* IMG MESSAGGIO */
.img-message {
  max-width: 80%;
  border-radius: 1rem;
  margin: 1rem 0;
  align-self: flex-start;
  animation: fadeIn 0.6s ease-out forwards;
}

/* RESPONSIVE */
@media screen and (max-width: 600px) {
  .chat-container {
    padding: 1rem;
    gap: 1rem;
  }
  .message {
    font-size: 1rem;
  }
  .option-btn,
  .cta-btn,
  .back-btn {
    font-size: 1rem;
    padding: 0.8rem 1.2rem;
  }
  .tool-logo {
    width: 90px;
  }
}
