/* ===== VIDEO LIBRARY ===== */
.section-video-library {
    margin: 60px 0;
}

.section-video-library .container {
    padding-left: 0px !important;
}

.video-library-title {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 30px;
}

/* Grid 3 video / row */
.video-gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
}

/* Video item */
.video-item {
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
}

.video-item:hover {
    transform: translateY(-8px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

/* iframe responsive 16:9 */
.video-embed {
    position: relative;
    padding-top: 56.25%;
}

.video-embed iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border-radius: 16px;
}

/* Title */
.video-title {
    font-size: 16px;
    font-weight: 600;
    margin: 12px 8px 0;
    text-align: center;
    transition: color 0.3s ease;
}

.video-item:hover .video-title {
    color: #0066cc;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
    .video-gallery-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .video-gallery-grid {
        display: flex !important;
        grid-template-columns: none !important;
        flex-direction: row;
        overflow-x: auto;
        overflow-y: hidden;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
        gap: 15px;
        padding: 0 15px 10px;
        margin: 0 -15px;
    }

    .video-gallery-grid::-webkit-scrollbar {
        height: 6px;
    }

    .video-gallery-grid::-webkit-scrollbar-track {
        background: #f1f1f1;
        border-radius: 10px;
    }

    .video-gallery-grid::-webkit-scrollbar-thumb {
        background: #888;
        border-radius: 10px;
    }

    .video-gallery-grid::-webkit-scrollbar-thumb:hover {
        background: #555;
    }

    .video-item {
        min-width: 85% !important;
        max-width: 85% !important;
        width: 85%;
        scroll-snap-align: center;
        flex-shrink: 0;
        flex-grow: 0;
    }

    .video-item:first-child {
        margin-left: 0;
    }

    .video-item:last-child {
        margin-right: 15px;
    }
}

/* Thumbnail */
.video-thumb {
    position: relative;
    padding-top: 56.25%;
    cursor: pointer;
    overflow: hidden;
}

.video-thumb img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 16px;
    transition: transform 0.3s ease;
}

.video-item:hover .video-thumb img {
    transform: scale(1.05);
}

.video-play-icon {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 56px;
    color: #fff;
    background: rgba(0, 0, 0, 0.4);
}

/* ===== MODAL ===== */
.video-modal {
    position: fixed;
    inset: 0;
    display: none;
    z-index: 9999;
    align-items: center;
    justify-content: center;
}

.video-modal.active {
    display: flex;
}

.video-modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
}

.video-modal-content {
    position: relative;
    max-width: 1000px;
    width: 90%;
    background: #000;
    z-index: 10000;
}

.video-modal-body {
    aspect-ratio: 16 / 9;
}

.video-modal-body iframe {
    width: 100%;
    height: 100%;
}

.video-modal-close {
    position: absolute;
    top: -40px;
    right: 0;
    font-size: 32px;
    background: none;
    border: 0;
    color: #fff;
    cursor: pointer;
}