/* ===== LangExchange — страница форума ===== */

:root {
  --blue: #2563eb;
  --blue-dark: #1d4ed8;
  --blue-soft: #eff6ff;
  --green: #10b981;
  --green-soft: #ecfdf5;
  --ink: #111827;
  --muted: #4b5563;
  --muted-2: #6b7280;
  --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: 18px;
}
.brand-name {
  font-size: 22px;
  font-weight: 800;
  color: var(--ink);
  white-space: nowrap;
}

.nav {
  display: flex;
  align-items: center;
  gap: 4px;
}
.nav-link {
  display: inline-flex;
  align-items: center;
  padding: 8px 16px;
  font-size: 15px;
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
  position: relative;
  height: 76px;
  box-sizing: border-box;
}
.nav-link:hover { color: var(--blue); }
.nav-link.is-active {
  color: var(--blue);
  font-weight: 600;
}
.nav-link.is-active::after {
  content: "";
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: 0;
  width: 24px;
  height: 3px;
  background: var(--blue);
  border-radius: 1.5px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.login-link {
  padding: 12px 20px;
  font-size: 15px;
  font-weight: 600;
  color: var(--muted);
  text-decoration: none;
}
.login-link:hover { color: var(--blue); }

/* ---------- Кнопки ---------- */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 24px;
  background: var(--blue);
  color: #fff;
  border: 0;
  border-radius: 12px;
  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); }
.btn-primary:disabled {
  background: #93b4f7;
  cursor: not-allowed;
}
.btn-with-icon .plus {
  font-size: 18px;
  line-height: 1;
  font-weight: 400;
}
/* В шапке кнопка чуть меньше */
.header .btn-primary {
  padding: 12px 22px;
}

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

.page-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
}
.page-head-text {
  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);
}

/* ---------- Панель фильтров + поиск ---------- */
.toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}
.chips {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.chip {
  padding: 10px 20px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 20px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
  cursor: pointer;
  transition: background .15s, border-color .15s, color .15s;
}
.chip:hover { border-color: #cbd5e1; color: var(--ink); }
.chip.is-active {
  background: var(--blue);
  border-color: var(--blue);
  color: #fff;
}

.search {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 340px;
  height: 44px;
  padding: 0 16px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  transition: border-color .15s, box-shadow .15s;
}
.search:focus-within {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(37,99,235,.15);
}
.search svg { flex-shrink: 0; }
.search input {
  flex: 1;
  border: 0;
  outline: none;
  font-family: inherit;
  font-size: 14px;
  color: var(--ink);
  background: transparent;
}
.search input::placeholder { color: var(--muted); }

/* ---------- Список тем ---------- */
.topics {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.topic {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 20px 24px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 4px 12px rgba(0,0,0,.04);
  text-decoration: none;
  color: inherit;
  transition: transform .15s, box-shadow .15s, border-color .15s;
}
.topic:hover {
  border-color: var(--blue);
  box-shadow: 0 8px 24px rgba(37,99,235,.12);
  transform: translateY(-1px);
}
.topic.is-pinned {
  border-color: #bbf7d0;
  background: linear-gradient(180deg, #f0fdf4 0%, #ffffff 60%);
}
.topic.is-locked {
  opacity: .85;
}

/* Аватар */
.topic-author {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  width: 80px;
  flex-shrink: 0;
}
.avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--blue);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 600;
  text-transform: uppercase;
  flex-shrink: 0;
}
.avatar.is-moderator { background: var(--green); }
.avatar.is-pinned { background: var(--green); }

.replies-count {
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  text-align: center;
  white-space: nowrap;
}

/* Тело карточки */
.topic-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.topic-title-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.topic-title {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.3;
  word-wrap: break-word;
}

/* Бейджи */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  flex-shrink: 0;
}
.badge-pinned {
  background: var(--green-soft);
  color: var(--green);
}
.badge-locked {
  background: #f3f4f6;
  color: var(--muted);
}

/* Мета */
.topic-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 13px;
}
.topic-meta .label { color: var(--muted); }
.topic-meta .author { color: var(--ink); font-weight: 600; }
.topic-meta .dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--line);
}
.topic-meta .time { color: var(--muted); }

/* Шеврон */
.topic-chevron {
  color: var(--muted);
  flex-shrink: 0;
  transition: transform .15s, color .15s;
}
.topic:hover .topic-chevron {
  color: var(--blue);
  transform: translateX(2px);
}

/* ---------- Состояния ---------- */
.state-box {
  padding: 48px;
  text-align: center;
  font-size: 15px;
  color: var(--muted);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
}
.empty-state {
  padding: 48px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  text-align: center;
}
.empty-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--soft);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
}
.empty-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--ink);
}
.empty-subtitle {
  font-size: 14px;
  color: var(--muted);
}

/* ---------- Адаптив ---------- */
@media (max-width: 900px) {
  .header { padding: 0 20px; height: 68px; }
  .brand-name { font-size: 18px; }
  .nav { display: none; }
  .login-link { display: none; }
  .content { padding: 32px 16px 64px; gap: 24px; }
  .page-title { font-size: 26px; }
  .page-subtitle { font-size: 15px; }
  .page-head { flex-direction: column; align-items: flex-start; }
  .page-head .btn-primary { width: 100%; }
  .toolbar { flex-direction: column; align-items: stretch; }
  .search { width: 100%; }
  .topic {
    padding: 16px 18px;
    gap: 16px;
    align-items: flex-start;
  }
  .topic-author { width: 60px; }
  .avatar { width: 38px; height: 38px; font-size: 14px; }
  .topic-title { font-size: 16px; }
  .topic-chevron { display: none; }
}
