/* ============================================================
   TIKTOK VT — Video Player Card
   File: tiktok-vt.css
   ============================================================ */

/* ============================================================
   BACKDROP — ala CapCut
   ============================================================ */
#tiktokVideoBackdrop {
    display: none;
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(20px) saturate(120%);
    -webkit-backdrop-filter: blur(20px) saturate(120%);
    z-index: 19;
    opacity: 0;
    transform: scale(1.1);
    transition: opacity 0.4s cubic-bezier(0.22, 1, 0.36, 1), transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
    pointer-events: none;
}

    #tiktokVideoBackdrop.active {
        display: block;
        opacity: 1;
        transform: scale(1);
    }

    #tiktokVideoBackdrop.closing {
        display: block;
        opacity: 0;
        transform: scale(1.05);
        transition: opacity 0.3s cubic-bezier(0.4, 0, 1, 1), transform 0.35s cubic-bezier(0.4, 0, 1, 1);
    }

/* ============================================================
   TIKTOK VIDEO CARD — Animasi CapCut
   ============================================================ */
#tiktokVideoCard {
    display: none;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.35);
    opacity: 0;
    aspect-ratio: 9 / 16;
    max-height: 90vh;
    max-width: 90vw;
    height: 90vh;
    background: #000;
    border-radius: 20px;
    box-shadow: 0 32px 80px rgba(0, 0, 0, 0.85), 0 0 0 1px rgba(255, 255, 255, 0.08), 0 0 120px rgba(102, 126, 234, 0.2);
    overflow: hidden;
    z-index: 20;
    flex-direction: column;
    will-change: transform, opacity;
    transition: transform 0.6s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.45s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.6s ease;
}

    #tiktokVideoCard.active {
        display: flex;
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
        box-shadow: 0 32px 80px rgba(0, 0, 0, 0.85), 0 0 0 1px rgba(255, 255, 255, 0.08), 0 0 100px rgba(102, 126, 234, 0.3);
    }

    #tiktokVideoCard.closing {
        display: flex;
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.75);
        box-shadow: 0 12px 32px rgba(0, 0, 0, 0.6);
        transition: transform 0.4s cubic-bezier(0.4, 0, 1, 1), opacity 0.35s cubic-bezier(0.4, 0, 1, 1), box-shadow 0.35s ease;
    }

/* ============================================================
   CARD HEADER
   ============================================================ */
.tiktok-video-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: linear-gradient(90deg, #0a0a0a 0%, #1a1a1a 100%);
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    flex-shrink: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    opacity: 0;
    transform: translateY(-10px);
    transition: opacity 0.4s cubic-bezier(0.22, 1, 0.36, 1) 0.25s, transform 0.4s cubic-bezier(0.22, 1, 0.36, 1) 0.25s;
}

#tiktokVideoCard.active .tiktok-video-card-header {
    opacity: 1;
    transform: translateY(0);
}

.tiktok-video-card-title {
    display: flex;
    align-items: center;
    gap: 6px;
}

#tiktokVideoLabel {
    max-width: 220px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tiktok-video-card-close {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    width: 26px;
    height: 26px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.22, 1, 0.36, 1);
    font-size: 12px;
}

    .tiktok-video-card-close:hover {
        background: rgba(255, 255, 255, 0.12);
        color: #fff;
        transform: rotate(90deg) scale(1.05);
    }

/* ============================================================
   CARD BODY
   ============================================================ */
.tiktok-video-card-body {
    position: relative;
    flex: 1;
    background: #000;
    overflow: hidden;
    min-height: 0;
}

#tiktokVideo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    opacity: 0;
    transform: scale(1.15);
    transition: opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1), transform 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}

    #tiktokVideo.video-ready {
        opacity: 1;
        transform: scale(1);
    }

/* ============================================================
   LOADER
   ============================================================ */
.tiktok-video-loader {
    position: absolute;
    inset: 0;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    background: rgba(0, 0, 0, 0.75);
    color: rgba(255, 255, 255, 0.85);
    font-size: 12px;
    letter-spacing: 0.5px;
    z-index: 2;
    opacity: 0;
    transition: opacity 0.3s ease;
}

    .tiktok-video-loader.active {
        display: flex;
        opacity: 1;
    }

    .tiktok-video-loader .spinner-border {
        border-width: 2px;
        width: 32px;
        height: 32px;
    }

/* ============================================================
   OVERLAY PLAY/PAUSE
   ============================================================ */
.tiktok-video-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 3;
    background: transparent;
    transition: background 0.25s ease;
}

    .tiktok-video-overlay:hover {
        background: rgba(0, 0, 0, 0.12);
    }

.tiktok-video-playbtn {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    border: 2px solid rgba(255, 255, 255, 0.9);
    color: #fff;
    font-size: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    transform: scale(0.6);
    transition: all 0.4s cubic-bezier(0.22, 1, 0.36, 1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 0;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.tiktok-video-overlay:hover .tiktok-video-playbtn {
    opacity: 1;
    transform: scale(1);
}

.tiktok-video-overlay.paused .tiktok-video-playbtn {
    opacity: 1;
    transform: scale(1);
}

.tiktok-video-playbtn:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: scale(1.08) !important;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
}

.tiktok-video-playbtn i {
    pointer-events: none;
    margin-left: 4px;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 600px) {
    #tiktokVideoCard {
        height: 95vh;
        border-radius: 0;
        max-height: 100vh;
        max-width: 100vw;
    }
}
