/* nallium-gather-frontend — design system
 *
 * Tokens (:root) et classes de "chrome" (topbar, boutons, panels, alertes)
 * copiés à l'identique de nallium-drive-frontend/css/style.css pour rester
 * visuellement cohérent avec le reste de l'écosystème Nallium — étendus
 * avec les éléments propres à Gather (sidebar équipes/salons, bulles de
 * chat, panneau d'appel, sous-titres).
 */

:root {
  --text: #172033;
  --muted: #64748b;
  --blue: #3b82f6;
  --green: #22c55e;
  --amber: #f59e0b;
  --pink: #ec4899;
  --violet: #8b5cf6;
  --red: #ef4444;
  --cyan: #06b6d4;
  --bg: #f7f9ff;
  --panel: rgba(255, 255, 255, 0.9);
  --panel-solid: #ffffff;
  --border: rgba(30, 41, 59, 0.12);
  --shadow: 0 24px 80px rgba(30, 41, 59, 0.12);
  --shadow-soft: 0 14px 38px rgba(30, 41, 59, 0.09);
  --radius: 22px;
}

* {
  box-sizing: border-box;
}

html,
body {
  max-width: 100%;
  overflow-x: hidden;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 10% 4%, rgba(59, 130, 246, 0.16), transparent 28%),
    radial-gradient(circle at 90% 12%, rgba(236, 72, 153, 0.12), transparent 24%),
    radial-gradient(circle at 72% 88%, rgba(34, 197, 94, 0.13), transparent 26%),
    var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a {
  color: var(--blue);
  text-decoration: none;
}

button {
  font: inherit;
}

/* ---------------------------------------------------------------------
 * Barre de navigation
 * ------------------------------------------------------------------- */
.store-topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 14px 28px;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}

.store-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 900;
  font-size: 18px;
  letter-spacing: -0.02em;
  color: #0f172a;
  cursor: pointer;
}

.store-brand-logo {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  padding: 2px;
  background: conic-gradient(from 180deg, var(--blue), var(--green), var(--amber), var(--pink), var(--violet), var(--blue));
}

.store-brand-logo span {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  border-radius: 10px;
  background: #ffffff;
  font-weight: 950;
  font-size: 15px;
  color: #111827;
}

.store-user {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--muted);
  white-space: nowrap;
}

.store-user-avatar {
  width: 30px;
  height: 30px;
  border-radius: 999px;
  background: var(--violet);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 13px;
}

.btn {
  border: none;
  border-radius: 999px;
  padding: 9px 18px;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.btn:active {
  transform: scale(0.97);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--blue);
  color: #fff;
  box-shadow: 0 10px 24px rgba(59, 130, 246, 0.28);
}

.btn-outline {
  background: #fff;
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-danger {
  background: #fff;
  color: var(--red);
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
}

/* ---------------------------------------------------------------------
 * Layout général
 * ------------------------------------------------------------------- */
.store-page {
  max-width: 1280px;
  margin: 0 auto;
  padding: 28px 24px 60px;
}

.panel {
  background: var(--panel-solid);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 22px;
  box-shadow: var(--shadow-soft);
  margin-bottom: 20px;
}

.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--text);
}

.form-control {
  width: 100%;
  border-radius: 12px;
  border: 1px solid var(--border);
  padding: 10px 14px;
  font-size: 14px;
  background: #fff;
}

.hint {
  font-size: 12px;
  color: var(--muted);
}

.alert-banner {
  border-radius: 14px;
  padding: 12px 16px;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 18px;
}

.alert-banner.error {
  background: rgba(239, 68, 68, 0.1);
  color: #b91c1c;
}

.alert-banner.success {
  background: rgba(34, 197, 94, 0.1);
  color: #15803d;
}

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--muted);
}

.empty-state .empty-icon {
  font-size: 40px;
  margin-bottom: 10px;
}

.login-gate {
  text-align: center;
  padding: 50px 20px;
}

.login-gate p {
  color: var(--muted);
  margin-bottom: 18px;
}

/* Bandeau d'alerte générique "gros et visible" — même classe que dans
 * nallium-drive-frontend/nallium-docs-frontend-new/etc. pour rester
 * cohérent si Gather doit un jour signaler un état similaire (ex. appel
 * enregistré, salon archivé...). */
.trash-warning-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  background: #fee2e2;
  color: #991b1b;
  border-bottom: 2px solid var(--red);
  font-weight: 800;
  font-size: 14px;
  text-align: center;
}

/* ---------------------------------------------------------------------
 * Gather — layout à 3 colonnes (équipes / salons / chat+appel)
 * ------------------------------------------------------------------- */
.gather-shell {
  display: grid;
  grid-template-columns: 240px 220px 1fr;
  height: calc(100vh - 65px); /* 65px ~ hauteur de la topbar */
  max-width: 100%;
}

@media (max-width: 900px) {
  .gather-shell {
    grid-template-columns: 1fr;
    height: auto;
  }
}

.gather-col {
  border-right: 1px solid var(--border);
  overflow-y: auto;
  padding: 16px 12px;
  background: rgba(255, 255, 255, 0.6);
}

.gather-col-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 6px 12px;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.gather-list-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.gather-list-item:hover {
  background: rgba(59, 130, 246, 0.08);
}

.gather-list-item.active {
  background: rgba(59, 130, 246, 0.14);
  color: var(--blue);
}

.gather-team-avatar {
  width: 28px;
  height: 28px;
  border-radius: 10px;
  background: var(--violet);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 12px;
  flex-shrink: 0;
}

.gather-channel-hash {
  color: var(--muted);
  font-weight: 700;
}

/* ---------------------------------------------------------------------
 * Gather — colonne chat
 * ------------------------------------------------------------------- */
.gather-chat-col {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: transparent;
}

.gather-chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.7);
}

.gather-chat-title {
  font-weight: 800;
  font-size: 15px;
}

.gather-chat-topic {
  font-size: 12px;
  color: var(--muted);
}

.gather-messages {
  flex: 1;
  overflow-y: auto;
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.gather-msg {
  max-width: 70%;
  padding: 10px 14px;
  border-radius: 16px;
  background: #fff;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-soft);
  align-self: flex-start;
}

.gather-msg.is-mine {
  align-self: flex-end;
  background: rgba(59, 130, 246, 0.1);
  border-color: rgba(59, 130, 246, 0.25);
}

.gather-msg-author {
  font-size: 11px;
  font-weight: 800;
  color: var(--muted);
  margin-bottom: 3px;
}

.gather-msg-text {
  font-size: 14px;
  white-space: pre-wrap;
  word-break: break-word;
}

.gather-msg-drive-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  padding: 6px 10px;
  border-radius: 10px;
  background: rgba(139, 92, 246, 0.1);
  color: var(--violet);
  font-size: 12px;
  font-weight: 700;
}

.gather-msg-time {
  font-size: 10px;
  color: var(--muted);
  margin-top: 4px;
}

.gather-composer {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px 20px 18px;
  border-top: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.7);
}

.gather-composer-drive-row {
  display: flex;
  gap: 8px;
}

.gather-composer-row {
  display: flex;
  gap: 10px;
  align-items: flex-end;
}

.gather-composer-row textarea {
  flex: 1;
  resize: none;
  border-radius: 14px;
  border: 1px solid var(--border);
  padding: 10px 14px;
  font: inherit;
  font-size: 14px;
  max-height: 140px;
}

/* ---------------------------------------------------------------------
 * Gather — panneau d'appel (visio LiveKit)
 * ------------------------------------------------------------------- */
.gather-call-bar {
  display: flex;
  align-items: center;
  gap: 10px;
}

.gather-call-panel {
  border-top: 1px solid var(--border);
  background: #0b1120;
  padding: 14px;
}

.gather-call-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}

.gather-call-tile {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: 14px;
  overflow: hidden;
  background: #1e293b;
}

.gather-call-tile video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gather-call-tile .tile-label {
  position: absolute;
  left: 8px;
  bottom: 8px;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
}

.gather-call-controls {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 12px;
}

.gather-call-controls .btn-round {
  width: 42px;
  height: 42px;
  border-radius: 999px;
  border: none;
  display: grid;
  place-items: center;
  font-size: 16px;
  cursor: pointer;
  background: #1e293b;
  color: #fff;
}

.gather-call-controls .btn-round.is-off {
  background: var(--red);
}

.gather-call-controls .btn-round.btn-leave {
  background: var(--red);
}

/* Sous-titres traduits en temps réel — VOLONTAIREMENT REPORTÉ (voir
 * nallium-gather-backend/app/services/translation.py). Le bouton reste
 * visible mais désactivé tant que le backend annonce
 * captions_available=false, pour que l'UI n'ait rien à changer le jour où
 * c'est branché — juste ce disabled qui saute. */
.gather-caption-toggle:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.gather-caption-overlay {
  position: absolute;
  left: 50%;
  bottom: 10px;
  transform: translateX(-50%);
  max-width: 90%;
  padding: 6px 14px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.65);
  color: #fff;
  font-size: 13px;
  text-align: center;
}
