/*
 * File: style.css
 * Deskripsi: CSS LENGKAP untuk Aplikasi Perpustakaan Digital (User & Admin) - FINAL STABLE
 */

/* --- GLOBAL STYLES & FONT DEFINITION --- */
:root {
    --color-primary: #2250fc;
    --color-secondary: #0056b3;
    --color-success: #28a745;
    --color-danger: #dc3545;
    --color-warning: #ffc107;
    --color-info: #17a2b8;
    --color-gray-soft: #9aa0a6;
    --color-gray-dark: #2e2e2e;
    --color-light: #fbfbfb;
    --color-white: #fff;
    --font-family-base: "Poppins", sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-family-base, 'Arial', sans-serif);
    line-height: 1.6;
    color: #3c4043;
    background-color: #f8f9fa;
    -webkit-font-smoothing: antialiased;
}

/* --- UTILITIES & ALERTS --- */
a { color: var(--color-primary); text-decoration: none; transition: color 0.3s; }
a:hover { color: var(--color-secondary); }
.alert-error, .error { 
    color: #842029; 
    background-color: #f8d7da; 
    border: 1px solid #f5c6cb; 
    padding: 10px; 
    border-radius: 4px; 
    margin-top: 15px; 
}
.alert-warning {
    background-color: #fff3cd;
    color: #664d03;
    border: 1px solid #ffecb5;
}


/* ================================================= */
/* --- USER LAYOUT (INDEX & BUKU) STYLES --- */
/* ================================================= */

/* --- LAYOUT & FOOTER --- */
html { height: 100%; }
body:not(.admin-page) { min-height: 100vh; display: flex; flex-direction: column; }
#wrapper { display: flex; flex-direction: column; min-height: 100%; flex-grow: 1; }
.main-content { flex-grow: 1; max-width: 1200px; width: 100%; margin: 20px auto; padding: 0 20px; }

/* Footer Grid untuk Tampilan Kolom */
.user-footer { background-color: #333; color: #f4f4f4; padding: 40px 0 10px; text-align: center; flex-shrink: 0; margin-top: 40px; }
.footer-content { max-width: 1200px; margin: 0 auto; padding: 0 15px; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 2fr; gap: 30px; padding-bottom: 30px; text-align: left; }
.footer-col h4 { color: var(--color-warning); margin-bottom: 15px; font-size: 1.1em; font-weight: 600; }
.footer-col p { font-size: 0.9em; margin-bottom: 10px; line-height: 1.5; }
.footer-col i { margin-right: 8px; color: #ccc; }
.footer-col ul { list-style: none; padding: 0; }
.footer-col ul li a { color: #ccc; font-size: 0.9em; text-decoration: none; display: block; padding: 5px 0; transition: color 0.2s; }
.footer-col ul li a:hover { color: var(--color-white); }
.footer-copyright { border-top: 1px solid #444; padding: 15px 0 5px; margin-top: 10px; font-size: 0.8em; color: #ccc; text-align: center; }


/* --- NAVBAR & HERO (BARU) --- */
.navbar { background-color: var(--color-primary); padding: 15px 30px; color: var(--color-white); display: flex; justify-content: space-between; align-items: center; box-shadow: 0 2px 4px rgba(0,0,0,0.1); }
.navbar .logo a { color: var(--color-white); font-size: 1.5em; font-weight: bold; text-decoration: none; }
.navbar .nav-links a { color: var(--color-white); text-decoration: none; padding: 8px 15px; border-radius: 4px; margin-left: 10px; transition: background-color 0.3s; }
.navbar .nav-links a:hover, .navbar .nav-links a.active { background-color: #0056b3; }

/* Tombol Toggle (Sembunyikan di Desktop) */
.menu-toggle-btn {
    display: none;
    background: none;
    border: none;
    color: var(--color-white);
    font-size: 1.5em;
    cursor: pointer;
}

.hero-budi { background: url('../img/hero_bg.jpg') no-repeat center center; background-size: cover; position: relative; padding: 80px 20px; margin-bottom: 50px; border-radius: 0; color: var(--color-white); overflow: hidden; }
.hero-budi::before { content: ""; position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0, 0, 0, 0.5); z-index: 1; }
.hero-content { max-width: 1200px; margin: 0 auto; color: var(--color-white); position: relative; z-index: 2; padding: 0 20px; }

/* 1. HERO GRID (Desktop 2 Kolom) */
.hero-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 40px; align-items: center; text-align: left; }
.hero-text { padding-right: 20px; }
.hero-budi h1 { font-size: 2.8em; font-weight: bold; margin-bottom: 15px; line-height: 1.2; }
.hero-budi p { font-size: 1.2em; margin-bottom: 30px; }

/* 2. SEARCH CARD BARU (Mirip Kemendikbud) */
.hero-search-card { background-color: var(--color-white); padding: 25px; border-radius: 8px; box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2); text-align: left; color: #333; }
.hero-search-card .search-card-title { color: var(--color-primary); font-size: 1.4em; margin-bottom: 20px; text-align: center; font-weight: 600; }
.search-filter-row { display: flex; flex-wrap: wrap; gap: 15px; margin-bottom: 10px; }
.search-filter-row .filter-group { flex: 1 1 45%; }
.search-filter-row .filter-group.full-width { flex: 1 1 100%; }
.hero-search-card label { font-size: 0.9em; font-weight: bold; color: #555; margin-bottom: 5px; display: block; }
.hero-search-card select, .hero-search-card input.form-control { width: 100%; padding: 10px; border: 2px solid #ccc; border-radius: 4px; box-sizing: border-box; }
.btn-search-hero { width: 100%; padding: 12px; margin-top: 15px; background-color: var(--color-success); color: var(--color-white); border: none; border-radius: 4px; font-weight: bold; cursor: pointer; transition: background-color 0.3s; }
.btn-search-hero:hover { background-color: #1e8736; }


/* --- BOOK GRID & LINKS (Kemendikbud Style) --- */
.book-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 25px; margin-top: 20px; }
.book-item { 
    background-color: var(--color-white); 
    border: 1px solid var(--color-light); 
    border-radius: 8px; 
    text-align: center; 
    padding: 15px; 
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05); 
    transition: transform 0.3s ease, box-shadow 0.3s ease; 
    overflow: hidden; 
}
.book-item:hover { 
    transform: translateY(-8px); 
    box-shadow: 0 12px 20px rgba(0, 0, 0, 0.1); 
    border-color: #e0e0e0; 
}

/* Gambar Cover Ebook (Default) */
.book-item:not(.video-card-item) .book-cover-img { 
    width: 100%; 
    height: 220px; /* Tinggi sedikit ditingkatkan */
    object-fit: cover; 
    border-radius: 4px; 
    margin-bottom: 12px; 
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1); 
}

.book-item h4 { font-size: 1.0em; height: 45px; line-height: 1.25; color: var(--color-gray-dark); overflow: hidden; font-weight: 600; }
.book-item p { font-size: 0.85em; color: var(--color-gray-soft); margin: 0; }
.book-section h2 { text-align: center; font-size: 2em; color: #444; margin-bottom: 15px; }
.book-section hr { max-width: 800px; margin: 15px auto 40px auto; border: 0; border-top: 1px solid #eee; }

/* Tombol Baca Ebook */
.book-link { display: block; width: 100%; padding: 10px 12px; border-radius: 6px; font-size: 1em; font-weight: 500; text-align: center; background-color: var(--color-primary); color: var(--color-white); margin-top: 15px; transition: background-color 0.3s, transform 0.1s; }
.book-link:hover { background-color: #1a3cb2; transform: translateY(-1px); }

/* --- RESPONSIVE FILTER CONTROLS (Tampilan Buku.php & Video.php) --- */
.filter-controls-wrapper { 
    text-align: center; 
    margin-bottom: 30px; 
    /* Styling untuk kotak pencarian agar lebih menonjol */
    background: var(--color-white); 
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

/* Perbaikan layout pencarian agar lebih rapi (Desktop) */
.filter-form { 
    display: flex; 
    justify-content: center; 
    gap: 15px; 
    align-items: flex-end; 
    max-width: 900px; 
    margin: 0 auto;
}
.filter-group { 
    text-align: left; 
    flex-grow: 1; 
}
.filter-group label { display: block; font-weight: bold; margin-bottom: 5px; font-size: 0.9em; color: #555; }
.filter-group input.form-control, .filter-group select { 
    width: 100%; 
    padding: 10px; 
    border: 1px solid #ccc; 
    border-radius: 4px; 
    box-sizing: border-box; 
}

/* 💡 Kelas Toggle untuk Mobile */
.toggle-button-mobile { 
    display: none; 
    margin: 0 auto; 
    width: 200px; /* Lebar tombol filter */
}
/* Di desktop, filter area tampil normal */
#filter-dropdown-area {
    display: block; 
}


/* ================================================= */
/* --- FLOATING WHATSAPP BUTTON --- */
/* ================================================= */
.floating-whatsapp-btn {
    position: fixed; 
    width: 60px;
    height: 60px;
    bottom: 20px;
    right: 20px;
    background-color: #25d366; 
    color: var(--color-white);
    border-radius: 50px;
    text-align: center;
    font-size: 30px;
    box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.4);
    z-index: 1000; 
    display: flex;
    justify-content: center;
    align-items: center;
    transition: background-color 0.3s, transform 0.2s;
}

.floating-whatsapp-btn:hover {
    background-color: #128c7e;
    transform: scale(1.05);
}


/* ======================================= */
/* --- PDF.JS PAGE-TURNING VIEWER STYLES --- */
/* ======================================= */

.viewer-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 95%;
    max-width: 900px; /* Lebar maksimal tampilan buku */
    height: 70vh; /* Tinggi viewport untuk pembacaan */
    margin: 20px auto;
    position: relative;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    overflow: hidden; 
    background-color: #e5e5e5; 
}

/* Container untuk Canvas (pusat tampilan) */
#canvas-container {
    display: flex;
    justify-content: center;
    align-items: center;
    max-width: 100%;
    max-height: 100%;
    overflow: hidden;
}

/* Elemen Canvas (halaman buku) */
#pdf-canvas {
    max-width: 100%;
    height: auto;
    display: block;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    /* Animasi Slide */
    transition: transform 0.3s ease-out; 
    transform: translateX(0); 
}

/* Kelas untuk efek geser */
.slide-in {
    /* Simulasi pergerakan saat halaman berpindah */
    animation: slide-in-anim 0.3s ease-out;
}

@keyframes slide-in-anim {
    0% { transform: translateX(20px); opacity: 0.8; }
    100% { transform: translateX(0); opacity: 1; }
}

/* Tombol Navigasi (kiri & kanan) */
.nav-control {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 50px;
    background: rgba(0, 0, 0, 0.1);
    color: white;
    font-size: 1.5rem;
    border: none;
    cursor: pointer;
    z-index: 10;
    transition: background-color 0.2s;
}

.nav-control:hover:not(:disabled) {
    background: rgba(0, 0, 0, 0.3);
}

.nav-control.left {
    left: 0;
    border-top-left-radius: 8px;
    border-bottom-left-radius: 8px;
}

.nav-control.right {
    right: 0;
    border-top-right-radius: 8px;
    border-bottom-right-radius: 8px;
}

.nav-control:disabled {
    cursor: not-allowed;
    opacity: 0.5;
}

/* Kontrol Bawah (Info dan Tombol Download) */
.viewer-controls-bottom {
    text-align: center;
    margin-top: 20px;
    padding-bottom: 20px;
}

.page-info {
    font-size: 1.2em;
    font-weight: 600;
    color: #333;
}

/* ================================================= */
/* --- ADMIN LAYOUT (SIDEBAR) STYLES --- */
/* ================================================= */

/* 1. Admin Body Structure & Sidebar */
body.admin-page { margin: 0; min-height: 100vh; display: flex; flex-direction: row; }
#admin-wrapper { display: flex; flex-grow: 1; width: 100%; flex-direction: row; }
#sidebar { width: 250px; background-color: #2c3e50; color: var(--color-white); box-shadow: 2px 0 5px rgba(0,0,0,0.1); padding-top: 20px; flex-shrink: 0; min-height: 100vh; position: relative; transform: translateX(0); transition: transform 0.3s ease-out; }
#sidebar.active { transform: translateX(0) !important; }
.sidebar-brand { text-align: center; padding: 10px 0; margin-bottom: 20px; }
.sidebar-brand h3 { color: var(--color-white); }
.sidebar-menu a { padding: 15px 20px; text-decoration: none; color: #ecf0f1; display: block; border-left: 5px solid transparent; transition: background-color 0.3s; }
.sidebar-menu a:hover { background-color: #34495e; }
.sidebar-menu a.active { background-color: #3498db; border-left: 5px solid #3498db; }

/* 2. Main Panel & Content */
#main-panel { flex-grow: 1; display: flex; flex-direction: column; background-color: #f4f4f9; }
.admin-header-bar { background-color: var(--color-white); padding: 15px 20px; box-shadow: 0 1px 4px rgba(0,0,0,0.05); display: flex; justify-content: space-between; align-items: center; }
.admin-content-area { padding: 20px; flex-grow: 1; }
.admin-container { background: var(--color-white); padding: 20px; border-radius: 8px; box-shadow: 0 0 10px rgba(0,0,0,0.1); width: 100%; }

/* 3. Dashboard Boxes */
.dashboard-boxes { display: flex; gap: 20px; margin-bottom: 30px; width: 100%; }
.box { flex: 1; padding: 20px; border-radius: 8px; color: var(--color-white); text-align: center; box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1); }
.box-buku { background-color: var(--color-success); }
.box-kategori { background-color: var(--color-warning); }
.box-pengunjung { background-color: var(--color-primary); } 
.box h2 { margin: 0 0 5px 0; font-size: 2.5em; }
.box p { margin: 0; font-size: 1.1em; }

/* 4. Footer Admin */
.admin-footer-sticky { width: 100%; background-color: #f0f0f0; box-shadow: 0 -1px 4px rgba(0,0,0,0.05); flex-shrink: 0; }
.admin-footer-bar { padding: 10px 20px; text-align: center; font-size: 0.9em; color: #555; }

/* 5. Tombol Menu Toggle */
.menu-toggle { background: none; border: none; color: var(--color-white); font-size: 1.5em; cursor: pointer; padding: 10px 15px; margin: 5px; border-radius: 4px; display: none; }
#open-sidebar { background-color: #007bff; color: var(--color-white); font-size: 1em; padding: 8px 15px; }
#close-sidebar { position: absolute; top: 5px; right: 5px; font-size: 1.5em; color: var(--color-white); }

/* --- FORMS (ADMIN/LOGIN) --- */
.form-group label, .form-tambah label { display: block; margin-top: 10px; font-weight: bold; }
.form-group input, .form-tambah input, .form-tambah select, .form-tambah textarea { width: 100%; padding: 10px; margin-top: 5px; border: 1px solid #ccc; border-radius: 4px; box-sizing: border-box; }
.btn-login { width: 100%; padding: 12px; background-color: var(--color-success); color: var(--color-white); border: none; border-radius: 6px; cursor: pointer; font-size: 1.1em; font-weight: bold; margin-top: 10px; transition: background-color 0.3s; }
.btn-login:hover { background-color: #218838; }


/* ================================================= */
/* --- RESPONSIVENESS (MOBILE) --- */
/* ================================================= */

/* --- LAYAR DESKTOP LEBAR (Min-Width 1201px) --- */
.book-grid { 
    grid-template-columns: repeat(6, 1fr); 
}

/* --- LAYAR LAPTOP/TABLET LEBAR (Max Width 1200px) --- */
@media (max-width: 1200px) {
    .book-grid {
        grid-template-columns: repeat(5, 1fr);
        gap: 15px;
    }
}

/* --- LAYAR TABLET (Max Width 992px) --- */
@media (max-width: 992px) {
    /* Hero Grid tumpuk vertikal */
    .hero-grid {
        grid-template-columns: 1fr;
        gap: 30px;
        text-align: center;
    }
    .hero-text {
        padding-right: 0;
    }
    .book-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 15px;
    }

    /* Footer Grid tumpuk vertikal */
    .footer-grid {
        grid-template-columns: 1fr;
        padding: 20px;
        text-align: center;
    }
    .footer-col {
        margin-bottom: 20px;
    }
    .footer-col h4 {
        margin-top: 10px;
    }
}

/* --- LAYAR MOBILE STANDAR (Max Width 768px) */
@media (max-width: 768px) {
    /* USER LAYOUT */
    .navbar { 
        flex-direction: row; 
        align-items: center; 
        justify-content: space-between; 
        padding: 15px 15px; 
    }
    
    /* 💡 Tampilkan Tombol Filter di Mobile */
    .toggle-button-mobile {
        display: block; 
        margin: 0 auto 15px auto; /* Tengah dan ada margin bawah */
    }
    #filter-dropdown-area {
        /* Sembunyikan filter secara default di mobile */
        display: none; 
        padding: 15px;
        margin-bottom: 15px;
        background-color: #f9f9f9;
        border: 1px solid #eee;
        border-radius: 6px;
        max-width: 400px;
        margin-left: auto;
        margin-right: auto;
    }
    #filter-dropdown-area.active {
        /* Tampilkan filter saat tombol ditekan */
        display: block;
    }
    /* Pastikan Form di dalam dropdown menumpuk vertikal */
    #filter-dropdown-area .filter-form {
        flex-direction: column;
        gap: 10px;
        max-width: none;
    }
    #filter-dropdown-area .filter-group {
        width: 100%;
    }

    /* NAVIGASI MOBILE */
    .menu-toggle-btn {
        display: block; 
    }
    .navbar .nav-links {
        display: none; 
        position: absolute;
        top: 55px; 
        left: 0;
        width: 100%;
        background-color: var(--color-primary); 
        box-shadow: 0 4px 5px rgba(0, 0, 0, 0.1);
        padding: 10px 0;
        flex-direction: column; 
        z-index: 999;
    }
    .navbar .nav-links.active {
        display: flex;
    }
    .navbar .nav-links a {
        display: block;
        text-align: center;
        padding: 10px 20px;
        margin: 0; 
        border-radius: 0;
        font-size: 1.1em;
        border-left: 5px solid transparent; 
    }
    .navbar .nav-links a.active {
        background-color: #0056b3;
        border-left: 5px solid var(--color-warning);
    }
    
    .hero-budi h1 { font-size: 2em; }
    .hero-grid {
        grid-template-columns: 1fr;
        gap: 30px;
        text-align: center;
    }
    .hero-text {
        padding-right: 0;
    }
    
    .book-grid { 
        grid-template-columns: repeat(2, 1fr); 
        gap: 10px;
    }
    
    /* ADMIN LAYOUT MOBILE FIXES */
    body.admin-page { flex-direction: column; } 
    #admin-wrapper { flex-direction: column; }
    #sidebar { position: fixed; left: 0; top: 0; z-index: 1000; height: 100%; width: 250px; transform: translateX(-100%); box-shadow: 4px 0 10px rgba(0,0,0,0.5); }
    .dashboard-boxes { flex-direction: column; }
    
    /* FLOATING WHATSAPP FIX */
    .floating-whatsapp-btn {
        width: 50px;
        height: 50px;
        font-size: 25px;
        bottom: 15px;
        right: 15px;
    }

    /* Responsif Mobile: Navigasi Control Viewer lebih kecil dan transparan */
    .viewer-wrapper {
        height: 80vh; 
    }
    .nav-control {
        width: 40px;
        font-size: 1.2rem;
        background: rgba(0, 0, 0, 0.05); 
    }
}

/* --- LAYAR MOBILE SEMPIT (Max Width 480px) --- */
@media (max-width: 480px) {
    .book-grid {
        /* Tampilan mobile sangat sempit: 1 kolom */
        grid-template-columns: 1fr;
        gap: 10px;
    }
    /* Filter form sudah diatasi di 768px, ini memastikan tombol search/reset juga full-width */
    .filter-group .btn-search-hero {
        width: 100%; 
        margin-top: 5px !important;
    }
    .filter-group .btn-search-hero:not(:first-child) {
        margin-top: 10px !important;
    }
}

/* ================================================= */
/* --- GLOBAL STYLES (Video Viewer & Pagination) --- */
/* ================================================= */

/* --- VIDEO NATIVE VIEWER STYLES (16:9) --- */
.video-native-container {
    display: flex;
    justify-content: center;
    margin: 20px auto;
    max-width: 900px; /* Batasi lebar maksimum video */
    width: 95%; /* Pastikan responsif pada layar besar */
}

/* Teknik untuk membuat iframe YouTube responsif dan menjaga rasio 16:9 */
.video-responsive {
    position: relative;
    width: 100%;
    /* padding-bottom = (Tinggi / Lebar * 100). Untuk 16:9 -> (9 / 16 * 100) = 56.25% */
    padding-bottom: 56.25%; 
    height: 0;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0,0,0,0.15); /* Bayangan yang bagus */
    border-radius: 8px;
}

.video-responsive iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.viewer-controls-bottom-video {
    text-align: center;
    margin-top: 20px;
    padding-bottom: 20px;
}

/* --- PAGINATION STYLES --- */
.pagination {
    text-align: center;
    margin-top: 30px;
    padding: 10px 0;
}
.pagination a {
    display: inline-block;
    padding: 8px 15px;
    margin: 0 4px;
    border: 1px solid #ddd;
    border-radius: 4px;
    text-decoration: none;
    color: var(--color-primary);
    transition: background-color 0.3s, color 0.3s;
}
.pagination a.active {
    background-color: var(--color-primary);
    color: var(--color-white);
    border-color: var(--color-primary);
}
.pagination a:hover:not(.active) {
    background-color: #f0f0f0;
}

/* ================================================= */
/* --- PERBAIKAN STYLING KHUSUS ADMIN & VIDEO LIST --- */
/* ================================================= */

/* --- Styling untuk admin/video.php dan admin/buku.php (Yang Lebih Menarik) --- */
.card-controls {
    background-color: var(--color-white);
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.search-form-inline {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
}

.input-group {
    display: flex;
}

.form-control-inline {
    padding: 8px 12px;
    border: 1px solid #ccc;
    border-right: none;
    border-radius: 4px 0 0 4px;
    width: 300px; /* Lebar input */
    transition: border-color 0.3s;
}

.form-control-inline:focus {
    border-color: var(--color-primary);
    outline: none;
}

.input-group .btn-info {
    border-radius: 0 4px 4px 0;
    padding: 8px 15px;
}

.mt-30 {
    margin-top: 30px;
}

.judul-column a {
    font-weight: 600;
    color: var(--color-primary);
    text-decoration: underline;
}

/* Responsif untuk tablet/mobile (Admin) */
@media (max-width: 768px) {
    .card-controls {
        flex-direction: column;
        align-items: flex-start;
    }
    .search-form-inline {
        width: 100%;
        flex-wrap: wrap;
        margin-top: 15px;
    }
    .input-group {
        flex-grow: 1;
    }
    .form-control-inline {
        width: 100%;
    }
}

/* --- Styling Khusus untuk Card Video (video.php) --- */
.video-card-item {
    border: 1px solid #e0e0e0;
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.1);
}

.video-thumbnail-container {
    width: 100%;
    padding-bottom: 56.25%; 
    height: 0;
    position: relative;
    overflow: hidden;
    margin-bottom: 12px;
}

.video-thumbnail-container .book-cover-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.video-card-item p {
    font-size: 0.9em;
    color: var(--color-gray-soft);
    margin: 5px 0 10px 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.video-card-item p i {
    margin-right: 5px;
    color: var(--color-danger);
}


/* ================================================= */
/* --- TABLE RESPONSIVE ADMIN (Stacking Table) --- */
/* ================================================= */

.data-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
}
.data-table th, .data-table td {
    border: 1px solid #ddd;
    padding: 8px;
    text-align: left;
    vertical-align: middle;
    font-size: 0.9em;
}
.data-table th {
    background-color: #f2f2f2;
}

/* Kebutuhan untuk tombol aksi agar terlihat rapi */
.action-mobile-row {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
    justify-content: flex-start;
}
.action-mobile-row .btn {
    flex-basis: auto; 
    white-space: nowrap;
}

@media only screen and (max-width: 768px) {
    
    /* 1. Sembunyikan Header Tabel di Mobile */
    .admin-buku-table thead, .admin-buku-table .td-hide-mobile {
        display: none;
    }
    
    /* 2. Jadikan Baris Tabel Berperilaku Seperti Blok */
    .admin-buku-table, .admin-buku-table tbody, .admin-buku-table tr, .admin-buku-table td {
        display: block;
        width: 100%;
    }
    
    .admin-buku-table tr {
        margin-bottom: 15px;
        border: 1px solid #ccc;
        border-radius: 8px;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
        padding: 5px; 
    }
    
    /* 3. Gaya Sel Data (td) */
    .admin-buku-table td {
        text-align: right; 
        padding-left: 50%; 
        position: relative;
        border: none; 
        padding-top: 10px;
        padding-bottom: 10px;
    }
    
    /* 4. Tampilkan Label Data (dari data-label attribute) */
    .admin-buku-table td::before {
        content: attr(data-label);
        position: absolute;
        left: 15px;
        width: calc(50% - 30px);
        padding-right: 10px;
        white-space: nowrap;
        text-align: left;
        font-weight: bold;
        color: var(--color-gray-dark);
    }

    /* 5. Kolom Aksi Khusus */
    .admin-buku-table .td-action {
        text-align: left !important;
        padding-left: 15px; 
        background-color: #f9f9f9;
        border-top: 1px solid #ddd;
        padding-top: 15px;
        padding-bottom: 15px;
    }
    
    .admin-buku-table .action-mobile-row {
        display: flex;
        flex-direction: column;
        gap: 10px;
        width: 100%;
    }
    
    .admin-buku-table .action-mobile-row .btn {
        width: 100%; 
        text-align: center;
        padding: 10px 0;
        margin: 0 !important;
    }
    
    /* Perbaikan visual untuk kolom Judul (agar terlihat menonjol) */
    .admin-buku-table td[data-label="Judul"] {
        font-size: 1.1em;
        font-weight: bold;
        color: var(--color-primary);
        padding-top: 15px;
    }
    
    /* Sembunyikan Cover di Mobile */
    .admin-buku-table .td-cover {
        display: none !important;
    }
}