﻿/* ==========================================
    SHORT VIDEO PROJECTS - 9:16 GRID & POPUP
    ========================================== */

/* Grid hiển thị danh sách Short Video */
.section-short-videos {
    margin-top: 30px;
    margin-bottom: 30px;
    width: 100% !important;
    clear: both;
}

    .section-short-videos:not(.hidden) {
        display: block !important;
        opacity: 1 !important;
        visibility: visible !important;
    }

.short-grid {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    width: 100%;
}

@media (max-width: 991px) {
    .short-grid {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 15px !important;
    }
}

@media (max-width: 767px) {
    .short-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 10px !important;
    }
}

/* Thẻ Short Video 9:16 */
.short-card {
    background: #ffffff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
}

    .short-card:hover {
        transform: translateY(-6px);
        box-shadow: 0 8px 25px rgba(88, 197, 199, 0.3);
    }

/* Tỷ lệ ảnh 9:16 chuẩn */
.short-thumb {
    position: relative;
    width: 100%;
    padding-top: 177.77%; /* Tỷ lệ 9:16 */
    overflow: hidden;
    background-color: #000;
}

    .short-thumb img {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        object-fit: cover;
        transition: transform 0.4s ease;
    }

.short-card:hover .short-thumb img {
    transform: scale(1.06);
}

/* Badge số lượt xem & thời lượng */
.short-play-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(4px);
    color: #fff;
    font-size: 11px;
    padding: 3px 8px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.short-duration {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.65);
    color: #fff;
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 4px;
}

/* Thông tin bên dưới card */
.short-info {
    padding: 12px;
    background: #fff;
}

.short-title {
    font-size: 13px;
    font-weight: 700;
    color: #192335;
    margin: 0 0 6px 0;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    height: 35px;
}

.short-desc {
    font-size: 12px;
    color: #666;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ==========================================
    POPUP FULLSCREEN SLIDE SHORT VIDEO
    ========================================== */
.short-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

    .short-modal.active {
        opacity: 1;
        visibility: visible;
    }

.short-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.88);
    backdrop-filter: blur(8px);
}

.short-modal-container {
    position: relative;
    width: 100%;
    max-width: 420px;
    height: 90vh;
    max-height: 750px;
    z-index: 2;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

@media (max-width: 500px) {
    .short-modal-container {
        width: 100vw !important;
        height: 100% !important;
        height: -webkit-fill-available !important;
        max-height: none !important;
        border-radius: 0 !important;
    }

    .short-card {
        margin-bottom: 5px;
    }
}

/* Nút Đóng */
.short-close-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    z-index: 10;
    background: rgba(0, 0, 0, 0.5);
    border: none;
    color: #fff;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    cursor: pointer;
    transition: background 0.2s ease;
}

    .short-close-btn:hover {
        background: rgba(88, 197, 199, 0.9);
    }

/* Khung Slider cuộn đứng */
.short-slider-wrapper {
    width: 100%;
    height: 100%;
    overflow-y: scroll;
    scroll-snap-type: y mandatory;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE/Edge */
}

    .short-slider-wrapper::-webkit-scrollbar {
        display: none; /* Chrome/Safari */
    }

#shortSliderWrapper {
    width: 100%;
    height: 100%;
    overflow-y: auto;
    scroll-snap-type: y mandatory; /* Bắt dính từng slide khi lướt */
    position: relative;
}

.short-slide-item {
    width: 100%;
    height: 100%; /* Đảm bảo mỗi slide cao đúng bằng khung modal */
    scroll-snap-align: start;
    scroll-snap-stop: always;
    flex-shrink: 0;
}

.short-player-box {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.short-video-player {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.short-iframe {
    width: 100%;
    height: 100%;
    border: none;
    outline: none;
    object-fit: cover;
    border-radius: 12px;
}
/* Overlay hiển thị thông tin tên dự án trên video */
.short-overlay-details {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 25px 15px 15px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.85) 0%, rgba(0, 0, 0, 0.4) 60%, transparent 100%);
    color: #fff;
    pointer-events: none; /* Giúp thao tác bấm/lướt vào iframe không bị kẹt */
    z-index: 3;
}

    .short-overlay-details h3 {
        font-size: 16px;
        font-weight: 700;
        color: #fff !important;
        margin: 0 0 6px 0;
        line-height: 1.3;
    }

    .short-overlay-details p {
        font-size: 13px;
        color: #ddd;
        margin: 0;
    }

/* Nút điều hướng Lướt Lên / Lướt Xuống */
.short-nav-controls {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 12px;
    z-index: 10;
}

.short-nav-btn {
    background: rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(4px);
    border: none;
    color: #fff;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    cursor: pointer;
    transition: all 0.2s ease;
}

    .short-nav-btn:hover {
        background: #58C5C7;
        color: #fff;
    }
