/* ===== LangExchange — страница чатов ===== */

:root {
  --blue: #2563eb;
  --blue-dark: #1d4ed8;
  --blue-soft: #eff6ff;
  --blue-dark-text: #1e40af;
  --green: #10b981;
  --green-soft: #d1fae5;
  --green-dark: #065f46;
  --ink: #111827;
  --muted: #4b5563;
  --line: #e5e7eb;
  --soft: #f9fafb;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Inter", "Inter-Regular", system-ui, -apple-system, sans-serif;
  background: var(--soft);
  color: var(--ink);
}

.page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ---------- Шапка ---------- */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 76px;
  padding: 0 80px;
  background: #fff;
  border-bottom: 1px solid var(--line);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: inherit;
}
.brand-mark {
  width: 32px;
  height: 32px;
  background: var(--blue);
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 800;
  font-size: 16px;
}
.brand-name {
  font-size: 20px;
  font-weight: 700;
  color: var(--ink);
  white-space: nowrap;
}

.nav {
  display: flex;
  align-items: center;
  gap: 32px;
  height: 76px;
}
.nav-link {
  display: inline-flex;
  align-items: center;
  height: 76px;
  font-size: 16px;
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  box-sizing: border-box;
}
.nav-link:hover { color: var(--blue); }
.nav-link.is-active {
  color: var(--blue);
  font-weight: 600;
  border-bottom-color: var(--blue);
  padding-top: 2px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 24px;
}
.login-link {
  font-size: 16px;
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
}
.login-link:hover { color: var(--blue); }

/* ---------- Кнопки ---------- */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 20px;
  background: var(--blue);
  color: #fff;
  border: 0;
  border-radius: 8px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: background .15s, transform .05s;
}
.btn-primary:hover { background: var(--blue-dark); }
.btn-primary:active { transform: translateY(1px); }

/* ---------- Контент ---------- */
.content {
  flex: 1;
  display: flex;
  justify-content: center;
}
.inner {
  width: 100%;
  max-width: 1100px;
  padding: 48px 24px 80px;
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.page-head {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.page-title {
  margin: 0;
  font-size: 36px;
  font-weight: 800;
  color: var(--ink);
  letter-spacing: -0.4px;
}
.page-subtitle {
  margin: 0;
  font-size: 16px;
  color: var(--muted);
}

/* ---------- Инфо-баннер ---------- */
.info-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  background: var(--blue-soft);
  border-radius: 12px;
  font-size: 14px;
  font-weight: 500;
  color: var(--blue-dark-text);
  line-height: 1.5;
}
.info-banner svg { flex-shrink: 0; }

/* ---------- Сетка комнат ---------- */
.rooms {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* General — full-width */
.room-general {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 20px;
  padding-left: 24px;
  background: #fff;
  border: 1px solid var(--line);
  border-left: 4px solid var(--green);
  border-radius: 16px;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  transition: transform .15s, box-shadow .15s, border-color .15s;
}
.room-general:hover {
  border-color: var(--blue);
  border-left-color: var(--green);
  box-shadow: 0 12px 24px rgba(37,99,235,.12);
  transform: translateY(-2px);
}

.room-general-head {
  display: flex;
  align-items: center;
  gap: 12px;
}
.room-general-title {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  color: var(--ink);
}
.badge-general {
  display: inline-flex;
  padding: 4px 8px;
  background: var(--green-soft);
  color: var(--green-dark);
  border-radius: 100px;
  font-size: 12px;
  font-weight: 700;
}

.room-general-desc {
  margin: 0;
  font-size: 14px;
  color: var(--muted);
  line-height: 1.5;
}

/* Сетка уровней 2 колонки */
.rooms-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.room {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 20px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  transition: transform .15s, box-shadow .15s, border-color .15s;
}
.room:hover {
  border-color: var(--blue);
  box-shadow: 0 12px 24px rgba(37,99,235,.12);
  transform: translateY(-2px);
}

.room-head {
  display: flex;
  align-items: center;
  gap: 12px;
}
.level-badge {
  display: inline-flex;
  padding: 4px 8px;
  background: var(--blue-soft);
  color: var(--blue);
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
}
.room-title {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  color: var(--ink);
}

.room-desc {
  margin: 0;
  font-size: 14px;
  color: var(--muted);
  line-height: 1.5;
}

.room-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  flex-wrap: wrap;
}
.dot-green {
  width: 8px;
  height: 8px;
  background: var(--green);
  border-radius: 50%;
  flex-shrink: 0;
}
.online-count {
  color: var(--green);
  font-weight: 600;
}
.meta-sep { color: var(--muted); }
.members-count { color: var(--muted); }

/* ---------- Футер-подсказка ---------- */
.footer-hint {
  padding-top: 16px;
  text-align: center;
  font-size: 14px;
  color: var(--muted);
}
.footer-hint a {
  color: var(--blue);
  font-weight: 600;
  text-decoration: underline;
}
.footer-hint a:hover {
  color: var(--blue-dark);
}

/* ---------- Уведомление ---------- */
.lx-toast {
  position: fixed;
  left: 50%;
  bottom: 32px;
  transform: translate(-50%, 20px);
  background: var(--ink);
  color: #fff;
  padding: 12px 20px;
  border-radius: 12px;
  font-weight: 600;
  font-size: 14px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s, transform .2s;
  z-index: 9999;
}
.lx-toast.is-visible { opacity: 1; transform: translate(-50%, 0); }
.lx-toast.is-success { background: var(--green); }

/* ---------- Адаптив ---------- */
@media (max-width: 900px) {
  .header { padding: 0 20px; height: 68px; }
  .brand-name { font-size: 18px; }
  .nav { display: none; }
  .login-link { display: none; }
  .header-actions { gap: 12px; }

  .inner { padding: 32px 16px 64px; gap: 24px; }
  .page-title { font-size: 26px; }
  .page-subtitle { font-size: 15px; }

  .info-banner {
    padding: 14px 16px;
    font-size: 13px;
    align-items: flex-start;
  }

  .rooms-grid { grid-template-columns: 1fr; }

  .room, .room-general { padding: 18px; }
  .room-title, .room-general-title { font-size: 17px; }
}


/* Комната только для чтения */
.room.is-readonly {
  opacity: 0.75;
}
.room.is-readonly:hover {
  border-color: #cbd5e1;
  box-shadow: none;
  transform: none;
}

.lock-badge {
  margin-left: auto;
  font-size: 14px;
  opacity: 0.7;
}

/* Заглушка загрузки */
.state-box {
  padding: 48px;
  text-align: center;
  font-size: 15px;
  color: var(--muted);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
}
