/* ===================================================================
   VIDEO — YouTube 2024+ style
   =================================================================== */

:root {
    --color-brand: var(--color-brand);
    --color-brand-hover: #26a1ab;
}

/* --- ANIMATIONS --- */
@keyframes s-fadeInUp {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

/* --- КАТАЛОГ --- */

.s-video-catalog { padding-top: 5px; }

/* Toolbar */
.s-video-toolbar {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}
.s-video-toolbar .s-video-search-form {
    flex: 1;
    min-width: 200px;
    max-width: 500px;
}

/* Поиск (pill) */
.s-video-search-form .input-group {
    border: 1px solid #d3d3d3;
    border-radius: 40px;
    overflow: hidden;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.s-video-search-form .input-group:focus-within {
    border-color: var(--color-brand);
    box-shadow: 0 0 0 1px var(--color-brand) inset;
}
.s-video-search-form .form-control {
    border: none;
    box-shadow: none;
    padding: 8px 20px;
    font-size: 15px;
    height: 40px;
    background: transparent;
}
.s-video-search-form .form-control:focus { box-shadow: none; }
.s-video-search-form .input-group-btn .btn {
    border: none;
    border-left: 1px solid #d3d3d3;
    border-radius: 0;
    background: #f8f8f8;
    color: #606060;
    height: 40px;
    width: 56px;
    font-size: 16px;
    padding: 0;
}
.s-video-search-form .input-group-btn .btn:hover { background: #f0f0f0; }

/* Chips сортировки */
.s-video-sort-group {
    display: inline-flex;
    gap: 8px;
}
.s-video-sort-group .btn {
    border: none !important;
    border-radius: 8px;
    background: #f2f2f2;
    color: #0f0f0f;
    font-size: 14px;
    font-weight: 500;
    padding: 8px 16px;
    line-height: 1;
    box-shadow: none !important;
    outline: none !important;
    transition: background 0.15s, color 0.15s;
}
.s-video-sort-group .btn:hover { background: #e5e5e5; color: #0f0f0f; }
.s-video-sort-group .btn.c-theme-btn,
.s-video-sort-group .btn.c-theme-btn:hover { background: #0f0f0f; color: #fff; }

/* Tags bar */
.s-video-tags-bar {
    display: flex;
    gap: 8px;
    padding: 12px 0;
    overflow-x: auto;
    scrollbar-width: none;
}
.s-video-tags-bar::-webkit-scrollbar { display: none; }
.s-video-tag-filter {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    border-radius: 8px;
    background: #f2f2f2;
    color: #0f0f0f;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    white-space: nowrap;
    transition: background 0.15s;
}
.s-video-tag-filter:hover { background: #e5e5e5; color: #0f0f0f; text-decoration: none; }
.s-video-tag-filter.active { background: #0f0f0f; color: #fff; }
.s-video-tag-filter.active:hover { background: #272727; color: #fff; }
.s-video-tag-count { font-size: 12px; opacity: 0.6; }

/* Сетка (flex вместо float чтобы карточки разной высоты не цеплялись) */
.s-video-grid {
    display: flex;
    flex-wrap: wrap;
    margin-left: -8px;
    margin-right: -8px;
}
.s-video-grid > [class*="col-"] {
    padding-left: 8px;
    padding-right: 8px;
    margin-bottom: 28px;
    float: none;
}

/* --- КАРТОЧКА ВИДЕО --- */

.s-video-card {
    background: transparent;
    animation: s-fadeInUp 0.35s ease both;
}
.s-video-grid > div:nth-child(1) .s-video-card { animation-delay: 0s; }
.s-video-grid > div:nth-child(2) .s-video-card { animation-delay: 0.05s; }
.s-video-grid > div:nth-child(3) .s-video-card { animation-delay: 0.1s; }
.s-video-grid > div:nth-child(4) .s-video-card { animation-delay: 0.15s; }
.s-video-grid > div:nth-child(n+5) .s-video-card { animation-delay: 0.2s; }

.s-video-card-thumb {
    display: block;
    position: relative;
    padding-bottom: 56.25%;
    overflow: hidden;
    background: #0f0f0f;
    border-radius: 12px;
    text-decoration: none;
}
.s-video-card-thumb::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0);
    transition: background 0.2s;
    border-radius: 12px;
    pointer-events: none;
}
.s-video-card:hover .s-video-card-thumb::after {
    background: rgba(0, 0, 0, 0.08);
}
.s-video-card-thumb img {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}
.s-video-card:hover .s-video-card-thumb img {
    transform: scale(1.03);
}
.s-video-card-no-thumb {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
}

/* Секция "Продолжить просмотр" в каталоге */
.s-video-section {
    margin: 0 0 30px;
}
.s-video-section-title {
    font-size: 22px;
    font-weight: 700;
    color: #333;
    margin: 0 0 16px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.s-video-section-title i {
    color: var(--color-brand);
    font-size: 26px;
}
.s-video-continue-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}
@media (max-width: 991px) {
    .s-video-continue-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 767px) {
    .s-video-continue-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 480px) {
    .s-video-continue-grid { grid-template-columns: 1fr; }
}

/* Полоска досмотра в карточке (как на YouTube, но в фирменном бирюзовом) */
.s-video-card-progress {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 4px;
    background: rgba(0, 0, 0, 0.35);
    z-index: 3;
    border-bottom-left-radius: 12px;
    border-bottom-right-radius: 12px;
    overflow: hidden;
    pointer-events: none;
}
.s-video-card-progress .bar {
    display: block;
    height: 100%;
    background: var(--color-brand);
    box-shadow: 0 0 6px rgba(50, 197, 210, 0.7);
    transition: width 0.2s ease;
}

/* Hover-preview видео */
.s-video-card-preview {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    object-fit: cover;
    border-radius: 12px;
    background: #000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s ease;
    z-index: 1;
}
.s-video-card-previewing .s-video-card-preview {
    opacity: 1;
}
.s-video-card-previewing .s-video-card-duration {
    z-index: 2;
}

.s-video-card-duration {
    position: absolute;
    bottom: 8px; right: 8px;
    background: rgba(0, 0, 0, 0.85);
    color: #fff;
    font-size: 12px;
    font-weight: 500;
    padding: 2px 6px;
    border-radius: 4px;
    letter-spacing: 0.5px;
    z-index: 1;
}

.s-video-card-info { padding: 10px 2px 4px; }

.s-video-card-title {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-size: 14px;
    font-weight: 500;
    line-height: 20px;
    max-height: 40px;
    color: #0f0f0f;
    text-decoration: none;
    word-break: break-word;
}
.s-video-card-title:hover { color: #0f0f0f; text-decoration: none; }

.s-video-card-meta {
    margin-top: 4px;
    font-size: 12px;
    color: #606060;
}
.s-video-card-meta span + span::before { content: "\00B7"; margin: 0 4px; }

.s-video-card-tags { margin-top: 5px; line-height: 1.6; }

.s-video-tag {
    font-size: 12px;
    font-weight: 500;
    color: var(--color-brand);
    text-decoration: none;
    margin-right: 4px;
}
.s-video-tag:hover { color: var(--color-brand); }

/* Кнопка "Загрузить ещё" */
.s-video-load-more-wrap {
    text-align: center;
    padding: 24px 0 60px;
}
.s-video-load-more-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 28px;
    border-radius: 22px;
    border: none;
    background: #f2f2f2;
    color: #0f0f0f;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s, transform 0.1s;
}
.s-video-load-more-btn:hover { background: #e5e5e5; }
.s-video-load-more-btn:active { transform: scale(0.97); }

/* Пустое */
.s-video-empty { text-align: center; padding: 80px 20px; }
.s-video-empty svg { opacity: 0.4; }
.s-video-empty p { font-size: 16px; color: #606060; margin-top: 16px; }


/* ===================================================================
   СТРАНИЦА ВИДЕО /video/{uuid}
   =================================================================== */

.s-video-page { padding-top: 5px; padding-bottom: 40px; }

/* Плеер */
.s-video-player-wrap {
    border-radius: 12px;
    overflow: hidden;
    background: #000;
    max-height: 80vh;
    display: flex;
    justify-content: center;
    --plyr-color-main: var(--color-brand);
    --plyr-video-control-color: #fff;
    --plyr-video-control-color-hover: #fff;
    --plyr-menu-color: #0f0f0f;
    --plyr-menu-background: #fff;
    --plyr-range-thumb-background: var(--color-brand);
}
.s-video-player-wrap .plyr,
.s-video-player-wrap video {
    max-height: 80vh;
    width: auto;
    max-width: 100%;
}
/* Fullscreen — убрать ограничения */
.s-video-player-wrap .plyr--fullscreen-active,
.s-video-player-wrap .plyr--fullscreen-active video {
    max-height: none;
    width: 100%;
    height: 100%;
}

/* Placeholder когда видео не конвертировано */
.s-video-player-placeholder {
    border-radius: 12px;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 20px;
    text-align: center;
}
.s-video-player-placeholder p {
    color: rgba(255, 255, 255, 0.7);
    font-size: 18px;
    font-weight: 500;
    margin: 16px 0 4px;
}
.s-video-player-placeholder span {
    color: rgba(255, 255, 255, 0.4);
    font-size: 14px;
}
.s-video-player-placeholder svg {
    animation: s-pulse 2s ease-in-out infinite;
}
@keyframes s-pulse {
    0%, 100% { opacity: 0.4; transform: scale(1); }
    50% { opacity: 0.7; transform: scale(1.1); }
}

/* Заголовок */
.s-video-title {
    font-size: 20px;
    font-weight: 700;
    color: #0f0f0f;
    line-height: 28px;
    margin: 16px 0 0;
    padding: 0;
    text-transform: none;
    letter-spacing: normal;
}

/* Info box (серый бокс) */
.s-video-info-box {
    background: #f2f2f2;
    border-radius: 12px;
    padding: 12px 16px;
    margin-top: 12px;
    cursor: default;
    transition: background 0.15s;
}
.s-video-info-box:hover { background: #e9e9e9; }

.s-video-info-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
}
.s-video-info-stats {
    display: flex;
    gap: 12px;
    font-size: 14px;
    font-weight: 600;
    color: #0f0f0f;
}
.s-video-info-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.s-video-hashtag {
    font-size: 14px;
    font-weight: 600;
    color: var(--color-brand);
    text-decoration: none;
}
.s-video-hashtag:hover { color: var(--color-brand); }

/* Кнопка лайка */
.s-video-like-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 16px;
    border-radius: 18px;
    background: #e5e5e5;
    border: none;
    font-size: 14px;
    font-weight: 500;
    color: #0f0f0f;
    cursor: pointer;
    transition: background 0.15s, transform 0.1s;
    line-height: 1;
}
.s-video-like-btn svg { width: 20px; height: 20px; }
.s-video-like-btn:hover { background: #d4d4d4; }
.s-video-like-btn:active { transform: scale(0.95); }
.s-video-like-btn.active { background: #0f0f0f; color: #fff; }
.s-video-like-btn.active:hover { background: #272727; }

/* Описание (сворачиваемое) */
.s-video-info-description {
    font-size: 14px;
    line-height: 20px;
    color: #0f0f0f;
    margin-top: 8px;
    white-space: pre-wrap;
    word-break: break-word;
}
.s-video-info-description.s-collapsed {
    max-height: 40px;
    overflow: hidden;
}
.s-video-expand-btn {
    background: none;
    border: none;
    padding: 0;
    font-size: 14px;
    font-weight: 600;
    color: #0f0f0f;
    cursor: pointer;
    margin-top: 4px;
}
.s-video-expand-btn:hover { text-decoration: underline; }

/* === Карточка товара === */
.s-video-product-card {
    display: flex;
    align-items: center;
    gap: 16px;
    background: #f2f2f2;
    border-radius: 12px;
    padding: 12px 16px;
    margin-top: 12px;
    text-decoration: none;
    color: #0f0f0f;
    transition: background 0.15s, box-shadow 0.2s;
}
.s-video-product-card:hover {
    background: #e5e5e5;
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.08);
    text-decoration: none;
    color: #0f0f0f;
}
.s-video-product-card img {
    width: 80px;
    height: 80px;
    object-fit: contain;
    border-radius: 8px;
    background: #fff;
    flex-shrink: 0;
}
.s-video-product-noimg {
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #e0e0e0;
    border-radius: 8px;
    flex-shrink: 0;
    color: #999;
    font-size: 24px;
}
.s-video-product-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}
.s-video-product-label {
    font-size: 12px;
    font-weight: 500;
    color: #606060;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.s-video-product-name {
    font-size: 15px;
    font-weight: 600;
    color: #0f0f0f;
    line-height: 20px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.s-video-product-link {
    font-size: 13px;
    font-weight: 500;
    color: var(--color-brand);
    margin-top: 2px;
    transition: color 0.15s;
}
.s-video-product-card:hover .s-video-product-link {
    text-decoration: underline;
}

/* Скрытые товары и кнопка раскрытия */
.s-video-bind-hidden { display: none; }
.s-video-binds-list.s-expanded .s-video-bind-hidden {
    display: flex;
    animation: s-fadeInUp 0.25s ease both;
}

.s-video-binds-toggle {
    margin-top: 12px;
    padding: 8px 16px;
    border-radius: 18px;
    border: none;
    background: #f2f2f2;
    color: #0f0f0f;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s;
}
.s-video-binds-toggle:hover { background: #e5e5e5; }

/* === Комментарии === */
.s-video-comments {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid #e5e5e5;
}
.s-video-comments-header {
    font-size: 16px;
    font-weight: 700;
    color: #0f0f0f;
    margin-bottom: 24px;
}

/* Форма комментария */
.s-video-comment-form { margin-bottom: 32px; }
.s-video-comment-input {
    width: 100%;
    border: none;
    border-bottom: 1px solid #e5e5e5;
    padding: 8px 0;
    font-size: 14px;
    resize: none;
    outline: none;
    background: transparent;
    transition: border-color 0.2s;
    font-family: inherit;
}
.s-video-comment-input:focus {
    border-bottom: 2px solid #0f0f0f;
    padding-bottom: 7px;
}
.s-video-comment-form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 8px;
}
.s-video-btn-cancel {
    padding: 8px 16px;
    border-radius: 18px;
    border: none;
    background: transparent;
    font-size: 14px;
    font-weight: 500;
    color: #606060;
    cursor: pointer;
    transition: background 0.15s;
}
.s-video-btn-cancel:hover { background: #f2f2f2; }
.s-video-btn-submit {
    padding: 8px 16px;
    border-radius: 18px;
    border: none;
    background: var(--color-brand);
    color: #fff;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s, transform 0.1s;
}
.s-video-btn-submit:hover { background: #0550b3; }
.s-video-btn-submit:active { transform: scale(0.97); }
.s-video-btn-submit:disabled { background: #ccc; cursor: default; }

.s-video-no-comments { color: #909090; font-size: 14px; }

/* === Sidebar === */
.s-video-sidebar-section {
    margin-bottom: 20px;
}
.s-video-sidebar-title {
    font-size: 16px;
    font-weight: 700;
    color: #0f0f0f;
    margin: 0 0 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e5e5e5;
}
.s-video-sidebar-more {
    display: block;
    width: 100%;
    padding: 8px 0;
    margin-top: 6px;
    background: none;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    color: #606060;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}
.s-video-sidebar-more:hover {
    background: #f2f2f2;
    color: #0f0f0f;
}
.s-video-related-item {
    margin-bottom: 8px;
    animation: s-fadeInUp 0.3s ease both;
}
.s-video-related-item:nth-child(1) { animation-delay: 0.05s; }
.s-video-related-item:nth-child(2) { animation-delay: 0.1s; }
.s-video-related-item:nth-child(3) { animation-delay: 0.15s; }
.s-video-related-item:nth-child(4) { animation-delay: 0.2s; }
.s-video-related-item:nth-child(n+5) { animation-delay: 0.25s; }

.s-video-related-item .s-video-card {
    display: flex;
    flex-direction: row;
    gap: 8px;
    animation: none;
}
.s-video-related-item .s-video-card-thumb {
    flex: 0 0 168px;
    padding-bottom: 0;
    height: 94px;
    border-radius: 8px;
}
.s-video-related-item .s-video-card-info { padding: 2px 0 0; flex: 1; min-width: 0; }
.s-video-related-item .s-video-card-title { font-size: 13px; line-height: 18px; max-height: 36px; }
.s-video-related-item .s-video-card-meta { font-size: 11px; }
.s-video-related-item .s-video-card-tags { display: none; }

/* === Responsive === */
@media (max-width: 991px) {
    .s-video-grid > [class*="col-"] { margin-bottom: 20px; }
}
@media (max-width: 767px) {
    .s-video-toolbar { flex-direction: column; align-items: stretch; }
    .s-video-toolbar .s-video-search-form { max-width: none; }
    .s-video-title { font-size: 17px; line-height: 24px; }
    .s-video-info-top { flex-direction: column; align-items: flex-start; }
    .s-video-product-card img,
    .s-video-product-noimg { width: 60px; height: 60px; }
    .s-video-related-item .s-video-card-thumb { flex: 0 0 120px; height: 68px; }
    .s-video-sort-group { gap: 6px; }
    .s-video-sort-group .btn { font-size: 13px; padding: 6px 12px; }
}
