/* Preview inline lampiran submission assignment (akubisa.id)
   ------------------------------------------------------------------
   Ukuran thumbnail gambar: dibatasi max-height 60vh (sekitar 60% tinggi
   layar). Cukup besar untuk membaca isi pekerjaan siswa tanpa mengunduh,
   tetapi tidak mendominasi halaman. Ubah nilai max-height bila perlu
   lebih besar/kecil. Klik gambar -> lightbox layar penuh.

   PDF tidak di-preview otomatis (jumlahnya banyak). Untuk PDF disediakan
   tombol "Pratinjau" yang memuat berkas sesuai permintaan.
   ------------------------------------------------------------------ */

/* ---------- Pratinjau gambar ---------- */

.akb-img-preview {
    margin: 8px 0 12px;
    clear: both;
}

.akb-img-thumb {
    display: block;
    max-width: 100%;
    max-height: 60vh;
    width: auto;
    height: auto;
    border: 1px solid #cfd8dc;
    border-radius: 6px;
    background: #f5f7f8;
    cursor: zoom-in;
    transition: box-shadow .15s ease;
}

.akb-img-thumb:hover {
    box-shadow: 0 2px 10px rgba(0, 0, 0, .25);
}

/* ---------- Tombol pratinjau PDF ---------- */

.akb-pdf-preview {
    margin: 4px 0 8px;
    clear: both;
}

.akb-pdf-btn {
    display: inline-block;
    padding: 4px 12px;
    font-size: .85rem;
    line-height: 1.4;
    color: #fff;
    background: #0f6cbf;
    border: 1px solid #0f6cbf;
    border-radius: 4px;
    cursor: pointer;
}

.akb-pdf-btn:hover {
    background: #0b5394;
    border-color: #0b5394;
}

.akb-pdf-btn[disabled] {
    opacity: .6;
    cursor: progress;
}

/* ---------- Lightbox ---------- */

#akb-lightbox {
    display: none;
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    background: rgba(0, 0, 0, .88);
    z-index: 100000;
    padding: 16px;
    cursor: zoom-out;
    text-align: center;
}

#akb-lightbox.akb-open {
    display: flex;
    align-items: center;
    justify-content: center;
}

#akb-lightbox-body {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

#akb-lightbox-body img {
    max-width: 98vw;
    max-height: 92vh;
    width: auto;
    height: auto;
    background: #fff;
    box-shadow: 0 0 24px rgba(0, 0, 0, .6);
    cursor: default;
}

.akb-lb-frame {
    width: 96vw;
    height: 92vh;
    border: 0;
    background: #fff;
    box-shadow: 0 0 24px rgba(0, 0, 0, .6);
    cursor: default;
}

#akb-lightbox .akb-lb-close {
    position: absolute;
    top: 8px;
    right: 20px;
    z-index: 2;
    color: #fff;
    font-size: 40px;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    user-select: none;
}

#akb-lightbox .akb-lb-loading,
#akb-lightbox .akb-lb-error {
    color: #fff;
    font-size: 1.1rem;
    line-height: 1.6;
    cursor: default;
    padding: 24px;
}

#akb-lightbox .akb-lb-error a {
    color: #8ecbff;
}
