/* ==================== ВИДЕОГАЛЕРЕЯ ==================== */

.video-gallery {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    max-width: var(--container-max-width);
    margin: 0 auto;
}

.video-gallery[data-columns="2"] { grid-template-columns: repeat(2, 1fr); }
.video-gallery[data-columns="3"] { grid-template-columns: repeat(3, 1fr); }
.video-gallery[data-columns="4"] { grid-template-columns: repeat(4, 1fr); }

.video-card {
    background: #ffffff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
    border: 1px solid #eef2f8;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

.video-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 16px 32px rgba(0, 0, 0, 0.12);
    border-color: #f3b33d;
}

/* Превью */
.video-thumb {
    position: relative;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: #0b2b3b;
}

.video-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.video-card:hover .video-thumb img {
    transform: scale(1.05);
}

.video-no-image {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1a4a5e 0%, #0b2b3b 100%);
}

/* Кнопка Play */
.video-play-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    transition: all 0.3s ease;
    z-index: 2;
}

.video-play-btn svg {
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.3));
}

.video-card:hover .video-play-btn {
    transform: translate(-50%, -50%) scale(1.15);
}

.video-card:hover .video-play-btn svg circle {
    fill: rgba(243, 179, 61, 0.9);
}

.video-card:hover .video-play-btn svg path {
    fill: #0b2b3b;
}

/* Информация под превью */
.video-info {
    padding: 16px 20px;
}

.video-title {
    font-size: 1rem;
    font-weight: 600;
    color: #142f3c;
    margin: 0 0 6px 0;
    line-height: 1.3;
}

.video-desc {
    font-size: 0.85rem;
    color: #64748b;
    margin: 0;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ==================== МОДАЛЬНОЕ ОКНО ==================== */

.video-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 10000;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeIn 0.3s ease;
}

.video-modal.active {
    display: flex;
}

.video-modal-content {
    width: 100%;
    max-width: 1100px;
    background: #0b2b3b;
    border-radius: 16px;
    overflow: hidden;
    position: relative;
    animation: slideUp 0.3s ease;
}

.video-modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.15);
    border: none;
    border-radius: 50%;
    color: #ffffff;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    z-index: 10;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.video-modal-close:hover {
    background: #f3b33d;
    color: #0b2b3b;
    transform: rotate(90deg);
}

.video-modal-title {
    padding: 16px 60px 16px 20px;
    color: #ffffff;
    font-size: 1.1rem;
    font-weight: 600;
    background: #0b2b3b;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.video-modal-player {
    position: relative;
    width: 100%;
    padding-top: 56.25%; /* 16:9 */
    background: #000;
}

.video-modal-player iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

/* ==================== АДАПТИВНОСТЬ ВИДЕО ==================== */

@media (max-width: 1024px) {
    .video-gallery[data-columns="4"] {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .video-gallery {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }
    .video-gallery[data-columns="4"],
    .video-gallery[data-columns="3"] {
        grid-template-columns: repeat(2, 1fr);
    }
    .video-play-btn {
        width: 56px;
        height: 56px;
    }
    .video-info {
        padding: 12px 14px;
    }
    .video-title {
        font-size: 0.9rem;
    }
    .video-desc {
        display: none; /* Скрываем описание на мобильных */
    }
    .video-modal-content {
        max-width: 100%;
        border-radius: 8px;
    }
    .video-modal-title {
        font-size: 0.95rem;
        padding: 12px 50px 12px 14px;
    }
}

@media (max-width: 480px) {
    .video-gallery {
        grid-template-columns: 1fr;
    }
    .video-gallery[data-columns] {
        grid-template-columns: 1fr;
    }
}

.video-not-found {
    text-align: center;
    padding: 60px 40px;
    background: #ffffff;
    border-radius: 16px;
    color: #64748b;
    border: 1px solid #eef2f8;
}