/* ================================================================
   ВидеоПортал — Главная таблица стилей
   Тёмная тема, шрифты Unbounded + Golos Text
   ================================================================ */

/* ─── Переменные ─────────────────────────────────────────────── */
:root {
    --bg:           #0c0c0e;
    --bg2:          #111116;
    --surface:      #18181f;
    --surface2:     #1f1f28;
    --hover:        #25252f;
    --border:       #2a2a36;
    --border2:      #35354a;
    --accent:       #e63946;
    --accent-dark:  #b52d38;
    --accent-glow:  rgba(230,57,70,.18);
    --text:         #ededf0;
    --text-2:       #9898a8;
    --text-3:       #4e4e62;
    --chip-bg:      #2a1f2b;
    --chip-color:   #e086a0;
    --radius:       12px;
    --radius-sm:    7px;
    --radius-xs:    4px;
    --nav-h:        62px;
    --ff-head:      'Unbounded', sans-serif;
    --ff-body:      'Golos Text', sans-serif;
    --shadow:       0 8px 32px rgba(0,0,0,.55);
    --shadow-sm:    0 2px 10px rgba(0,0,0,.4);
    --ease:         0.18s ease;
}

/* ─── Сброс ──────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--ff-body);
    font-size: 14px;
    line-height: 1.65;
    min-height: 100vh;
}
a    { color: inherit; text-decoration: none; }
img  { display: block; max-width: 100%; }
button { cursor: pointer; border: none; background: none; font: inherit; color: inherit; }
input, select, textarea { font: inherit; color: inherit; }

/* ─── Скроллбар ──────────────────────────────────────────────── */
::-webkit-scrollbar        { width: 5px; height: 5px; }
::-webkit-scrollbar-track  { background: transparent; }
::-webkit-scrollbar-thumb  { background: var(--border2); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #555568; }

/* ================================================================
   ШАПКА / НАВИГАЦИЯ
   ================================================================ */
.site-header {
    position: sticky;
    top: 0;
    z-index: 200;
    height: var(--nav-h);
    background: rgba(12,12,14,.92);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border-bottom: 1px solid var(--border);
}

.navbar {
    max-width: 1440px;
    margin: 0 auto;
    height: 100%;
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 0 24px;
}

/* Логотип */
.logo {
    display: flex;
    align-items: center;
    gap: 9px;
    flex-shrink: 0;
}
.logo-play {
    width: 34px; height: 34px;
    background: var(--accent);
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    font-size: 14px;
    color: #fff;
    flex-shrink: 0;
    transition: box-shadow var(--ease);
}
.logo:hover .logo-play {
    box-shadow: 0 0 16px var(--accent-glow);
}
.logo-word {
    font-family: var(--ff-head);
    font-size: 17px;
    font-weight: 700;
    letter-spacing: -.3px;
    line-height: 1;
}
.logo-word strong { color: var(--accent); }

/* Центральное меню */
.nav-center {
    display: flex;
    align-items: center;
    gap: 2px;
    overflow-x: auto;
    scrollbar-width: none;
    flex: 1;
}
.nav-center::-webkit-scrollbar { display: none; }

.nav-link {
    padding: 6px 13px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 500;
    color: var(--text-2);
    white-space: nowrap;
    transition: background var(--ease), color var(--ease);
}
.nav-link:hover    { background: var(--surface2); color: var(--text); }
.nav-link.is-active{ background: var(--surface2); color: var(--text); }
.nav-shorts        { color: var(--accent) !important; }

/* Бургер */
.burger {
    display: none;
    flex-direction: column;
    gap: 5px;
    padding: 8px;
    border-radius: var(--radius-sm);
    transition: background var(--ease);
}
.burger:hover { background: var(--surface2); }
.burger span {
    display: block;
    width: 22px; height: 2px;
    background: var(--text);
    border-radius: 2px;
    transition: all .25s;
}

/* Мобильное меню */
.mobile-nav {
    display: none;
    position: fixed;
    top: var(--nav-h);
    left: 0; right: 0;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    z-index: 199;
    padding: 10px 14px 14px;
    flex-direction: column;
    gap: 3px;
    box-shadow: var(--shadow);
}
.mobile-nav.is-open { display: flex; }
.mobile-nav a {
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    color: var(--text-2);
    transition: background var(--ease), color var(--ease);
}
.mobile-nav a:hover { background: var(--surface2); color: var(--text); }

/* ================================================================
   ОСНОВНАЯ ОБЛАСТЬ
   ================================================================ */
.site-main {
    max-width: 1440px;
    margin: 0 auto;
    padding: 32px 24px 80px;
}

/* ─── Герой страницы ─────────────────────────────────────────── */
.page-hero {
    margin-bottom: 28px;
}
.hero-title {
    font-family: var(--ff-head);
    font-size: 26px;
    font-weight: 900;
    letter-spacing: -.5px;
    line-height: 1.2;
    margin-bottom: 6px;
}
.hero-sub {
    font-size: 13px;
    color: var(--text-2);
}

/* ─── Chip / тег ─────────────────────────────────────────────── */
.chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: var(--chip-bg);
    color: var(--chip-color);
    padding: 4px 11px;
    border-radius: 20px;
    font-size: 11.5px;
    font-weight: 600;
    letter-spacing: .2px;
    border: 1px solid rgba(224,134,160,.15);
    transition: background var(--ease);
}
.chip:hover { background: #3a2033; }
.chip-sm { font-size: 10.5px; padding: 2px 8px; }

/* ─── YouTube-бейдж ──────────────────────────────────────────── */
.badge-yt {
    position: absolute;
    top: 8px; right: 8px;
    background: #ff0000;
    color: #fff;
    font-size: 9.5px;
    font-weight: 800;
    padding: 2px 7px;
    border-radius: 3px;
    letter-spacing: .6px;
    text-transform: uppercase;
}

/* ================================================================
   СЕТКА ВИДЕО
   ================================================================ */
.video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
    gap: 20px;
}

/* ─── Карточка видео ─────────────────────────────────────────── */
.vcard {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    cursor: pointer;
    transition: transform var(--ease), box-shadow var(--ease), border-color var(--ease);
}
.vcard:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow);
    border-color: var(--border2);
}

.vcard__thumb {
    position: relative;
    aspect-ratio: 16/9;
    background: #0a0a10;
    overflow: hidden;
}
.vcard__thumb img {
    width: 100%; height: 100%;
    object-fit: cover;
    transition: transform .35s ease;
}
.vcard:hover .vcard__thumb img { transform: scale(1.05); }

/* Эффект воспроизведения при наведении */
.vcard__thumb::after {
    content: '▶';
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
    color: rgba(255,255,255,.9);
    background: rgba(0,0,0,.35);
    opacity: 0;
    transition: opacity .22s;
}
.vcard:hover .vcard__thumb::after { opacity: 1; }

.vcard__body {
    padding: 13px 14px 15px;
}
.vcard__title {
    font-size: 14px;
    font-weight: 600;
    line-height: 1.45;
    margin-bottom: 9px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.vcard__meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 5px;
}
.vcard__cat    { /* использует .chip */ }
.vcard__views  { font-size: 12px; color: var(--text-2); }
.vcard__time   { font-size: 11px; color: var(--text-3); }

/* ─── Кнопка «Загрузить ещё» ─────────────────────────────────── */
.loadmore-wrap { text-align: center; margin: 44px 0; }
.btn-loadmore {
    background: var(--surface2);
    border: 1px solid var(--border2);
    color: var(--text-2);
    padding: 12px 40px;
    border-radius: 30px;
    font-size: 13.5px;
    font-weight: 600;
    transition: all var(--ease);
}
.btn-loadmore:hover {
    background: var(--hover);
    color: var(--text);
    border-color: #555568;
}
.btn-loadmore:disabled { opacity: .45; cursor: default; }

/* ================================================================
   СТРАНИЦА ВИДЕО (просмотр)
   ================================================================ */
.watch-layout {
    max-width: 880px;
    margin: 0 auto;
}

/* Плеер */
.watch-player-wrap {
    position: relative;
    width: 100%;
    aspect-ratio: 16/9;
    background: #000;
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: 20px;
    box-shadow: 0 12px 48px rgba(0,0,0,.7);
}
.watch-iframe,
.watch-video {
    width: 100%; height: 100%;
    display: block;
}

/* Блок информации */
.watch-info {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px 24px 22px;
    margin-bottom: 22px;
}
.watch-title {
    font-family: var(--ff-head);
    font-size: 20px;
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 14px;
    letter-spacing: -.3px;
}
.watch-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    margin-bottom: 18px;
    font-size: 13px;
    color: var(--text-2);
}
.watch-views { display: flex; align-items: center; gap: 4px; }
.watch-date  { display: flex; align-items: center; gap: 4px; }

/* Кнопка лайка */
.like-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--surface2);
    border: 1px solid var(--border2);
    padding: 9px 22px;
    border-radius: 24px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-2);
    transition: all var(--ease);
}
.like-btn:hover {
    border-color: var(--accent);
    background: var(--accent-glow);
    color: var(--accent);
}
.like-btn.is-liked {
    border-color: var(--accent);
    background: var(--accent-glow);
    color: var(--accent);
}
.like-btn.is-liked .like-heart { animation: heartbeat .3s ease; }
.like-heart { font-size: 17px; }

@keyframes heartbeat {
    0%   { transform: scale(1); }
    50%  { transform: scale(1.45); }
    100% { transform: scale(1); }
}

/* ─── Комментарии ────────────────────────────────────────────── */
.comments-block {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
}
.block-title {
    font-family: var(--ff-head);
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 22px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 10px;
}
.comment-count {
    background: var(--surface2);
    color: var(--text-2);
    font-size: 12px;
    padding: 2px 8px;
    border-radius: 10px;
}

/* Форма */
.comment-form { margin-bottom: 28px; }
.comment-textarea {
    width: 100%;
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 12px 14px;
    resize: vertical;
    min-height: 82px;
    transition: border-color var(--ease);
    margin-bottom: 12px;
    color: var(--text);
}
.comment-textarea:focus { outline: none; border-color: var(--accent); }
.comment-textarea::placeholder { color: var(--text-3); }

.captcha-line {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
    flex-wrap: wrap;
}
.captcha-question { font-size: 13px; color: var(--text-2); }
.captcha-answer {
    width: 78px;
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 7px 10px;
    text-align: center;
    transition: border-color var(--ease);
}
.captcha-answer:focus { outline: none; border-color: var(--accent); }

.form-footer {
    display: flex;
    align-items: center;
    gap: 14px;
}
.btn-comment {
    background: var(--accent);
    color: #fff;
    padding: 9px 22px;
    border-radius: 22px;
    font-size: 13px;
    font-weight: 600;
    transition: background var(--ease), transform var(--ease);
}
.btn-comment:hover    { background: var(--accent-dark); }
.btn-comment:active   { transform: scale(.97); }
.btn-comment:disabled { opacity: .5; cursor: default; }

.form-feedback          { font-size: 13px; }
.form-feedback.is-ok    { color: #6ee7a0; }
.form-feedback.is-err   { color: var(--accent); }

/* Элементы комментариев */
.comment-list { display: flex; flex-direction: column; gap: 2px; }
.comment-item {
    display: flex;
    gap: 13px;
    padding: 14px 0;
    border-bottom: 1px solid var(--border);
}
.comment-item:last-child { border-bottom: none; }

/* Анимация появления */
.comment-item.is-new {
    opacity: 0;
    transform: translateY(-10px);
    transition: opacity .3s, transform .3s;
}
.comment-item.is-new.is-visible { opacity: 1; transform: none; }

.comment-ava {
    width: 36px; height: 36px;
    flex-shrink: 0;
    background: var(--surface2);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 20px;
    border: 1px solid var(--border);
}
.comment-content { flex: 1; min-width: 0; }
.comment-text {
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 4px;
    word-break: break-word;
    color: var(--text);
}
.comment-time { font-size: 11px; color: var(--text-3); }

/* ================================================================
   SHORTS
   ================================================================ */
.shorts-feed {
    height: calc(100vh - var(--nav-h));
    overflow-y: scroll;
    scroll-snap-type: y mandatory;
    scrollbar-width: none;
}
.shorts-feed::-webkit-scrollbar { display: none; }

.short-slide {
    scroll-snap-align: start;
    height: calc(100vh - var(--nav-h));
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    background: #000;
}

.short-media {
    height: 100%;
    max-width: 400px;
    width: 100%;
    position: relative;
}
.short-video,
.short-iframe {
    width: 100%; height: 100%;
    object-fit: contain;
    display: block;
}

.short-info {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    padding: 60px 20px 24px;
    background: linear-gradient(transparent, rgba(0,0,0,.88));
    pointer-events: none;
}
.short-title {
    font-family: var(--ff-head);
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 7px;
    line-height: 1.35;
}
.short-meta { display: flex; gap: 10px; align-items: center; }
.short-views { font-size: 12px; color: rgba(255,255,255,.65); }

.short-nav-btn {
    position: absolute;
    right: 18px;
    width: 42px; height: 42px;
    background: rgba(255,255,255,.08);
    border: 1px solid rgba(255,255,255,.18);
    border-radius: 50%;
    color: #fff;
    font-size: 15px;
    display: flex; align-items: center; justify-content: center;
    backdrop-filter: blur(6px);
    transition: background var(--ease);
}
.short-nav-btn:hover { background: rgba(255,255,255,.22); }
.nav-down { bottom: 84px; }
.nav-up   { bottom: 136px; }

.short-counter {
    position: absolute;
    top: 14px; right: 18px;
    background: rgba(0,0,0,.5);
    color: rgba(255,255,255,.75);
    font-size: 11px;
    font-weight: 600;
    padding: 3px 9px;
    border-radius: 10px;
    backdrop-filter: blur(4px);
}

.shorts-empty {
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-2);
    text-align: center;
    gap: 10px;
    padding: 24px;
}
.shorts-empty-icon { font-size: 52px; }

/* ================================================================
   ФУТЕР
   ================================================================ */
.site-footer {
    border-top: 1px solid var(--border);
    margin-top: 60px;
}
.footer-inner {
    max-width: 1440px;
    margin: 0 auto;
    padding: 20px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
}
.footer-logo { font-family: var(--ff-head); font-size: 13px; color: var(--accent); font-weight: 700; }
.footer-copy { font-size: 12px; color: var(--text-3); }
.footer-admin {
    font-size: 12px;
    color: var(--text-3);
    transition: color var(--ease);
}
.footer-admin:hover { color: var(--text-2); }

/* ─── Пустое состояние ───────────────────────────────────────── */
.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 24px;
    color: var(--text-2);
    font-size: 15px;
}

/* ================================================================
   АДАПТИВ
   ================================================================ */
@media (max-width: 900px) {
    .nav-center { display: none; }
    .burger     { display: flex; margin-left: auto; }
    .site-main  { padding: 22px 16px 60px; }
    .video-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 13px; }
    .watch-layout   { max-width: 100%; }
    .watch-title    { font-size: 17px; }
    .watch-player-wrap { border-radius: 0; margin-left: -16px; margin-right: -16px; width: calc(100% + 32px); }
    .short-media    { max-width: 100%; }
    .footer-inner   { justify-content: center; text-align: center; }
}

@media (max-width: 480px) {
    .hero-title      { font-size: 20px; }
    .video-grid      { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .vcard__title    { font-size: 12.5px; }
    .comments-block  { padding: 16px; }
    .watch-info      { padding: 16px; }
}
