/* === Сетка видео === */
.videos-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    margin-top: 1.5rem;
    width: 100%;
}

@media (max-width: 768px) {
    .videos-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .videos-grid {
        grid-template-columns: 1fr;
    }
}

/* === Карточка видео === */
.video-card {
    display: block;
    border-radius: 10px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: transform 0.2s, box-shadow 0.2s;
    text-decoration: none;
    color: inherit;
}

.video-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
}

/* === Миниатюра === */
.video-thumbnail-wrapper {
    position: relative;
    padding-top: 56.25%; /* 16:9 */
    overflow: hidden;
    background: #1a1a1a;
}

.video-thumbnail {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Play-оверлей */
.video-play-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.25);
    opacity: 0;
    transition: opacity 0.2s;
}

.video-card:hover .video-play-overlay {
    opacity: 1;
}

.video-play-overlay .material-symbols-outlined {
    font-size: 56px;
    color: #fff;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 50%;
    padding: 8px;
}

/* VIP-бейдж на карточке */
.video-vip-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    background: var(--clm-orange, #ff9000);
    color: #fff;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 3px;
    z-index: 2;
}

/* Заблокированная карточка */
.video-locked {
    opacity: 0.65;
    filter: grayscale(30%);
}

.video-locked:hover {
    opacity: 0.8;
}

/* === Контент карточки === */
.video-content {
    padding: 1rem 1.2rem 1.2rem;
}

.video-title {
    font-size: 17px;
    font-weight: 700;
    margin: 0 0 0.5rem;
    line-height: 1.3;
    color: #111;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.video-description {
    font-size: 13px;
    color: #666;
    margin: 0 0 0.5rem;
    line-height: 1.4;
}

.video-meta {
    font-size: 12px;
    color: #999;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.video-views {
    display: inline-flex;
    align-items: center;
    gap: 3px;
}

.video-views .material-symbols-outlined {
    font-size: 14px;
}

/* === Страница просмотра === */
.video-page {
    max-width: 900px;
    margin: 0 auto;
}

.video-page-title {
    font-size: 24px;
    margin-bottom: 1rem;
}

/* Адаптивный контейнер для embed */
.video-embed-container {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 */
    height: 0;
    overflow: hidden;
    border-radius: 10px;
    background: #000;
}

.video-embed-container iframe,
.video-embed-container video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.video-page-meta {
    display: flex;
    gap: 1rem;
    align-items: center;
    margin-top: 1rem;
    font-size: 14px;
    color: #888;
}

.video-vip-badge-inline {
    background: var(--clm-orange, #ff9000);
    color: #fff;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 3px;
}

.video-page-description {
    margin-top: 1.5rem;
    font-size: 15px;
    line-height: 1.6;
    color: #333;
}

/* === Страница доступ закрыт === */
.video-access-denied {
    max-width: 600px;
    margin: 2rem auto;
    text-align: center;
}

.video-access-denied-thumbnail {
    position: relative;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 1.5rem;
}

.video-access-denied-thumbnail img {
    width: 100%;
    display: block;
    filter: grayscale(50%) brightness(0.6);
}

.video-access-denied-lock {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.6);
    border-radius: 50%;
    padding: 1.2rem;
}

.video-access-denied-lock .material-symbols-outlined {
    font-size: 48px;
    color: #fff;
}

.video-access-denied h2 {
    font-size: 22px;
    margin-bottom: 0.8rem;
}

.video-access-denied-message {
    font-size: 16px;
    color: #666;
    margin-bottom: 1.5rem;
}

.video-access-denied-hint {
    font-size: 14px;
    color: #888;
    margin-bottom: 1.5rem;
}

.video-access-denied-back {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    color: var(--clm-orange, #ff9000);
    text-decoration: none;
    font-size: 14px;
}

.video-access-denied-back:hover {
    text-decoration: underline;
}

/* === Полка (Netflix-style) === */
.videos-shelf {
    width: 100%;
    margin-top: 1.5rem;
}

.videos-shelf-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: .8rem;
}

.videos-shelf-title {
    font-size: 22px;
    font-weight: 700;
    margin: 0;
    color: var(--clm-text, #ccc);
}

/* Горизонтальный трек карточек с snap-скроллом */
.videos-shelf-track {
    display: flex;
    gap: 1rem;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    padding-bottom: .6rem;
    -webkit-overflow-scrolling: touch;
}

.videos-shelf-track::-webkit-scrollbar {
    height: 8px;
}

.videos-shelf-track::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 4px;
}

.videos-shelf-track::-webkit-scrollbar-thumb:hover {
    background: #999;
}

.videos-shelf-item {
    flex: 0 0 280px;
    scroll-snap-align: start;
}

@media (max-width: 768px) {
    .videos-shelf-item {
        flex: 0 0 220px;
    }
}

@media (max-width: 480px) {
    .videos-shelf-item {
        flex: 0 0 75%;
    }
}

/* === Сетка категорий === */
.category-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

@media (max-width: 900px) {
    .category-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 560px) {
    .category-grid {
        grid-template-columns: 1fr;
    }
}

/* === Карточка категории === */
.category-card {
    display: block;
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    text-decoration: none;
    color: inherit;
    transition: transform .2s, box-shadow .2s;
}

.category-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.14);
}

.category-card-thumb {
    position: relative;
    padding-top: 56.25%;
    overflow: hidden;
    background: #222;
}

.category-card-thumb img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .4s;
}

.category-card:hover .category-card-thumb img {
    transform: scale(1.04);
}

/* Иконка «стопка» поверх обложки */
.category-card-overlay {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.65);
    color: #fff;
    border-radius: 50%;
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.category-card-overlay .material-symbols-outlined {
    font-size: 24px;
}

.category-card-content {
    padding: 1rem 1.2rem 1.2rem;
}

.category-card-title {
    font-size: 18px;
    font-weight: 700;
    margin: 0 0 .3rem;
    color: #111;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.category-card-count {
    margin: 0;
    font-size: 13px;
    color: #999;
}

.category-card-locked {
    opacity: .7;
    filter: grayscale(25%);
}

/* === Ссылка «← Все категории» на странице категории === */
.category-back-link {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    color: var(--clm-orange, #ff9000);
    text-decoration: none;
    font-size: 14px;
    margin-bottom: 1rem;
}

.category-back-link:hover {
    text-decoration: underline;
}

.category-back-link .material-symbols-outlined {
    font-size: 18px;
}

.category-description {
    font-size: 15px;
    line-height: 1.5;
    color: #555;
    margin: 0 0 1.5rem;
    max-width: 800px;
}
