/* ───────────────────────────────────────────────────────────────────────────
   LUMIO CHAT — site.css
   Premium dark glassmorphism UI
   ─────────────────────────────────────────────────────────────────────────── */

/* ── Tokens ─────────────────────────────────────────────────────────────── */
:root {
  --brand-1:    #1c76a6;
  --brand-2:    #1d6c82;
  --brand-dark: #114c74;
  --deep:       #051320;
  --surface:    rgba(8, 32, 50, 0.55);
  --surface-hi: rgba(16, 52, 82, 0.6);
  --glass:      rgba(255, 255, 255, 0.04);
  --glass-hi:   rgba(255, 255, 255, 0.08);
  --border:     rgba(255, 255, 255, 0.09);
  --border-hi:  rgba(255, 255, 255, 0.16);
  --text:       #e6f4ff;
  --muted:      #7fa8c2;
  --ok:         #4ade80;
  --danger:     #f87171;
  --shadow:     0 24px 64px rgba(0, 0, 0, 0.6);
}

/* ── Reset ──────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: "Inter", Segoe UI, Roboto, Arial, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  background:
    radial-gradient(ellipse at 0%   0%,   rgba(28,118,166,.3) 0%, transparent 50%),
    radial-gradient(ellipse at 100% 100%, rgba(13,130,160,.2) 0%, transparent 50%),
    linear-gradient(160deg, #020d18 0%, #04172a 60%, #061e33 100%);
  background-attachment: fixed;
}

img, video { display: block; max-width: 100%; }
button, input, a { font: inherit; }

.hidden { display: none !important; }

/* ── App shell ──────────────────────────────────────────────────────────── */
.app-shell {
  width: min(1340px, calc(100vw - 24px));
  margin: 0 auto;
  padding: 14px 0 28px;
}

/* ── Top bar ────────────────────────────────────────────────────────────── */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
  padding: 10px 18px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 4px 24px rgba(0,0,0,.35), inset 0 1px 0 var(--glass-hi);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-lockup img {
  width: 42px;
  height: 42px;
  object-fit: cover;
  border-radius: 10px;
}

.brand-lockup h1,
.brand-lockup p,
.chat-meta h3,
.chat-meta p { margin: 0; }

.brand-kicker {
  text-transform: uppercase;
  letter-spacing: .12em;
  font-size: .68rem;
  font-weight: 700;
  color: var(--muted);
}

.brand-lockup h1 { font-size: 1.1rem; font-weight: 700; }

/* ── Status dot ─────────────────────────────────────────────────────────── */
.status-inline {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: .85rem;
}

.presence-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 0 4px rgba(74,222,128,.18);
  animation: pulse 2.4s ease infinite;
}

@keyframes pulse {
  0%,100% { box-shadow: 0 0 0 4px rgba(74,222,128,.18); }
  50%      { box-shadow: 0 0 0 8px rgba(74,222,128,.06); }
}

/* ── User badge ─────────────────────────────────────────────────────────── */
.user-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px 5px 5px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--glass);
  font-size: .82rem;
  color: var(--muted);
}

.user-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
}

.logout-link {
  color: var(--muted);
  text-decoration: none;
  font-size: 1rem;
  line-height: 1;
  transition: color .15s;
}
.logout-link:hover { color: var(--text); }

/* ── Admin console button ───────────────────────────────────────────────── */
.admin-console-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 13px;
  border: 1px solid rgba(28,118,166,.4);
  border-radius: 999px;
  background: rgba(28,118,166,.12);
  color: #7acaff;
  font-size: .78rem;
  font-weight: 600;
  text-decoration: none;
  transition: all .2s ease;
  white-space: nowrap;
}
.admin-console-btn:hover {
  background: rgba(28,118,166,.25);
  border-color: rgba(28,118,166,.7);
  color: #b8e2ff;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(28,118,166,.25);
}

/* ── Panel ──────────────────────────────────────────────────────────────── */
.panel {
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--surface);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: var(--shadow), inset 0 1px 0 var(--glass-hi);
}

/* ── LOGIN PANEL ────────────────────────────────────────────────────────── */
.login-panel {
  position: relative;
  max-width: 460px;
  margin: 8vh auto 0;
  padding: 48px 40px 44px;
  text-align: center;
  overflow: hidden;
}

.login-glow {
  position: absolute;
  top: -80px;
  left: 50%;
  transform: translateX(-50%);
  width: 300px;
  height: 300px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(28,118,166,.35) 0%, transparent 70%);
  pointer-events: none;
}

.login-content { position: relative; z-index: 1; }

.login-logo {
  width: 72px;
  height: 72px;
  border-radius: 18px;
  margin: 0 auto 20px;
  box-shadow: 0 8px 24px rgba(0,0,0,.4);
}

.login-title {
  margin: 0 0 10px;
  font-size: clamp(1.5rem, 4vw, 2rem);
  font-weight: 800;
  background: linear-gradient(135deg, #e6f4ff 30%, #7acaff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.login-subtitle {
  margin: 0 0 28px;
  color: var(--muted);
  font-size: .95rem;
}

.google-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  padding: 13px 20px;
  border: 1px solid var(--border-hi);
  border-radius: 14px;
  background: rgba(255,255,255,.9);
  color: #1a1a1a;
  font-size: .95rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: all .2s cubic-bezier(.25,.46,.45,.94);
  box-shadow: 0 4px 20px rgba(0,0,0,.3);
}

.google-btn svg { width: 20px; height: 20px; flex-shrink: 0; }

.google-btn:hover {
  background: #fff;
  transform: translateY(-2px);
  box-shadow: 0 10px 32px rgba(0,0,0,.4);
}

.login-disclaimer {
  margin: 18px 0 0;
  font-size: .74rem;
  color: rgba(127,168,194,.6);
}

/* ── INTRO PANEL ────────────────────────────────────────────────────────── */
.intro-panel {
  max-width: 780px;
  margin: 4vh auto 0;
  padding: 24px;
  display: grid;
  gap: 14px;
}

.intro-panel h2 { margin: 0; font-size: clamp(1.4rem, 3vw, 2rem); font-weight: 800; }

/* ── Mode cards ─────────────────────────────────────────────────────────── */
.mode-chooser {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.mode-card {
  display: grid;
  grid-template-rows: auto auto auto;
  gap: 4px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--glass);
  cursor: pointer;
  transition: all .2s ease;
}

.mode-card:hover {
  border-color: rgba(28,118,166,.5);
  background: rgba(28,118,166,.12);
  transform: translateY(-2px);
}

.mode-card input { accent-color: var(--brand-1); }
.mode-card-icon  { font-size: 1.4rem; }
.mode-card-label { font-weight: 700; font-size: .95rem; }
.mode-card small { color: var(--muted); font-size: .8rem; }

/* ── Labels / inputs ────────────────────────────────────────────────────── */
.label {
  text-transform: uppercase;
  letter-spacing: .1em;
  font-size: .68rem;
  font-weight: 700;
  color: var(--muted);
}

.text-input {
  width: 100%;
  min-height: 42px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: 11px;
  color: var(--text);
  background: rgba(5,20,40,.6);
  transition: border-color .2s;
}

.text-input::placeholder { color: rgba(127,168,194,.5); }
.text-input:focus {
  outline: none;
  border-color: rgba(28,118,166,.55);
  box-shadow: 0 0 0 3px rgba(28,118,166,.12);
}

/* ── Checkbox row ───────────────────────────────────────────────────────── */
.checkbox-row {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--muted);
  font-size: .88rem;
  cursor: pointer;
}

.checkbox-row input { width: 16px; height: 16px; accent-color: var(--brand-1); }

/* ── Buttons ────────────────────────────────────────────────────────────── */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text);
  cursor: pointer;
  user-select: none;
  transition: all .2s cubic-bezier(.25,.46,.45,.94);
}

.button:hover:not(:disabled), .button:focus-visible:not(:disabled) {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 8px 20px rgba(0,0,0,.35);
}

.button:active:not(:disabled) { transform: translateY(0) scale(.98); }
.button:disabled { opacity: .4; cursor: not-allowed; }

.button-primary   { font-weight: 700; background: linear-gradient(135deg, var(--brand-1), var(--brand-2)); border-color: transparent; }
.button-secondary { font-weight: 700; background: linear-gradient(135deg, var(--brand-dark), #0b2f4a); }
.button-ghost     { background: var(--glass); }
.button-danger    { font-weight: 700; background: linear-gradient(135deg, #9b2335, #d44); border-color: transparent; }

/* ── Stage / video ──────────────────────────────────────────────────────── */
.stage-panel { padding: 14px; }

.stage-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.video-card {
  position: relative;
  overflow: hidden;
  min-height: 360px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: #050f1c;
}

.video-card__head {
  position: absolute;
  top: 10px;
  left: 10px;
  right: 10px;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  font-size: .8rem;
  text-shadow: 0 1px 4px rgba(0,0,0,.6);
}

.mode-badge {
  padding: 3px 10px;
  border-radius: 999px;
  font-size: .7rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--brand-1), var(--brand-2));
  border: 1px solid rgba(255,255,255,.15);
}

.mode-badge-muted { background: rgba(60,60,70,.75); }

video {
  width: 100%;
  height: 360px;
  object-fit: cover;
  background: #040e1a;
}

.video-overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 16px;
  text-align: center;
  color: #a0c0d8;
  font-size: .9rem;
  background: linear-gradient(180deg, rgba(4,14,26,.15), rgba(4,14,26,.8));
}

.video-overlay.is-hidden { display: none; }

/* ── Toolbar ────────────────────────────────────────────────────────────── */
.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

/* ── Chat pane ──────────────────────────────────────────────────────────── */
.chat-under {
  margin-top: 12px;
  padding: 16px;
  display: grid;
  gap: 10px;
}

.chat-meta h3 { font-size: 1.05rem; margin: 0; }
.chat-meta p  { margin: 4px 0 0; color: var(--muted); }

.chat-feed {
  display: grid;
  gap: 8px;
  min-height: 160px;
  max-height: 280px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.chat-row {
  max-width: 88%;
  padding: 10px 14px;
  border-radius: 13px;
  line-height: 1.48;
  font-size: .9rem;
  word-break: break-word;
  animation: msgIn .15s ease;
}

@keyframes msgIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.chat-row-self   { justify-self: end; background: linear-gradient(135deg, var(--brand-dark), var(--brand-1)); color: #e6f4ff; }
.chat-row-peer   { background: rgba(255,255,255,.07); }
.chat-row-system { max-width: 100%; padding: 0; background: transparent; color: var(--muted); font-size: .82rem; }

.message-form {
  display: flex;
  gap: 8px;
}

.message-form .text-input { flex: 1; }

.typing-indicator { min-height: 16px; margin: 0; color: var(--muted); font-size: .8rem; font-style: italic; }

/* ── Stats ──────────────────────────────────────────────────────────────── */
.stats-row {
  margin-top: 12px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.stat-card {
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 13px;
  background: var(--glass);
  text-align: center;
}

.stat-card .label { display: block; font-size: .65rem; margin-bottom: 4px; }
.stat-card strong { font-size: 1.4rem; font-weight: 800; }

/* ── Responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 980px) {
  .mode-chooser,
  .stage-grid,
  .stats-row { grid-template-columns: 1fr; }

  .video-card,
  video { min-height: 260px; height: 260px; }
}

@media (max-width: 640px) {
  .app-shell   { width: calc(100vw - 10px); padding-top: 8px; }
  .topbar      { flex-direction: column; align-items: flex-start; }
  .toolbar     { flex-direction: column; align-items: stretch; }
  .button      { width: 100%; }
  .intro-panel { margin-top: 1vh; padding: 16px; }
  .login-panel { padding: 32px 20px 28px; }
}

/* ── Tag chips ────────────────────────────────────────────────────────────── */
.tag-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0 16px;
}
.tag-chip {
  background: var(--glass-hi);
  border: 1px solid var(--border);
  color: var(--muted);
  border-radius: 20px;
  padding: 5px 13px;
  font-size: .8rem;
  cursor: pointer;
  transition: background .15s, color .15s, border-color .15s, transform .1s;
}
.tag-chip:hover {
  background: rgba(28,118,166,.25);
  border-color: var(--brand-1);
  color: var(--text);
}
.tag-chip.active {
  background: var(--brand-1);
  border-color: var(--brand-1);
  color: #fff;
  font-weight: 600;
}
.tag-chip:active { transform: scale(.96); }

/* ── Report modal ─────────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.65);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 16px;
}
.modal-box {
  background: #081e30;
  border: 1px solid var(--border-hi);
  border-radius: 18px;
  padding: 28px 32px;
  max-width: 420px;
  width: 100%;
  box-shadow: 0 32px 80px rgba(0,0,0,.7);
  animation: slideUp .2s ease;
}
.modal-box h3 {
  margin: 0 0 4px;
  font-size: 1.15rem;
}
.report-reasons {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 20px;
}
.report-reason-row {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--glass);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 9px 14px;
  cursor: pointer;
  transition: background .15s, border-color .15s;
  font-size: .9rem;
}
.report-reason-row:hover {
  background: var(--glass-hi);
  border-color: var(--border-hi);
}
.report-reason-row input[type="radio"] { accent-color: var(--brand-1); }
.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}
@keyframes slideUp {
  from { transform: translateY(20px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

/* ── T&C tweaks ───────────────────────────────────────────────────────────── */
.tnc-check-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 10px 0;
  font-size: .9rem;
  cursor: pointer;
}
.tnc-check-row input { accent-color: var(--brand-1); margin-top: 3px; flex-shrink: 0; }