/* 1. Terapkan object-fit: cover untuk tampilan thumbnail video */
/* Gunakan .media-thumbnail-video untuk spesifisitas yang lebih baik */
.media-thumbnail-video {
    /* height dan width sudah diatur di style inline PHP, tapi object-fit ini penting */
    object-fit: cover !important; 
}

/* --- PERBAIKAN UTAMA UNTUK VIDEO LOKAL DI MOBILE --- */
/* Kebanyakan browser mobile akan membuka video lokal dalam mode fullscreen/tampilan default mereka. */
/* Gunakan object-fit: contain saat video memiliki atribut 'controls' dan dimainkan */
/* Karena object-fit: contain sudah didefinisikan di inline style PHP, 
/* kita akan fokus pada overide fullscreen yang sudah Anda buat: */

/* OVERRIDE object-fit: cover ketika video masuk ke mode fullscreen browser (sudah ada, tapi ini adalah cara terbaik) */

/* Untuk Chrome, Edge, Safari, Opera (webkit) */
.media-thumbnail-video:-webkit-full-screen,
.media-thumbnail-video:-webkit-full-screen-document { /* Tambahkan -webkit-full-screen-document untuk beberapa kasus mobile */
    object-fit: contain !important; /* Pastikan menggunakan 'contain' saat fullscreen/diputar */
}

/* Untuk Firefox (moz) */
.media-thumbnail-video:-moz-full-screen {
    object-fit: contain !important;
}

/* Untuk IE/Edge (ms) */
.media-thumbnail-video:-ms-fullscreen {
    object-fit: contain !important;
}

/* Standar W3C */
.media-thumbnail-video:fullscreen {
    object-fit: contain !important;
}

/* Catatan: Di mobile, ketika video di-play, object-fit: cover yang ada di inline style PHP seringkali diabaikan oleh browser player native dan beralih ke 'contain' secara otomatis, namun jika tidak, CSS fullscreen di atas akan memaksa contain. */

/* Modal Elegant Dark Theme */
.modal.fade .modal-dialog {
    transition: transform 0.3s ease-out, opacity 0.3s ease-out;
    transform: scale(0.8);
    opacity: 0;
}

.modal.show .modal-dialog {
    transform: scale(1);
    opacity: 1;
}

.modal-content {
    background: rgb(0 0 0 / 45%) !important;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
    animation: modalSlideIn 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

@keyframes modalSlideIn {
    0% {
        opacity: 0;
        transform: translateY(-50px) scale(0.9);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-header {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border-radius: 12px 12px 0 0;
    padding: 1rem 1.5rem;
}

.modal-title {
    color: #ffffff;
    font-weight: 600;
    font-size: 1.25rem;
}

.modal-body {
    padding: 2rem;
    background: transparent;
}

.btn-close {
    filter: invert(1);
    opacity: 0.8;
    transition: all 0.3s ease;
}

.btn-close:hover {
    opacity: 1;
    transform: scale(1.1);
}

/* Fullscreen modal */
.modal-dialog.modal-fullscreen {
    max-width: none;
    margin: 0;
}

.modal-dialog.modal-fullscreen .modal-content {
    min-height: 100vh;
    border-radius: 0;
    border: none;
}

/* Image styling in modal */
.modal-body img.img-fluid {
    max-height: 80vh;
    width: auto;
    max-width: 100%;
    border-radius: 8px;
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.3);
    animation: imageZoomIn 0.5s ease-out 0.2s both;
}

@keyframes imageZoomIn {
    0% {
        opacity: 0;
        transform: scale(0.95);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}