/* ============================================================
   BubriTube — redesign overlay
   Подключать ПОСЛЕ app.css:
     <link rel="stylesheet" href="/static/css/app.css" />
     <link rel="stylesheet" href="/static/css/redesign.css" />
   Ничего в разметке менять не нужно — только этот файл.
   ============================================================ */

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

/* ---- 1. Токены: фиолетовый акцент, глубже фон, мягче радиусы ---- */
:root {
  --bg: #0a0a0e;
  --surface: #15151b;
  --surface-2: #1d1d25;
  --surface-3: #262630;
  --border: rgba(255, 255, 255, 0.07);
  --text: #eceef5;
  --text-muted: #9a9dab;

  --accent: #7c5cff;
  --accent-press: #6a3cff;
  --accent-soft: rgba(124, 92, 255, 0.16);
  --accent-ring: rgba(124, 92, 255, 0.35);

  --radius: 16px;
  --radius-sm: 12px;
  --shadow: 0 10px 34px rgba(0, 0, 0, 0.45);
  --header-h: 66px;
  --sidebar-w: 244px;
  --font: "Onest", -apple-system, "Segoe UI", Roboto, sans-serif;
}

body {
  background:
    radial-gradient(1100px 560px at 80% -10%, rgba(124, 92, 255, 0.10), transparent 60%),
    var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection { background: var(--accent-ring); }

::-webkit-scrollbar { width: 11px; height: 11px; }
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.10);
  border: 3px solid var(--bg);
  border-radius: 99px;
}
::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.18); }

/* ---- 2. Шапка ---- */
.app-header {
  background: rgba(10, 10, 14, 0.78);
  backdrop-filter: saturate(140%) blur(16px);
  border-bottom: 1px solid var(--border);
}

.brand__text {
  font-family: "Unbounded", sans-serif;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.brand__dot {
  background: var(--accent);
  box-shadow: 0 0 14px var(--accent-ring);
}

.header-icon-btn { border-radius: 12px; }
.header-icon-btn:hover { background: rgba(255, 255, 255, 0.08); }

/* Поиск: единая мягкая капсула с фиолетовым фокус-кольцом */
.header-search__bar { height: 46px; }

.header-search__input {
  border: 1px solid var(--border);
  border-right: 0;
  border-radius: 14px 0 0 14px;
  background: rgba(255, 255, 255, 0.05);
  font-size: 15px;
  transition: border-color 0.18s ease, background 0.18s ease;
}
.header-search__input::placeholder { color: rgba(255, 255, 255, 0.4); }

.header-search__submit {
  width: 58px;
  border: 1px solid var(--border);
  border-left: 0;
  border-radius: 0 14px 14px 0;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-muted);
  transition: background 0.18s ease, color 0.18s ease;
}
.header-search__submit:hover {
  background: var(--accent-soft);
  color: #fff;
}

.header-search__bar:focus-within .header-search__input,
.header-search__bar:focus-within .header-search__submit {
  border-color: var(--accent);
}
.header-search__bar:focus-within {
  border-radius: 14px;
  box-shadow: 0 0 0 4px var(--accent-soft);
}

/* Кнопка «Загрузить» — фирменная */
.header-create {
  height: 42px;
  padding: 0 18px;
  border: 0;
  border-radius: 12px;
  background: linear-gradient(135deg, #8b6bff, #6a3cff);
  color: #fff;
  font-weight: 600;
  font-size: 14.5px;
  box-shadow: 0 8px 22px rgba(124, 92, 255, 0.38);
  transition: filter 0.15s ease, transform 0.15s ease;
}
.header-create:hover {
  background: linear-gradient(135deg, #8b6bff, #6a3cff);
  filter: brightness(1.08);
  transform: translateY(-1px);
}
.header-create--login {
  background: rgba(255, 255, 255, 0.06);
  box-shadow: none;
}

.notify-menu__btn { border-radius: 12px; }
.notify-menu__btn:hover { background: rgba(255, 255, 255, 0.08); }

/* ---- 3. Сайдбар ---- */
.app-sidebar {
  background: transparent;
  padding-top: 20px;
  /* разделитель переносим на контент-колонку (она во всю высоту),
     иначе полоска обрывается на конце списка авторов */
  border-right: 0;
}

.app-body--with-sidebar .app-content {
  border-left: 1px solid var(--border);
}
.app-body--with-sidebar.sidebar-collapsed .app-content {
  border-left: 0;
}
@media (max-width: 700px) {
  .app-body--with-sidebar .app-content { border-left: 0; }
}

.nav-link,
.nav-action {
  position: relative;
  font-size: 15px;
  padding: 11px 14px;
  border-radius: 12px;
  font-weight: 500;
}
.nav-link:hover,
.nav-action:hover { background: rgba(255, 255, 255, 0.06); }

.nav-link.active {
  background: var(--accent-soft);
  color: #fff;
}
.nav-link.active::before {
  content: "";
  position: absolute;
  left: 0; top: 50%;
  transform: translateY(-50%);
  width: 3px; height: 18px;
  border-radius: 9px;
  background: var(--accent);
}

.sidebar-section__title {
  font-size: 12px;
  letter-spacing: 0.08em;
  color: #6c6f7d;
}

.sidebar-author {
  font-size: 14.5px;
  padding: 8px 12px;
  border-radius: 12px;
}
.sidebar-author:hover,
.sidebar-author.active {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
}
.sidebar-author__count {
  font-weight: 600;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.05);
  padding: 2px 8px;
  border-radius: 99px;
}

/* Аватар-заглушки без картинки — приятный градиент вместо пустоты */
.avatar {
  background: linear-gradient(135deg, #4a4458, #2c2838);
}

/* ---- 4. Заголовок ленты + переключатель ---- */
.section-title {
  font-family: "Unbounded", sans-serif;
  font-weight: 700;
  font-size: 30px;
  letter-spacing: -0.03em;
}

.comments-sort,
.feed-sort {
  padding: 4px;
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  gap: 2px;
}
.comments-sort__btn {
  border-radius: 10px;
  font-weight: 600;
  color: var(--text-muted);
}
.comments-sort__btn:hover { color: var(--text); background: transparent; }
.comments-sort__btn.is-active {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 4px 14px var(--accent-ring);
}

/* ---- 5. Сетка и карточки: плотнее, крупнее превью ---- */
.video-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 22px 18px;
}
@media (max-width: 1500px) { .video-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 1180px) { .video-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 820px)  { .video-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px)  { .video-grid { grid-template-columns: 1fr; } }

/* Карточка без «коробки» — превью+мета как на больших площадках */
.video-card {
  background: transparent;
  border: 0;
  border-radius: 0;
  overflow: visible;
  transition: transform 0.18s ease;
}
.video-card:hover { transform: translateY(-3px); }

.video-card__thumb {
  border-radius: 14px;
  overflow: hidden;
  background: var(--surface-2);
}
.video-card__thumb .video-thumb-wrap { position: relative; }
.video-card:hover .video-thumb { transform: scale(1.04); }
.video-thumb {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.4s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.video-thumb--empty {
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #2a2640, #181620);
  color: var(--text-muted);
  font-size: 13px;
}

.video-duration {
  right: 8px; bottom: 8px;
  font-size: 12.5px;
  font-weight: 600;
  background: rgba(0, 0, 0, 0.72);
  border-radius: 7px;
  padding: 2px 7px;
}

.video-meta { padding: 11px 2px 0; }
.video-meta .video-title,
.video-title {
  margin: 0 0 8px;
  font-size: 15.5px;
  font-weight: 600;
  line-height: 1.3;
  color: #f2f3f8;
  text-wrap: pretty;
}
.video-card__subline { font-size: 13px; color: #71747f; }
.author-line .muted { font-size: 13.5px; color: #aeb1c0; font-weight: 500; }

/* ---- 6. РЕАКЦИИ на карточке — главная переделка ----
   Были крупные красные «таблетки» — стали компактные чипы. */
.feed-reactions { gap: 6px; margin-top: 9px; }

.feed-reaction {
  height: 28px;
  padding: 0 10px;
  gap: 5px;
  border-radius: 99px;
  border: 1px solid transparent;
  background: rgba(255, 255, 255, 0.05);
  font-size: 13px;
  color: #b6b9c6;
}
.feed-reaction__label { font-size: 14px; }
.feed-reaction b { font-size: 12.5px; font-weight: 700; color: #cdd0db; }

.feed-reaction--has {
  background: var(--accent-soft);
  border-color: rgba(124, 92, 255, 0.45);
}
.feed-reaction--has b { color: #fff; }

/* ---- 7. Реакции под видео и комментами ---- */
.reaction.active,
.comment-reaction-chip.is-mine {
  border-color: rgba(124, 92, 255, 0.55);
  background: var(--accent-soft);
}
.comment-reaction-chip {
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.05);
  transition: background 0.14s ease, border-color 0.14s ease, transform 0.1s ease;
}
.comment-reaction-chip:hover {
  background: rgba(255, 255, 255, 0.1);
  transform: translateY(-1px);
}
.comment-reaction-chip__count { color: var(--text-muted); }

.comment-reactions__trigger {
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--border);
}
.comment-reactions__trigger:hover,
.comment-reactions__trigger:focus-visible {
  background: var(--accent-soft);
  border-color: rgba(124, 92, 255, 0.4);
  color: #c9bcff;
}

/* ---- 8. Теги и кнопки ---- */
a.video-tag.video-tag--active,
.video-tag.video-tag--active {
  background: var(--accent-soft);
  border-color: rgba(124, 92, 255, 0.6);
  color: #fff;
  box-shadow: 0 0 0 1px rgba(124, 92, 255, 0.25);
}
a.video-tag.video-tag--active:hover,
.video-tag.video-tag--active:hover {
  background: rgba(124, 92, 255, 0.3);
  border-color: var(--accent);
}
.video-tag { border-radius: 99px; }

.btn { border-radius: 12px; }
.btn--accent { background: var(--accent); }
.btn--accent:hover { background: var(--accent-press); }
.feed-filter__badge { background: var(--accent); color: #fff; }

.feed-sentinel__spinner { border-top-color: var(--accent); }

/* ============================================================
   9. Страница видео (watch)
   ============================================================ */
.watch { gap: 22px; }

.watch__main .plyr {
  border-radius: 16px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.4);
}

.watch-title {
  font-size: 23px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: #f4f5fa;
}

/* Кнопки-инструменты под видео — мягче и в общем стиле */
.watch-tool-btn {
  height: 40px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  font-weight: 600;
}
/* Кнопки-инструменты под видео — призрачные, без тяжёлой заливки */
.watch-tool-btn {
  height: 46px;
  border-radius: 12px;
  border: 0;
  background: transparent;
  color: var(--text-muted);
  font-weight: 600;
  padding: 0 14px;
  transition: background 0.15s ease, color 0.15s ease;
}
.watch-tool-btn:hover,
.watch-tool-btn.active {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
}

.icon-btn { border-radius: 12px; }
.icon-btn:hover,
.icon-btn.active {
  background: var(--accent-soft);
  color: #c9bcff;
}

.share-menu {
  border-radius: 14px;
  border-color: var(--border);
  background: var(--surface-2);
}
.share-menu__item:hover { background: var(--accent-soft); }

.watch-stats { color: var(--text-muted); font-size: 13.5px; }

/* Блок комментариев */
.comments-block__title {
  font-family: "Unbounded", sans-serif;
  font-weight: 600;
  font-size: 20px;
  letter-spacing: -0.01em;
}

.comment-composer__input-wrap:focus-within,
.comment-reply-inline__input-wrap:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

/* Карточки «Следующее» */
.watch__side > h3 {
  font-family: "Unbounded", sans-serif;
  font-weight: 600;
  font-size: 16px;
  letter-spacing: -0.01em;
}
.suggest {
  border: 0;
  background: transparent;
  box-shadow: none;
  padding: 6px;
  border-radius: 12px;
  transition: background 0.15s ease;
}
.suggest:hover { background: rgba(255, 255, 255, 0.05); }
.suggest .video-title { font-size: 14px; font-weight: 600; }

/* ---- 9b. Разгрузка: мета под видео + плоские комментарии ---- */
.watch-title {
  font-size: 22px;
  font-weight: 700;
  margin: 14px 0 12px;
}
.watch-meta-row { gap: 10px 14px; }
.watch-stats {
  font-size: 12.5px;
  opacity: 0.75;
  margin-top: 12px;
}
.video-tags { margin: 14px 0 4px; }
.video-description { color: #c6c9d6; line-height: 1.55; }

/* Композер и комментарии — без вложенных «коробок», только воздух и тонкие линии */
.comments-block .comment-composer {
  background: transparent;
  border: 0;
  padding: 0;
  max-width: 640px;
  margin-bottom: 6px;
}

.comment {
  background: transparent;
  border: 0;
  border-top: 1px solid var(--border);
  border-radius: 0;
  margin-top: 0;
  padding: 16px 0;
}
#commentsList > .comment:first-child { border-top: 0; padding-top: 4px; }

.comment-thread { border-left-color: rgba(255, 255, 255, 0.08); }

.comment-replies .comment--reply {
  background: transparent;
  border: 0;
  border-radius: 0;
  padding: 12px 0 0;
}

/* ---- 9c. Панель под видео: раздельные реакции (как в оригинале), но крупнее ---- */
.watch-toolbar { gap: 8px; }
.watch-reactions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-right: 4px;
}
.watch-reactions .comment-reactions__trigger {
  width: 44px;
  height: 44px;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.04);
  color: #c9bcff;
}
.watch-reactions .comment-reactions__trigger:hover {
  background: var(--accent-soft);
  border-color: rgba(124, 92, 255, 0.4);
}
.watch-reactions .comment-reactions__chips {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.watch-reactions .comment-reaction-chip {
  height: 44px;
  padding: 0 16px 0 14px;
  gap: 7px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
}
.watch-reactions .comment-reactions__trigger svg { width: 22px; height: 22px; }
.watch-reactions .comment-reaction-chip:hover {
  background: rgba(255, 255, 255, 0.1);
}
.watch-reactions .comment-reaction-chip.is-mine {
  background: var(--accent-soft);
  border-color: rgba(124, 92, 255, 0.45);
}
.watch-reactions .comment-reaction-chip__emoji { font-size: 19px; }
.watch-reactions .comment-reaction-chip__count {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}

/* ============================================================
   10. Загрузка (upload)
   ============================================================ */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 8px 26px rgba(0, 0, 0, 0.32);
  padding: 22px;
}

.field { margin-bottom: 18px; }
.field__label {
  font-size: 13.5px;
  font-weight: 600;
  color: #d3d6e2;
  letter-spacing: 0.01em;
}
.field__hint { font-size: 12.5px; opacity: 0.7; }

.input,
.textarea,
.select {
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  padding: 12px 14px;
  font-size: 14.5px;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}
.input::placeholder,
.textarea::placeholder { color: rgba(255, 255, 255, 0.34); }
.input:focus,
.textarea:focus,
.select:focus {
  outline: none;
  border-color: var(--accent);
  background: rgba(255, 255, 255, 0.06);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

/* Дроп-зона файла — фиолетовый акцент вместо красного */
.file-drop {
  min-height: 188px;
  border: 2px dashed rgba(255, 255, 255, 0.16);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.025);
}
.file-drop:hover,
.file-drop.dragover {
  border-color: rgba(124, 92, 255, 0.6);
  background: var(--accent-soft);
  color: var(--text);
}
.file-drop.has-file {
  border-style: solid;
  border-color: rgba(124, 92, 255, 0.45);
  background: rgba(124, 92, 255, 0.08);
}
.file-drop__icon {
  width: 44px;
  height: 44px;
  color: #a892ff;
}
.file-drop__title { font-size: 16px; font-weight: 600; color: var(--text); }

.btn--accent {
  background: linear-gradient(135deg, #8b6bff, #6a3cff);
  border-radius: 12px;
  padding: 12px 22px;
  font-weight: 600;
  box-shadow: 0 8px 22px rgba(124, 92, 255, 0.34);
}
.btn--accent:hover {
  background: linear-gradient(135deg, #8b6bff, #6a3cff);
  filter: brightness(1.08);
}

.tag-chip {
  border-radius: 999px;
  background: var(--accent-soft);
  border: 1px solid rgba(124, 92, 255, 0.4);
  color: #d8cfff;
}

/* ============================================================
   11. Профиль
   ============================================================ */
.avatar-edit .avatar--lg {
  border: 3px solid rgba(124, 92, 255, 0.35);
}
.avatar-edit .overlay { border-radius: 50%; }
.avatar--lg {
  background: linear-gradient(135deg, #4a4458, #2c2838);
}

.profile-head__name,
.app-content > .card h1 {
  font-family: "Unbounded", sans-serif;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.app-content .card h3 {
  font-family: "Unbounded", sans-serif;
  font-weight: 600;
  font-size: 17px;
  letter-spacing: -0.01em;
}
.two-col { gap: 18px; }

.ok { color: #4ade80; }
.err { color: #f87171; }

/* Одноколоночные страницы (загрузка, логин) — контент по центру */
.app-body:not(.app-body--with-sidebar) .app-content {
  max-width: 760px;
  margin: 0 auto;
  width: 100%;
}
