@import url("https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600&display=swap");
@import "fonts.css";

:root {
  --bg: #202124;
  --bg-strong: #181a1b;
  --panel: #2a2b2f;
  --panel-strong: #242528;
  --text: #e8eaed;
  --muted: #9aa0a6;
  --accent: #2bb9c1;
  --accent-strong: #1aa2aa;
  --accent-warm: #fbbc04;
  --shadow: rgba(0, 0, 0, 0.35);
  --radius-lg: 8px;
  --radius-md: 6px;
}

html {
  height: 70vh;
}

.title {
  font-size: 1.6rem;
  letter-spacing: 0.02em;
  font-weight: 600;
}

.subtitle {
  font-size: 0.95rem;
  color: var(--muted);
}

.brand-button {
  background: var(--panel-strong);
  color: var(--text);
  border: none;
  padding: 6px 10px;
  border-radius: 8px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 0.7rem;
}

.brand-button:hover {
  background: #2f3035;
  color: var(--text);
}

.container {
  width: 70%;
}

.navbar {
  background: transparent;
  box-shadow: none;
}

hr {
  display: none;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: "Manrope", "Segoe UI", Tahoma, sans-serif;
  min-height: 100%;
  font-size: large;
}

.room-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 16px;
  align-items: start;
}

.room-main {
  min-width: 0;
}

.room-side {
  position: sticky;
  top: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  height: calc(100vh - 140px);
  min-height: 360px;
}

footer {
  color: var(--muted);
  font-size: medium;
}

footer .content {
  margin-left: 10px;
}

#peers {
  padding-right: 0;
}

.mirror {
  transform: scaleX(-1);
}

video {
  border-radius: var(--radius-md);
  width: 100%;
  max-height: 60vh; /* Увеличено для лучшей видимости */
  margin: 0;
  background-color: #1c1d21;
  box-shadow: none;
  border: none;
}

.video-options {
  position: absolute;
  left: 20px;
  top: 30px;
}

.notif {
  margin-top: 10px;
  margin-bottom: 10px;
  justify-content: center;
  align-items: center;
  display: none; /* Скрываем по умолчанию */
}

.chat {
  background: var(--panel);
  border-radius: var(--radius-lg);
  border: none;
  box-shadow: none;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  height: 70vh;
}

.chat.collapsed {
  height: auto;
}

.chat .message-header {
  background: transparent;
  color: var(--text);
  border-bottom: none;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  font-weight: 600;
  padding: 8px 10px;
}

.chat .message-header p {
  font-size: 0.8rem;
  color: var(--muted);
}

.chat .message-header i {
  box-shadow: 0 0 0 2px rgba(251, 188, 4, 0.3);
}

.chat #msg {
  border-radius: 8px;
  border: none;
  background: #1c1d21;
  color: var(--text);
  padding: 8px 10px;
  box-shadow: none;
}

.chat #msg:focus {
  outline: none;
  box-shadow: 0 0 0 2px rgba(43, 185, 193, 0.35);
}

#chat {
  display: none;
  width: 100%;
  flex: 1;
}

#chat .body {
  display: flex;
  flex-direction: column-reverse;
  overflow-y: auto;
  flex: 1;
  height: auto;
  margin: 6px 8px 0;
  border-radius: var(--radius-md);
  background: transparent;
  border: none;
  padding: 0;
  word-wrap: break-word;
}

#log div {
  background: transparent;
  border-radius: 0;
  padding: 4px 0;
  margin: 4px 0;
  border: none;
  color: var(--text);
  font-size: 0.92rem;
  line-height: 1.35;
  box-shadow: none;
}

#log div:nth-child(2n) {
  background: transparent;
  border-color: transparent;
}

#log:empty::before {
  content: "Нет сообщений";
  color: var(--muted);
  font-size: 0.85rem;
}

.chat-line {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px;
  align-items: start;
}

.chat-time {
  color: var(--muted);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}

.chat-text {
  color: var(--text);
}

.chat .send {
  width: 100%;
  position: static;
  height: auto;
  display: flex;
  gap: 8px;
  padding: 8px;
  background: var(--panel-strong);
  border-radius: var(--radius-md);
}

.chat .send .control-input {
  width: 100%;
}

.chat .button.is-info {
  background: var(--accent);
  border-color: var(--accent);
  color: #0a1112;
  font-weight: 600;
  border-radius: 6px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.chat .button.is-info:hover {
  background: var(--accent-strong);
  border-color: var(--accent-strong);
}

#chat-content {
  display: none;
  flex: 1;
  flex-direction: column;
  gap: 4px;
}

.peer {
  display: block;
}

#videos {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
  min-height: 60vh; /* Гарантируем место для видео */
}

#videos .column {
  padding: 0;
}

#nocon, #noperm, #noone {
  display: none; /* Скрываем по умолчанию */
}

.room-top {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
}

.recording-control {
  display: flex;
  gap: 8px;
}

.screen-control .button.is-info,
.recording-control .button.is-info {
  background: var(--accent);
  border-color: var(--accent);
  color: #0a1112;
  font-weight: 600;
  border-radius: 6px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.screen-control .button.is-info.is-danger,
.recording-control .button.is-info.is-danger {
  background: #f04b4b;
  border-color: #f04b4b;
  color: #0a1112;
}

.screen-wrap {
  display: none;
  margin-bottom: 12px;
  position: relative;
}

.screen-wrap.active {
  display: block;
}

.screen-wrap video {
  max-height: 70vh;
}

.screen-owner {
  position: absolute;
  top: 8px;
  left: 8px;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 0.75rem;
  letter-spacing: 0.02em;
}

.viewer {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 0.85rem;
  letter-spacing: 0.02em;
}

.user-id {
  align-self: center;
  color: var(--muted);
  font-size: 0.8rem;
  letter-spacing: 0.02em;
  margin-right: 8px;
}

#chat-alert {
  display: none;
  border-radius: 50%;
  background-color: var(--accent-warm);
  width: 12px;
  height: 12px;
  justify-content: end;
}

.message.chat {
  border: none;
}

.notification {
  background: #1f2023;
  border: none;
  color: var(--text);
  box-shadow: none;
}

.notification.is-link,
.notification.is-primary,
.notification.is-danger {
  background: #1f2023;
  color: var(--text);
}

.hero.is-link {
  background: var(--bg);
  color: var(--text);
}

.hero.is-link .title,
.hero.is-link .subtitle {
  color: var(--text);
}

@media screen and (max-width: 850px) {
  .container {
    width: 95%;
  }

  .room-layout {
    grid-template-columns: 1fr;
  }

  .room-side {
    position: static;
    height: auto;
    min-height: 0;
  }

  video {
    max-height: 40vh; /* Адаптация для мобильных */
  }

  .chat {
    height: 55vh;
  }
}

@media screen and (min-width: 850px) and (max-width: 1200px) {
  .container {
    width: 80%;
  }

  .navbar-item {
    display: flex;
  }

  .navbar,
  .navbar-menu,
  .navbar-start,
  .navbar-end {
    align-items: stretch;
    display: flex;
    padding: 0;
  }

  .navbar-menu {
    flex-grow: 1;
    flex-shrink: 0;
  }

  .navbar-start {
    justify-content: flex-start;
    margin-right: auto;
  }

  .navbar-end {
    justify-content: flex-end;
    margin-left: auto;
  }

  .navbar .container {
    display: flex;
  }

.navbar-item {
  display: flex;
  align-items: center;
}
}

.navbar-link {
  border-radius: 8px;
  border: none;
  background: var(--panel-strong);
  color: var(--text);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 600;
  font-size: 0.7rem;
  padding: 6px 10px;
}

.navbar-link:hover {
  background: #2f3035;
  color: var(--text);
}

@media screen and (min-width: 1300px) {
  .container {
    width: 70%;
  }
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 8px;
  border: none;
  background: var(--panel-strong);
  color: var(--text);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 0.7rem;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.btn:hover {
  background: #2f3035;
  color: var(--text);
  transform: translateY(-1px);
}

.btn.btn-secondary {
  background: #1d1e22;
}

.btn.btn-danger {
  background: #3a2020;
  color: #ffdede;
}

.btn.btn-danger:hover {
  background: #4a2424;
}

.button {
  border-radius: 8px;
  border: none;
  background: var(--panel-strong);
  color: var(--text);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 0.7rem;
  padding: 6px 10px;
}

.button.is-light {
  background: #1d1e22;
  color: var(--text);
}

.button.is-light:hover {
  background: #2f3035;
  border-color: rgba(43, 185, 193, 0.6);
  color: var(--text);
}

.delete {
  background: transparent;
}
