/* home.css — hero, box input chat, composer, sezioni della home, vista chat */

.home {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 6vh 24px 80px;
  width: 100%;
  max-width: 860px;
  margin: 0 auto;
}

/* ---- hero ---- */
.hero { text-align: center; margin-bottom: 28px; }
.hero .hero-emoji { font-size: 46px; }
.hero h1 {
  font-size: clamp(28px, 5vw, 40px);
  background: linear-gradient(120deg, var(--text), var(--accent));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
/* L'emoji NON va riempita dal gradiente del titolo, altrimenti diventa
   un cerchio azzurro: la rendo a colori veri. */
.hero h1 .hero-title-emoji { -webkit-text-fill-color: initial; }
.hero .subtitle {
  color: var(--text-muted);
  font-size: 15px;
  max-width: 560px;
  margin: 0 auto;
}

/* ---- composer (box input + toggle) ---- */
.composer {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  transition: border-color var(--t);
}
.composer:focus-within { border-color: var(--accent); }

.composer-input-row {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  padding: 12px 12px 8px;
}
.composer textarea {
  flex: 1;
  resize: none;
  border: none;
  background: transparent;
  outline: none;
  max-height: 220px;
  min-height: 26px;
  line-height: 1.5;
  font-size: 15px;
  padding: 4px 2px;
}
.composer-send {
  width: 38px; height: 38px;
  border-radius: var(--radius-sm);
  background: var(--accent-strong);
  color: #0b1020;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 18px; font-weight: 700;
  flex: 0 0 auto;
  transition: background var(--t-fast), opacity var(--t-fast);
}
.composer-send:hover { background: var(--accent); }
.composer-send:disabled { opacity: 0.4; cursor: not-allowed; }

.composer-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  padding: 8px 12px 12px;
  border-top: 1px solid var(--border);
}

/* ---- composer: allegati (pulsante 📎, drag&drop, anteprime) ---- */
.composer-fileinput { display: none; }
.composer.is-dragover {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-soft);
}
.composer-attach {
  width: 34px; height: 34px;
  flex: 0 0 auto;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: var(--radius-sm);
  font-size: 17px;
  color: var(--text-muted);
  transition: background var(--t-fast), color var(--t-fast);
}
.composer-attach:hover { background: var(--bg-hover); color: var(--text); }

.composer-attachments {
  display: flex; flex-wrap: wrap; gap: 8px;
  padding: 0 12px 4px;
}
.att-chip {
  display: inline-flex; align-items: center; gap: 8px;
  max-width: 220px;
  padding: 5px 6px 5px 8px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.att-thumb { width: 30px; height: 30px; border-radius: 4px; object-fit: cover; flex: 0 0 auto; }
.att-ico {
  width: 30px; height: 30px; flex: 0 0 auto;
  display: inline-flex; align-items: center; justify-content: center; font-size: 18px;
}
.att-name {
  font-size: 12.5px; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.att-x {
  width: 20px; height: 20px; flex: 0 0 auto;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%; font-size: 11px; color: var(--text-faint);
  transition: background var(--t-fast), color var(--t-fast);
}
.att-x:hover { background: var(--danger-soft); color: var(--danger); }

/* anteprime dentro la bolla del messaggio utente */
.bubble-atts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.bubble-text { white-space: pre-wrap; }

/* ---- barra modalità (turista/god) in cima alla home ---- */
.mode-bar {
  display: flex; align-items: center; flex-wrap: wrap; gap: 10px;
  margin: 0 0 18px;
}
.mode-tag {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12.5px; font-weight: 600;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  background: var(--bg-elevated-2);
  color: var(--text-muted);
}
.mode-tag.god { color: var(--both); background: var(--both-soft); }
.btn-sm { padding: 5px 12px; font-size: 13px; }
.gate-input-sm { padding: 6px 10px; font-size: 13.5px; max-width: 220px; }

/* ---- blocchi home ---- */
.home-section { width: 100%; margin-top: 34px; }
.home-section > h2 {
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-faint);
  margin-bottom: 12px;
  display: flex; align-items: center; gap: 8px;
}
.home-section .section-actions { margin-left: auto; }

/* ---- vista chat (quando si invia un messaggio) ---- */
.chat-view {
  display: flex;
  flex-direction: column;
  height: 100%;
}
.chat-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
}
.chat-thread {
  max-width: var(--maxw-content);
  margin: 0 auto;
}
.chat-msg { margin-bottom: 18px; }
.chat-msg .bubble-user {
  background: var(--accent-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  margin-left: auto;
  max-width: 80%;
  width: fit-content;
}
.chat-composer-dock {
  flex: 0 0 auto;
  padding: 12px 24px 20px;
  border-top: 1px solid var(--border);
  background: var(--bg-app);
}
.chat-composer-dock .composer { max-width: var(--maxw-content); margin: 0 auto; }
.chat-header {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 24px; border-bottom: 1px solid var(--border);
}
.chat-header .chat-title { font-weight: 600; }
