/**
 * CSC Library - Frontend Custom Styles
 */

/* Anti-CLS cho khung quảng cáo */
.csc-ad-placeholder {
    background-color: #f8fafc;
    border: 1px dashed #cbd5e1;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    overflow: hidden;
}

/* Bo góc chuẩn */
.radius-md {
    border-radius: 8px !important;
}

/* Line clamp 2 dòng cho tiêu đề sách */
.csc-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    min-height: 2.7em;
}

/* ==========================================================
   CARD SÁCH PHẲNG MINIMALIST (Tối ưu bo góc & Padding thoáng)
   ========================================================== */
.csc-flat-book-card {
    border: 1px solid #e2e8f0 !important;
    border-radius: 8px !important;
    overflow: hidden !important;
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
    background: #ffffff !important;
}

.csc-flat-book-card:hover {
    border-color: #cbd5e1 !important;
    transform: translateY(-3px);
    box-shadow: 0 12px 20px -5px rgba(0, 0, 0, 0.08) !important;
}

/* Định dạng chuẩn tỷ lệ dọc đứng (Book Aspect Ratio 1:1.4) cho tất cả bìa sách (Hỗ trợ cấu hình box-image height) */
.csc-flat-book-card .box-image {
    position: relative !important;
    width: 100% !important;
    padding-top: var(--csc-box-image-padding, 140%) !important;
    /* Chuẩn tỷ lệ đứng 1 : 1.4 của bìa sách hoặc chiều cao px cấu hình */
    height: var(--csc-box-image-height, 0px) !important;
    background: #f8fafc;
    overflow: hidden !important;
    border-top-left-radius: 8px !important;
    border-top-right-radius: 8px !important;
}

.csc-flat-book-card .box-image a {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    display: block !important;
}

.csc-flat-book-card .box-image img,
.csc-flat-book-card .box-image .csc-cover-img {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    object-position: center !important;
}

/* Tăng padding thoáng đãng cho phần nội dung card, không dính viền */
.csc-book-card-body {
    padding: 16px 18px !important;
    background: #ffffff !important;
    border-bottom-left-radius: 8px;
    border-bottom-right-radius: 8px;
}

/* ==========================================================
   BẢNG THÔNG SỐ SÁCH TRANG CHI TIẾT (csc-spec-grid & Cột Trái)
   ========================================================== */
.csc-book-sidebar-card {
    padding: 0 !important;
    background: #ffffff !important;
    border-radius: 8px !important;
    overflow: visible !important;
    /* Cho phép cửa sổ zoom flyout bung ra ngoài */
    position: relative;
}

.csc-book-sidebar-card .csc-book-cover {
    margin: 0 !important;
    padding: 0 !important;
    background: #f8fafc;
    position: relative;
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
    overflow: visible !important;
    /* Không cắt mất cửa sổ zoom */
}

.csc-book-sidebar-card .csc-book-cover img {
    display: block !important;
    width: 100% !important;
    height: auto !important;
    margin: 0 auto !important;
    border: none !important;
    border-radius: 0 !important;
}

.csc-spec-grid {
    border-top: 1px solid #f1f5f9;
    padding: 20px 22px 16px 22px !important;
    background: #ffffff !important;
    font-size: 13px;
}


@media (max-width: 550px) {
    .csc-single-main-card {
        padding: 18px 16px !important;
    }
}

/* ==========================================================
   HEADER / TOOLBAR ĐẦU DANH SÁCH SÁCH (Cột Phải)
   ========================================================== */
.csc-archive-header-box {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    flex-wrap: wrap !important;
    width: 100% !important;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 10px 16px !important;
    margin-bottom: 20px !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
    gap: 12px;
}

.csc-archive-counter-text {
    font-size: 13px;
    color: #64748b;
}

#csc-sort-select {
    padding-right: 28px !important;
    cursor: pointer;
    background-color: #f8fafc !important;
    border-color: #e2e8f0 !important;
    transition: border-color 0.15s ease;
}

#csc-sort-select:hover,
#csc-sort-select:focus {
    border-color: #cbd5e1 !important;
    background-color: #ffffff !important;
}

/* ==========================================================
   VIEW SWITCHER (1 Nút chuyển trạng thái Grid / List)
   ========================================================== */
.csc-toggle-btn {
    width: 38px;
    height: 38px;
    padding: 0;
    margin: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    color: #475569;
    cursor: pointer;
    transition: all 0.2s ease;
}

.csc-toggle-btn:hover {
    background: #ffffff;
    border-color: #cbd5e1;
    color: #0f172a;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.csc-toggle-btn svg {
    display: block;
}

/* ==========================================================
   GIAO DIỆN DANH SÁCH (LIST VIEW): CỘT TRÁI ẢNH BÌA, CỘT PHẢI NỘI DUNG
   ========================================================== */
#csc-books-container.csc-list-view .csc-book-col {
    flex-basis: 100% !important;
    max-width: 100% !important;
    width: 100% !important;
}

#csc-books-container.csc-list-view .csc-flat-book-card {
    display: flex !important;
    flex-direction: row !important;
    align-items: stretch !important;
    min-height: 150px;
}

#csc-books-container.csc-list-view .box-image {
    width: 140px !important;
    min-width: 140px !important;
    max-width: 140px !important;
    height: auto !important;
    padding-top: 0 !important;
    position: relative !important;
    border-top-left-radius: 8px !important;
    border-bottom-left-radius: 8px !important;
    border-top-right-radius: 0 !important;
    border-bottom-right-radius: 0 !important;
    overflow: hidden !important;
    align-self: stretch !important;
}

#csc-books-container.csc-list-view .box-image a {
    display: block !important;
    width: 100% !important;
    height: 100% !important;
    position: absolute !important;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
}

#csc-books-container.csc-list-view .box-image img {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
}

#csc-books-container.csc-list-view .csc-book-card-body {
    flex: 1 1 auto !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: space-between !important;
    padding: 18px 24px !important;
    border-top-right-radius: 8px !important;
    border-bottom-right-radius: 8px !important;
    border-bottom-left-radius: 0 !important;
}

@media (max-width: 550px) {
    #csc-books-container.csc-list-view .box-image {
        width: 100px !important;
        min-width: 100px !important;
        max-width: 100px !important;
    }

    #csc-books-container.csc-list-view .csc-book-card-body {
        padding: 12px 14px !important;
    }
}

/* Hỗ trợ hiển thị 5 cột trên PC cho Flatsome (.col.large-2p4) */
@media (min-width: 850px) {
    .row .col.large-2p4 {
        flex-basis: 20% !important;
        max-width: 20% !important;
    }
}

/* Ô quảng cáo xen kẽ in-feed giữa danh sách sách */
.csc-infeed-ad-col {
    width: 100% !important;
    flex-basis: 100% !important;
    max-width: 100% !important;
}

/* ==========================================================
   PHÂN TRANG KHO SÁCH (CSC PAGINATION) - NATIVE & FLATSOME COMPATIBLE
   Triệt tiêu hoàn toàn dấu bullet chấm tròn, bo góc hiện đại, căn chỉnh chuẩn
   ========================================================== */
.csc-pagination-wrap {
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    width: 100% !important;
    margin-top: 32px !important;
    margin-bottom: 24px !important;
    clear: both !important;
    text-align: center !important;
}

.csc-pagination-wrap.text-left {
    justify-content: flex-start !important;
    text-align: left !important;
}

.csc-pagination-wrap.text-right {
    justify-content: flex-end !important;
    text-align: right !important;
}

.csc-pagination-wrap.text-center {
    justify-content: center !important;
    text-align: center !important;
}

ul.csc-pagination-list,
.csc-pagination-wrap ul.page-numbers,
.csc-pagination-wrap ul.nav-pagination {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: wrap !important;
    justify-content: center !important;
    align-items: center !important;
    list-style: none !important;
    list-style-type: none !important;
    margin: 0 auto !important;
    padding: 0 !important;
    gap: 8px !important;
    border: none !important;
    background: transparent !important;
    width: auto !important;
}

.csc-pagination-wrap.text-center ul.csc-pagination-list,
.csc-pagination-wrap.text-center ul.page-numbers,
.csc-pagination-wrap.text-center ul.nav-pagination {
    justify-content: center !important;
    margin: 0 auto !important;
}

.csc-pagination-wrap.text-left ul.csc-pagination-list,
.csc-pagination-wrap.text-left ul.page-numbers,
.csc-pagination-wrap.text-left ul.nav-pagination {
    justify-content: flex-start !important;
    margin: 0 !important;
}

.csc-pagination-wrap.text-right ul.csc-pagination-list,
.csc-pagination-wrap.text-right ul.page-numbers,
.csc-pagination-wrap.text-right ul.nav-pagination {
    justify-content: flex-end !important;
    margin: 0 0 0 auto !important;
}

ul.csc-pagination-list li,
.csc-pagination-wrap ul.page-numbers li,
.csc-pagination-wrap ul.nav-pagination li {
    display: inline-flex !important;
    list-style: none !important;
    list-style-type: none !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    background: transparent !important;
}

ul.csc-pagination-list li::before,
ul.csc-pagination-list li::after,
.csc-pagination-wrap ul.page-numbers li::before,
.csc-pagination-wrap ul.page-numbers li::after,
.csc-pagination-wrap ul.nav-pagination li::before,
.csc-pagination-wrap ul.nav-pagination li::after {
    content: none !important;
    display: none !important;
}

/* Kiểu dáng từng nút số trang */
ul.csc-pagination-list li a,
ul.csc-pagination-list li span,
.csc-pagination-wrap ul.nav-pagination>li>a,
.csc-pagination-wrap ul.nav-pagination>li>span {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-width: 38px !important;
    height: 38px !important;
    line-height: 38px !important;
    padding: 0 12px !important;
    border-radius: 8px !important;
    border: 1px solid #e2e8f0 !important;
    background-color: #ffffff !important;
    color: #334155 !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    text-decoration: none !important;
    transition: all 0.2s ease !important;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04) !important;
    box-sizing: border-box !important;
}

/* Nút trang hiện tại (Active) */
ul.csc-pagination-list li span.current,
ul.csc-pagination-list li .current,
.csc-pagination-wrap ul.nav-pagination>li>.current,
.csc-pagination-wrap ul.nav-pagination>li>span.current {
    background-color: var(--primary-color, #446084) !important;
    border-color: var(--primary-color, #446084) !important;
    color: #ffffff !important;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.12) !important;
    cursor: default !important;
}

/* Hover nút số trang */
ul.csc-pagination-list li a:hover,
.csc-pagination-wrap ul.nav-pagination>li>a:hover {
    background-color: #f8fafc !important;
    border-color: var(--primary-color, #446084) !important;
    color: var(--primary-color, #446084) !important;
    transform: translateY(-1px);
}

/* Dấu ba chấm (...) */
ul.csc-pagination-list li span.dots,
.csc-pagination-wrap ul.nav-pagination>li>span.dots {
    border: none !important;
    background: transparent !important;
    box-shadow: none !important;
    color: #94a3b8 !important;
    min-width: 24px !important;
    cursor: default !important;
}

/* Icon mũi tên trước / sau */
ul.csc-pagination-list li a.prev i,
ul.csc-pagination-list li a.next i {
    font-size: 13px !important;
    line-height: 1 !important;
}

/* ==========================================================
   BỘ LỌC CỘT TRÁI (SIDEBAR FILTER)
   ========================================================== */
/* Responsive: Ẩn bộ lọc sidebar trên mobile (< 850px) để hiển thị danh sách sách thông thoáng */
@media (max-width: 850px) {

    .csc-sidebar-col,
    .csc-sidebar-filter {
        display: none !important;
    }

    .csc-archive-main-col {
        flex-basis: 100% !important;
        max-width: 100% !important;
        width: 100% !important;
    }
}

#csc-catalog {
    scroll-margin-top: 100px !important;
}

.csc-sidebar-filter {
    padding: 22px 18px !important;
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 8px !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
    margin-top: 20px;
}

.csc-filter-group {
    margin-bottom: 22px !important;
}

.csc-filter-label {
    display: block !important;
    font-size: 11px !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.6px !important;
    color: #475569 !important;
    margin-bottom: 9px !important;
}

/* ==========================================================
   MENU THỂ LOẠI (DẠNG MENU TỐI GIẢN, KHÔNG BO VIỀN HỘP)
   ========================================================== */
.csc-sidebar-filter ul.csc-category-menu,
ul.csc-category-menu {
    border: none !important;
    border-radius: 0 !important;
    background: transparent !important;
    margin: 0 !important;
    padding: 0 !important;
    list-style: none !important;
    list-style-type: none !important;
}

.csc-sidebar-filter ul.csc-category-menu li,
.csc-category-menu .csc-cat-menu-item {
    margin: 0 !important;
    padding: 0 !important;
    border-bottom: 1px dashed #f1f5f9;
    list-style: none !important;
    list-style-type: none !important;
}

.csc-sidebar-filter ul.csc-category-menu li::before,
.csc-category-menu .csc-cat-menu-item::before {
    content: none !important;
    display: none !important;
}

.csc-cat-menu-item:last-child {
    border-bottom: none;
}

.csc-cat-menu-link {
    display: flex !important;
    align-items: center !important;
    padding: 8px 10px !important;
    font-size: 13px !important;
    color: #475569 !important;
    border-radius: 6px;
    text-decoration: none !important;
    transition: all 0.15s ease;
}

.csc-cat-menu-link:hover {
    background-color: #f1f5f9;
    color: var(--primary-color, #446084) !important;
    padding-left: 14px !important;
}

.csc-cat-menu-link.active {
    background-color: #f8fafc;
    color: var(--primary-color, #446084) !important;
    font-weight: 700;
}

.csc-cat-menu-link::before,
.csc-cat-menu-link.active::before {
    content: none !important;
    display: none !important;
}

/* ==========================================================
   CSC BOOK TYPE / MEDIUM HORIZONTAL FILTER
   ========================================================== */
.csc-filter-mediums-row {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 6px !important;
}

.csc-medium-filter-tile {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 5px !important;
    padding: 9px 4px !important;
    border-radius: 8px !important;
    text-decoration: none !important;
    text-align: center !important;
    background: #f8fafc !important;
    border: 1.5px solid #e2e8f0 !important;
    color: #475569 !important;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
    box-sizing: border-box !important;
}

.csc-medium-filter-tile:hover {
    background: #ffffff !important;
    border-color: #cbd5e1 !important;
    color: #0f172a !important;
    transform: translateY(-1.5px);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.05);
}

.csc-medium-filter-tile .csc-medium-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.csc-medium-filter-tile .csc-medium-name {
    font-size: 11.5px !important;
    font-weight: 400 !important;
    line-height: 1.2 !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.csc-medium-filter-tile.is-active .csc-medium-name {
    font-weight: 400 !important;
}

/* Active states per medium type - Giữ nguyên màu sắc icon gốc */
.csc-medium-filter-tile.is-active.is-sach-giay {
    background: #f0fdf4 !important;
    border-color: #86efac !important;
    color: #15803d !important;
    box-shadow: 0 2px 6px rgba(34, 197, 94, 0.12);
}

.csc-medium-filter-tile.is-active.is-sach-giay .csc-medium-icon {
    border-color: #bbf7d0 !important;
}

.csc-medium-filter-tile.is-active.is-sach-dien-tu {
    background: #fef2f2 !important;
    border-color: #fca5a5 !important;
    color: #b91c1c !important;
    box-shadow: 0 2px 6px rgba(239, 68, 68, 0.12);
}

.csc-medium-filter-tile.is-active.is-sach-dien-tu .csc-medium-icon {
    border-color: #fecaca !important;
}

.csc-medium-filter-tile.is-active.is-sach-noi {
    background: #fff7ed !important;
    border-color: #fdba74 !important;
    color: #c2410c !important;
    box-shadow: 0 2px 6px rgba(234, 88, 12, 0.12);
}

.csc-medium-filter-tile.is-active.is-sach-noi .csc-medium-icon {
    border-color: #fed7aa !important;
}

/* ==========================================================
   BỘ LỌC HÌNH THỨC SÁCH TRÊN MOBILE (Nằm trên csc-archive-header-box)
   ========================================================== */
.csc-mobile-format-filter {
    display: none;
}

@media (max-width: 850px) {
    .csc-mobile-format-filter {
        display: block !important;
        margin-top: 15px;
        margin-bottom: 15px;
    }

    .csc-mobile-format-filter .csc-filter-mediums-row {
        gap: 8px !important;
    }

    .csc-mobile-format-filter .csc-medium-filter-tile {
        padding: 9px 4px !important;
    }

    .csc-mobile-format-filter .csc-medium-name {
        font-size: 12px !important;
        font-weight: 500 !important;
    }

    /* Khi bộ lọc mobile xuất hiện ở trên, loại bỏ khoảng hở thừa ở đỉnh toolbar */
    .csc-mobile-format-filter+.csc-archive-header-box {
        margin-top: 0 !important;
    }
}

/* Tag Pills 1-Chạm trong Bộ Lọc */
.csc-tag-pills .csc-pill-badge {
    display: inline-block;
    padding: 5px 12px;
    font-size: 12px;
    font-weight: 500;
    color: #475569;
    background-color: #f1f5f9;
    border-radius: 999px;
    border: 1px solid transparent;
    transition: all 0.15s ease;
    text-decoration: none !important;
}

.csc-tag-pills .csc-pill-badge:hover {
    background-color: #e2e8f0;
    color: #0f172a;
}

.csc-tag-pills .csc-pill-badge.active {
    background-color: var(--primary-color, #446084);
    color: #ffffff !important;
    border-color: var(--primary-color, #446084);
}

.csc-tag-pills .csc-pill-badge.is-small {
    padding: 3px 10px;
    font-size: 11px;
}

/* Đồng hồ đếm ngược trang gate */
.csc-timer-number {
    font-size: 52px;
    line-height: 1;
    letter-spacing: -2px;
    color: var(--primary-color, #446084);
    transition: transform 0.2s ease;
}

.csc-timer-number.pulse-tick {
    transform: scale(1.08);
}

/* Thanh progress bar */
.csc-timer-progress {
    width: 100%;
    max-width: 260px;
    height: 6px;
    background-color: #e2e8f0;
    border-radius: 999px;
    margin: 12px auto 0;
    overflow: hidden;
}

.csc-timer-progress .csc-progress-bar {
    display: block;
    height: 100%;
    width: 0%;
    background-color: var(--primary-color, #446084);
    transition: width 1s linear;
}

@keyframes cscPulseEffect {
    0% {
        box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.6);
    }

    70% {
        box-shadow: 0 0 0 12px rgba(74, 222, 128, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(74, 222, 128, 0);
    }
}

#csc-btn-download.pulse {
    animation: cscPulseEffect 1.8s infinite;
}

.hide {
    display: none !important;
}

/* ==========================================================
   CSC MODAL SYSTEM (CỐ ĐỊNH SCROLL TRANG NỀN TUYỆT ĐỐI)
   ========================================================== */
html.csc-modal-locked,
body.csc-modal-locked {
    overflow: hidden !important;
    height: 100% !important;
}

.csc-modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    background-color: rgba(15, 23, 42, 0.75);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 999999;
    overflow: hidden;
    padding: 20px 15px;
    box-sizing: border-box;
    align-items: center;
    justify-content: center;
}

.csc-modal-overlay.is-open {
    display: flex !important;
    animation: cscFadeIn 0.2s ease-out;
}

.csc-modal-container {
    position: relative;
    background: #ffffff;
    width: 100%;
    max-width: 600px;
    border-radius: 12px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.25);
    padding: 28px 24px 20px;
    box-sizing: border-box;
    margin: auto;
    animation: cscScaleUp 0.2s ease-out;
    max-height: 95vh;
    overflow-y: auto;
}

/* Đảm bảo tag trạng thái server không bị vỡ layout bởi class .badge của theme */
.csc-server-tag,
#csc-modal-server-tag,
span#csc-modal-server-tag,
.csc-gate-header .csc-server-tag {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: auto !important;
    min-width: 0 !important;
    height: auto !important;
    line-height: 1.4 !important;
    padding: 4px 14px !important;
    border-radius: 999px !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    white-space: nowrap !important;
    position: static !important;
    margin: 0 auto 8px auto !important;
    background-color: #f1f5f9 !important;
    color: #334155 !important;
    border: 1px solid #e2e8f0 !important;
    text-transform: none !important;
    box-sizing: border-box !important;
}

.csc-modal-close {
    position: absolute;
    top: 12px;
    right: 14px;
    width: 32px !important;
    height: 32px !important;
    min-width: 32px !important;
    max-width: 32px !important;
    min-height: 32px !important;
    max-height: 32px !important;
    background: transparent !important;
    border: none !important;
    font-size: 22px !important;
    font-weight: 400 !important;
    line-height: 1 !important;
    color: #64748b !important;
    cursor: pointer;
    border-radius: 50% !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: all 0.2s ease-in-out;
    padding: 0 !important;
    margin: 0 !important;
    z-index: 10;
    box-sizing: border-box !important;
    outline: none !important;
    box-shadow: none !important;
    aspect-ratio: 1 / 1 !important;
}

.csc-modal-close:hover {
    background: #f1f5f9 !important;
    color: #0f172a !important;
}

/* Nút báo link hỏng không viền dạng inline SVG bên phải nút tải */
.csc-report-link-btn {
    display: inline-flex !important;
    align-items: center !important;
    gap: 5px !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 4px 8px !important;
    margin: 0 !important;
    font-size: 13px !important;
    font-weight: 500 !important;
    color: #64748b !important;
    cursor: pointer !important;
    text-decoration: none !important;
    line-height: 1.4 !important;
    transition: color 0.15s ease-in-out;
}

.csc-report-link-btn:hover:not(:disabled) {
    color: #dc2626 !important;
    background: transparent !important;
}

.csc-report-link-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed !important;
}

.csc-report-link-btn svg {
    display: inline-block;
    vertical-align: middle;
    flex-shrink: 0;
}

/* ==========================================================
   MODAL ĐỌC TRỰC TUYẾN ONLINE (ZERO GAP 2 ĐẦU & ZOOM KHÔNG GIỚI HẠN)
   ========================================================== */
#csc-read-online-overlay {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    height: 100dvh !important;
    max-width: 100vw !important;
    max-height: 100vh !important;
    max-height: 100dvh !important;
    padding: 0 !important;
    margin: 0 !important;
    border: none !important;
    background-color: #0f172a !important;
    z-index: 9999999 !important;
    overflow: hidden !important;
}

#csc-read-online-overlay .csc-read-online-container,
.csc-modal-container.csc-read-online-container {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    height: 100dvh !important;
    max-width: 100vw !important;
    max-height: 100vh !important;
    max-height: 100dvh !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    background: #0f172a !important;
    overflow: hidden !important;
    display: flex !important;
    flex-direction: column !important;
}

.csc-reader-floating-close {
    position: absolute !important;
    top: 14px;
    right: 18px;
    z-index: 1000;
    width: 38px;
    height: 38px;
    border-radius: 50% !important;
    background: rgba(30, 41, 59, 0.75) !important;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    color: #f8fafc !important;
    font-size: 24px !important;
    line-height: 1 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    padding: 0 !important;
    margin: 0 !important;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35) !important;
}

.csc-reader-floating-close:hover {
    background: rgba(239, 68, 68, 0.9) !important;
    color: #ffffff !important;
    transform: scale(1.1);
}

#csc-reader-wrapper {
    flex: 1 1 100% !important;
    width: 100% !important;
    height: 100% !important;
    max-width: 100% !important;
    max-height: 100% !important;
    background: #0f172a !important;
    position: relative !important;
    overflow: hidden !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 !important;
    margin: 0 !important;
    box-sizing: border-box !important;
}

.csc-flipbook-viewport {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
    height: 100% !important;
    max-width: 100% !important;
    max-height: 100% !important;
    position: relative !important;
    overflow: visible !important;
    padding: 0 !important;
    margin: 0 !important;
}

/* Khung sách 3D StPageFlip (Trong suốt, không viền trắng thừa khi ở trang bìa) */
#csc-flipbook-mount,
.stf__parent {
    margin: auto !important;
    box-shadow: none !important;
    background: transparent !important;
    user-select: none;
    -webkit-user-select: none;
    border-radius: 0 !important;
    padding: 0 !important;
    border: none !important;
}

.stf__wrapper,
.stf__block {
    background: transparent !important;
    width: 100% !important;
    height: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
    border: none !important;
}

/* Sửa lỗi trang trên trang dưới: Để StPageFlip quản lý position: absolute chuẩn 2 trang ngang hàng */
.csc-flip-page {
    background-color: #ffffff !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), 0 2px 8px rgba(0, 0, 0, 0.3) !important;
}

.csc-flip-page canvas {
    width: 100% !important;
    height: 100% !important;
    display: block !important;
    object-fit: contain !important;
    margin: 0 !important;
}

.csc-flip-page-loader {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #94a3b8;
    font-size: 13px;
    font-weight: 500;
}

.csc-flip-page-num {
    position: absolute;
    bottom: 6px;
    font-size: 10px;
    color: #94a3b8;
    pointer-events: none;
    width: 100%;
    text-align: center;
}

/* Khung nạp sách 3D Loading Card (Canh giữa tuyệt đối màn hình, Glassmorphism cao cấp) */
#csc-reader-loading {
    position: absolute !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    z-index: 9999 !important;
    display: none;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
    background: rgba(15, 23, 42, 0.88) !important;
    backdrop-filter: blur(12px) !important;
    -webkit-backdrop-filter: blur(12px) !important;
    padding: 24px 32px !important;
    border-radius: 12px !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.5), 0 8px 10px -6px rgba(0, 0, 0, 0.3) !important;
    pointer-events: none !important;
    min-width: 220px !important;
    box-sizing: border-box !important;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}

#csc-reader-loading.is-active {
    display: flex !important;
    opacity: 1 !important;
    visibility: visible !important;
}

#csc-reader-loading.is-hidden {
    display: none !important;
    opacity: 0 !important;
    visibility: hidden !important;
}

#csc-reader-loading p {
    margin: 0 !important;
    color: #e2e8f0 !important;
    font-size: 13px !important;
    font-weight: 500 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
}

.csc-reader-spinner {
    width: 36px;
    height: 36px;
    border: 3px solid rgba(255, 255, 255, 0.15);
    border-top-color: #38bdf8;
    border-radius: 50%;
    animation: cscSpin 0.8s linear infinite;
    margin: 0 auto;
}

.csc-spin-icon {
    animation: cscSpin 1.2s linear infinite;
    display: inline-block;
    flex-shrink: 0;
}

@keyframes cscSpin {
    to {
        transform: rotate(360deg);
    }
}

#csc-pdf-canvas-container {
    display: inline-block;
    margin: 0 auto;
    min-width: 100%;
}

.csc-pdf-page-slot {
    display: block;
    margin: 0 auto;
    background: #ffffff;
    border-bottom: 1px solid #f1f5f9;
    box-sizing: border-box;
    transition: width 0.15s ease-out;
}

.csc-pdf-page-canvas {
    display: block !important;
    margin: 0 auto !important;
    box-shadow: none !important;
    border: none !important;
    border-radius: 0 !important;
    background: #ffffff !important;
    max-width: none !important;
    width: 100% !important;
    height: auto !important;
}

/* ==========================================================
   CSC 3D FLIPBOOK BOTTOM DOCK & POPUP MENU (1:1 THEO THIẾT KẾ)
   ========================================================== */
.csc-flip-toolbar-wrap {
    position: fixed;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999999;
    user-select: none;
    -webkit-user-select: none;
}

/* Thanh Dock chính bo góc màu trắng */
.csc-flip-toolbar {
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.25), 0 2px 8px rgba(0, 0, 0, 0.1);
    border: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    height: 40px;
    padding: 0;
    overflow: hidden;
}

/* 1. Bộ đếm trang: Nhập trực tiếp số trang để nhảy */
.csc-flip-counter {
    padding: 0 8px;
    font-size: 13px;
    font-weight: 600;
    color: #475569;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-right: 1px solid #f1f5f9;
    height: 100%;
    cursor: default;
    user-select: none;
}

.csc-pdf-cur-page,
input.csc-pdf-cur-page,
#csc-pdf-current-page {
    width: 32px !important;
    min-width: 28px !important;
    max-width: 58px !important;
    height: 24px !important;
    padding: 0 2px !important;
    margin: 0 2px 0 0 !important;
    text-align: center !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    font-family: inherit !important;
    color: #334155 !important;
    background: transparent !important;
    border: 1px solid transparent !important;
    border-radius: 4px !important;
    outline: none !important;
    box-shadow: none !important;
    cursor: pointer !important;
    transition: all 0.15s ease !important;
    -moz-appearance: textfield !important;
    appearance: textfield !important;
}

.csc-pdf-cur-page::-webkit-outer-spin-button,
.csc-pdf-cur-page::-webkit-inner-spin-button,
#csc-pdf-current-page::-webkit-outer-spin-button,
#csc-pdf-current-page::-webkit-inner-spin-button {
    -webkit-appearance: none !important;
    appearance: none !important;
    margin: 0 !important;
}

.csc-pdf-cur-page:hover,
input.csc-pdf-cur-page:hover,
#csc-pdf-current-page:hover {
    background: #f1f5f9 !important;
    border-color: #cbd5e1 !important;
    color: #0284c7 !important;
    cursor: text !important;
}

.csc-pdf-cur-page:focus,
input.csc-pdf-cur-page:focus,
#csc-pdf-current-page:focus {
    background: #ffffff !important;
    border-color: #0284c7 !important;
    box-shadow: 0 0 0 2px rgba(2, 132, 199, 0.2) !important;
    color: #0284c7 !important;
    cursor: text !important;
}

/* Các nút chức năng trên thanh Dock */
.csc-flip-btn {
    width: 42px;
    height: 44px;
    min-width: 42px;
    background: transparent !important;
    border: none !important;
    color: #64748b !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
    padding: 0 !important;
    margin: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    transition: all 0.15s ease;
    line-height: 1 !important;
}

.csc-flip-btn svg {
    display: block;
    width: 18px;
    height: 18px;
    stroke: currentColor;
    transition: transform 0.15s ease;
}

.csc-flip-btn:hover {
    color: #0284c7 !important;
    background: #f8fafc !important;
}

.csc-flip-btn:hover svg {
    transform: scale(1.1);
}

.csc-flip-btn:active {
    transform: scale(0.95);
}

/* Nút More (...) có nền xám nhẹ và 3 chấm màu xanh cyan */
.csc-flip-btn-more {
    background: #f1f5f9 !important;
    border-left: 1px solid #e2e8f0 !important;
    width: 48px;
    min-width: 48px;
}

.csc-flip-btn-more:hover {
    background: #e2e8f0 !important;
}

/* Menu Popup bung lên trên nút More (...) */
.csc-flip-more-menu {
    position: absolute;
    bottom: calc(100% + 12px);
    right: 0;
    background: #ffffff;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.2), 0 4px 10px rgba(0, 0, 0, 0.08);
    min-width: 210px;
    padding: 4px 0;
    z-index: 10000000;
    animation: cscMenuPopUp 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes cscMenuPopUp {
    from {
        opacity: 0;
        transform: translateY(6px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Mũi tên Caret chỉ xuống nút (...) */
.csc-flip-more-menu::after {
    content: '';
    position: absolute;
    bottom: -6px;
    right: 18px;
    width: 10px;
    height: 10px;
    background: #ffffff;
    border-right: 1px solid #e2e8f0;
    border-bottom: 1px solid #e2e8f0;
    transform: rotate(45deg);
}

/* Từng item trong popup menu */
.csc-flip-menu-item {
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
    padding: 10px 18px !important;
    font-size: 13.5px !important;
    font-weight: 500 !important;
    color: #334155 !important;
    text-decoration: none !important;
    border-bottom: 1px solid #f1f5f9;
    cursor: pointer !important;
    transition: background-color 0.15s ease, color 0.15s ease;
    background: transparent !important;
}

.csc-flip-menu-item:last-child {
    border-bottom: none;
}

.csc-flip-menu-item .csc-menu-icon {
    width: 17px;
    height: 17px;
    color: #64748b;
    flex-shrink: 0;
    transition: color 0.15s ease, transform 0.15s ease;
}

.csc-flip-menu-item:hover {
    background-color: #f8fafc !important;
    color: #0284c7 !important;
}

.csc-flip-menu-item:hover .csc-menu-icon {
    color: #0284c7 !important;
    transform: scale(1.1);
}

/* Nút lật trang dạng chỉ Icon ở hai bên trái - phải sách (Không nền, không viền để không che chữ) */
.csc-flip-side-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 64px;
    border-radius: 0 !important;
    background: transparent !important;
    background-color: transparent !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    border: none !important;
    color: rgba(30, 41, 59, 0.65) !important;
    box-shadow: none !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
    z-index: 50;
    padding: 0 !important;
    margin: 0 !important;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    outline: none !important;
}

.csc-flip-side-btn:hover {
    background: transparent !important;
    background-color: transparent !important;
    border: none !important;
    transform: translateY(-50%) scale(1.2);
    box-shadow: none !important;
    color: #0284c7 !important;
}

.csc-flip-side-btn svg {
    display: block;
    width: 28px;
    height: 28px;
    stroke-width: 2.5;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.35)) drop-shadow(0 0 1px rgba(255, 255, 255, 0.85));
    transition: transform 0.2s ease, color 0.2s ease, stroke 0.2s ease;
}

.csc-flip-side-btn:hover svg {
    filter: drop-shadow(0 2px 6px rgba(2, 132, 199, 0.5)) drop-shadow(0 0 2px #ffffff);
}

.csc-flip-side-prev {
    left: 8px;
}

.csc-flip-side-next {
    right: 8px;
}

/* Nút thứ 2 (Grid ⊞) khi active */
.csc-flip-btn.is-active,
.csc-flip-btn-grid.is-active {
    color: #0284c7 !important;
    background: #eff6ff !important;
}

.csc-flip-btn.is-active svg rect {
    stroke: #0284c7 !important;
}

/* ==========================================================
   CSC THUMBNAILS DRAWER (MỤC LỤC & TRANG THU NHỎ 1:1 THEO THIẾT KẾ)
   ========================================================== */
.csc-flip-thumbnails-drawer {
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    width: 210px;
    max-width: 80vw;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-right: 1px solid #e2e8f0;
    box-shadow: 4px 0 25px rgba(0, 0, 0, 0.18);
    z-index: 150;
    display: flex;
    flex-direction: column;
    transform: translateX(-100%);
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    box-sizing: border-box;
    pointer-events: none;
}

.csc-flip-thumbnails-drawer.is-open {
    transform: translateX(0);
    pointer-events: auto;
}

.csc-thumb-drawer-header {
    height: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    border-bottom: 1px solid #e2e8f0;
    background: #f8fafc;
    flex-shrink: 0;
}

.csc-thumb-drawer-title {
    font-size: 11px;
    font-weight: 700;
    color: #475569;
    letter-spacing: 1.2px;
    text-transform: uppercase;
}

.csc-thumb-drawer-close {
    background: transparent !important;
    border: none !important;
    font-size: 22px !important;
    color: #94a3b8 !important;
    cursor: pointer !important;
    padding: 0 !important;
    line-height: 1 !important;
    transition: color 0.15s ease;
    box-shadow: none !important;
    margin: 0px;
}

.csc-thumb-drawer-close:hover {
    color: #0f172a !important;
}

.csc-thumb-list {
    flex: 1;
    overflow-y: auto;
    padding: 14px 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    box-sizing: border-box;
}

.csc-thumb-list::-webkit-scrollbar {
    width: 5px;
}

.csc-thumb-list::-webkit-scrollbar-track {
    background: transparent;
}

.csc-thumb-list::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

.csc-thumb-item {
    width: 145px;
    max-width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    padding: 8px 6px;
    border-radius: 6px;
    transition: all 0.15s ease;
    box-sizing: border-box;
    user-select: none;
    -webkit-user-select: none;
}

.csc-thumb-item:hover {
    background: #f1f5f9;
}

.csc-thumb-card {
    width: 100%;
    aspect-ratio: 1 / 1.414;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 3px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.csc-thumb-canvas {
    width: 100% !important;
    height: 100% !important;
    display: block !important;
    object-fit: contain !important;
    margin: 0 !important;
}

.csc-thumb-loader {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 11px;
    color: #94a3b8;
    font-weight: 500;
}

.csc-thumb-num {
    font-size: 11px;
    font-weight: 600;
    color: #64748b;
    line-height: 1;
}

/* Thumbnail đang được xem (Active) */
.csc-thumb-item.is-active {
    background: #e2e8f0;
}

.csc-thumb-item.is-active .csc-thumb-card {
    border-color: #0284c7;
    box-shadow: 0 0 0 2px #0284c7;
}

.csc-thumb-item.is-active .csc-thumb-num {
    color: #0284c7;
    font-weight: 700;
}

/* Tương thích ngược toolbar cũ nếu có */
.csc-reader-floating-toolbar {
    display: none !important;
}

@media screen and (max-width: 768px) {
    .csc-flip-thumbnails-drawer {
        width: 175px;
    }

    .csc-thumb-item {
        width: 120px;
    }

    .csc-reader-floating-close {
        top: 10px;
        right: 12px;
        width: 32px;
        height: 32px;
        font-size: 20px !important;
    }

    #csc-reader-wrapper {
        height: 100% !important;
        padding: 0 !important;
    }

    .csc-flip-toolbar-wrap {
        bottom: 12px;
        width: calc(100% - 24px);
        max-width: 360px;
    }

    .csc-flip-toolbar {
        height: 38px;
        width: 100%;
        justify-content: space-between;
    }

    .csc-flip-counter {
        padding: 0 10px;
        font-size: 12px;
    }

    .csc-flip-btn {
        width: 34px;
        height: 38px;
        min-width: 34px;
    }

    .csc-flip-btn svg {
        width: 16px;
        height: 16px;
    }

    .csc-flip-btn-more {
        width: 38px;
        min-width: 38px;
    }

    .csc-flip-side-btn {
        width: 32px;
        height: 48px;
        background: transparent !important;
        border: none !important;
        box-shadow: none !important;
        opacity: 0.85;
    }

    .csc-flip-side-prev {
        left: 4px;
    }

    .csc-flip-side-next {
        right: 4px;
    }

    .csc-flip-more-menu {
        min-width: 195px;
        right: 0;
    }
}

@keyframes cscFadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes cscScaleUp {
    from {
        transform: scale(0.97);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* ==========================================================================
   CSC SERVER LIST (Dạng danh sách hàng dọc tối ưu hiển thị)
   ========================================================================== */
.csc-server-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
}

.csc-server-row-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 12px 18px;
    transition: all 0.2s ease-in-out;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.csc-server-row-item:hover {
    border-color: #cbd5e1;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
    background-color: #f8fafc;
}

.csc-server-info {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    min-width: 0;
}

.csc-server-name-title {
    display: inline-flex;
    align-items: center;
    font-size: 15px;
    font-weight: 600;
    color: #1e293b;
    white-space: nowrap;
}

.csc-server-meta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.csc-format-tag {
    display: inline-block;
    padding: 2px 8px;
    background: #f1f5f9;
    color: #475569;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    border-radius: 4px;
    border: 1px solid #e2e8f0;
    letter-spacing: 0.5px;
}

.csc-size-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    color: #64748b;
    font-weight: 500;
}

.csc-server-actions {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
    margin-left: 12px;
}

.csc-server-actions .button {
    margin-bottom: 0 !important;
    white-space: nowrap !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 6px !important;
    padding: 0 16px !important;
    height: 38px !important;
    line-height: 38px !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    border-radius: 6px !important;
    text-transform: uppercase !important;
    letter-spacing: 0.3px !important;
}

.csc-server-actions .csc-btn-contact {
    border: 1px solid #99f6e4 !important;
    color: #0f766e !important;
    background: #f0fdfa !important;
}

.csc-server-actions .csc-btn-contact:hover {
    background: #0d9488 !important;
    color: #ffffff !important;
    border-color: #0d9488 !important;
}

.csc-server-actions .csc-btn-read-online {
    border: 1px solid #cbd5e1 !important;
    color: #334155 !important;
    background: #ffffff !important;
}

.csc-server-actions .csc-btn-read-online:hover {
    background: #f1f5f9 !important;
    color: #0f172a !important;
    border-color: #94a3b8 !important;
}

.csc-server-actions .csc-open-download-modal {
    background-color: var(--primary-color, #446084) !important;
    border-color: var(--primary-color, #446084) !important;
    color: #ffffff !important;
}

.csc-server-actions .csc-open-download-modal:hover {
    opacity: 0.92;
    transform: translateY(-1px);
}

/* Responsive Mobile cho Danh sách Server */
@media (max-width: 640px) {
    .csc-server-row-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
        padding: 14px;
    }

    .csc-server-info {
        width: 100%;
        justify-content: space-between;
    }

    .csc-server-actions {
        width: 100%;
        margin-left: 0;
        display: flex;
        gap: 8px;
    }

    .csc-server-actions .button {
        flex: 1 1 0;
        min-width: 0;
        text-align: center;
        padding: 0 8px !important;
        font-size: 11.5px !important;
        letter-spacing: 0 !important;
    }
}

/* ==========================================================================
   CSC BOOK FAVORITES (Nút Yêu Thích & Hiệu ứng)
   ========================================================================== */
.csc-fav-btn {
    position: absolute !important;
    top: 10px !important;
    right: 10px !important;
    width: 32px !important;
    height: 32px !important;
    min-width: 32px !important;
    max-width: 32px !important;
    min-height: 32px !important;
    max-height: 32px !important;
    border-radius: 50% !important;
    background: rgba(255, 255, 255, 0.9) !important;
    backdrop-filter: blur(4px) !important;
    -webkit-backdrop-filter: blur(4px) !important;
    border: 1px solid rgba(226, 232, 240, 0.8) !important;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08) !important;
    color: #94a3b8 !important;
    cursor: pointer !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 !important;
    margin: 0 !important;
    z-index: 5 !important;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
    outline: none !important;
}

.csc-fav-btn:hover {
    background: #ffffff !important;
    color: #e11d48 !important;
    transform: scale(1.1) !important;
    box-shadow: 0 4px 10px rgba(225, 29, 72, 0.2) !important;
}

.csc-fav-btn.is-favorited {
    background: #ffffff !important;
    color: #e11d48 !important;
    border-color: #fecdd3 !important;
}

.csc-fav-btn.is-favorited .csc-fav-heart-icon {
    fill: #e11d48 !important;
    stroke: #e11d48 !important;
}

.csc-fav-btn .csc-fav-heart-icon {
    transition: transform 0.2s ease, fill 0.2s ease;
}

/* Animation khi bấm tym */
@keyframes cscHeartBounce {
    0% {
        transform: scale(1);
    }

    40% {
        transform: scale(1.35);
    }

    70% {
        transform: scale(0.9);
    }

    100% {
        transform: scale(1);
    }
}

.csc-heart-bounce {
    animation: cscHeartBounce 0.35s ease-out forwards;
}

/* Toast / Popover thông báo Thêm / Xóa Yêu thích */
.csc-fav-popover {
    position: absolute;
    z-index: 99999;
    background: #0f172a;
    color: #ffffff;
    padding: 6px 12px;
    font-size: 11.5px;
    font-weight: 600;
    line-height: 1.35;
    border-radius: 6px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.3), 0 4px 8px -2px rgba(0, 0, 0, 0.15);
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transform: translateY(4px) scale(0.95);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.csc-fav-popover.is-active {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.csc-fav-popover::after {
    content: '';
    position: absolute;
    bottom: -4px;
    right: 14px;
    width: 8px;
    height: 8px;
    background: #0f172a;
    transform: rotate(45deg);
}

.csc-fav-popover.csc-fav-popover-below::after {
    bottom: auto;
    top: -4px;
}

.csc-fav-popover-added {
    background: #0f172a;
    border: 1px solid rgba(244, 63, 94, 0.3);
}

.csc-fav-popover-added .csc-popover-icon {
    color: #f43f5e;
}

.csc-fav-popover-removed {
    background: #1e293b;
    border: 1px solid rgba(148, 163, 184, 0.2);
}

.csc-fav-popover-removed .csc-popover-icon {
    color: #94a3b8;
}

/* Tùy chỉnh danh sách shortcode [csc_favorites] */
.csc-favorites-container {
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

.csc-favorites-header {
    display: flex !important;
    flex-direction: row !important;
    justify-content: space-between !important;
    align-items: center !important;
    flex-wrap: nowrap !important;
    gap: 12px !important;
    padding-bottom: 14px !important;
    margin-bottom: 24px !important;
    border-bottom: 2px solid #f1f5f9 !important;
}

.csc-favorites-header .widget-title {
    margin: 0 !important;
    white-space: nowrap !important;
}

#csc-clear-all-favs {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 5px !important;
    white-space: nowrap !important;
    flex-shrink: 0 !important;
    line-height: 1 !important;
    padding: 6px 12px !important;
    min-height: auto !important;
    text-transform: none !important;
}

#csc-clear-all-favs[style*="display: none"] {
    display: none !important;
}

#csc-favorites-grid {
    margin-top: 10px;
}

/* ==========================================================================
   AMAZON STYLE: Nút Đọc thử, Nghe thử & Ribbon Thông số sách
   ========================================================================== */
.csc-cover-action-buttons {
    display: flex !important;
    gap: 8px !important;
    padding: 0 12px !important;
    margin-top: 14px !important;
    margin-bottom: 12px !important;
    width: 100% !important;
    box-sizing: border-box !important;
    align-items: stretch !important;
}

.csc-pill-action-btn {
    flex: 1 1 0 !important;
    /* Mỗi nút co giãn đều đặn theo số lượng nút */
    min-width: 0 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 6px !important;
    padding: 0 10px !important;
    height: 40px !important;
    line-height: 40px !important;
    border-radius: 999px !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
    outline: none !important;
    border: 1px solid #cbd5e1 !important;
    background: #ffffff !important;
    color: #1e293b !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05) !important;
    box-sizing: border-box !important;
    white-space: nowrap !important;
}

.csc-pill-action-btn:hover {
    border-color: #94a3b8 !important;
    background: #f8fafc !important;
    color: #0f172a !important;
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.08) !important;
}

.csc-pill-action-btn svg {
    flex-shrink: 0;
    width: 16px;
    height: 16px;
    color: currentColor;
}

.csc-pill-action-btn span {
    line-height: 1;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Nút Liên hệ (Contact Form 7) */
.csc-pill-action-btn.csc-btn-contact {
    color: #0f766e !important;
    border-color: #99f6e4 !important;
    background: #f0fdfa !important;
}

.csc-pill-action-btn.csc-btn-contact:hover {
    background: #0d9488 !important;
    color: #ffffff !important;
    border-color: #0d9488 !important;
}

.csc-pill-action-btn.csc-btn-read-online {
    color: #0284c7 !important;
    border-color: #bae6fd !important;
    background: #f0f9ff !important;
}

.csc-pill-action-btn.csc-btn-read-online:hover {
    background: #0284c7 !important;
    color: #ffffff !important;
    border-color: #0284c7 !important;
}

.csc-pill-action-btn.csc-btn-audio-sample {
    color: #b45309 !important;
    border-color: #fde68a !important;
    background: #fffbeb !important;
}

.csc-pill-action-btn.csc-btn-audio-sample:hover {
    background: #f59e0b !important;
    color: #ffffff !important;
    border-color: #f59e0b !important;
}

@media (max-width: 480px) {
    .csc-cover-action-buttons {
        gap: 6px !important;
        padding: 0 8px !important;
    }

    .csc-pill-action-btn {
        padding: 0 6px !important;
        font-size: 12px !important;
        height: 38px !important;
        line-height: 38px !important;
        gap: 4px !important;
    }

    .csc-pill-action-btn svg {
        width: 14px !important;
        height: 14px !important;
    }
}

/* Khung thông số Ribbon Amazon ngang */
.csc-amazon-specs-bar {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.csc-amazon-specs-track {
    display: flex;
    align-items: stretch;
    justify-content: space-around;
    min-width: 520px;
}

.csc-spec-col {
    flex: 1 1 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 10px 14px;
    position: relative;
}

.csc-spec-col:not(:last-child)::after {
    content: "";
    position: absolute;
    right: 0;
    top: 20%;
    bottom: 20%;
    width: 1px;
    background-color: #f1f5f9;
}

.csc-spec-title {
    font-size: 11px;
    color: #64748b;
    font-weight: 500;
    margin-bottom: 6px;
    white-space: nowrap;
}

.csc-spec-icon-wrap {
    color: #334155;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.csc-spec-value {
    font-size: 13px;
    color: #0f172a;
    line-height: 1.3;
    white-space: nowrap;
}

/* ==========================================================================
   AUDIBLE CLOUD PLAYER MODAL (AMAZON STYLE)
   ========================================================================== */
.csc-audible-player-modal {
    max-width: 420px !important;
    width: 92% !important;
    background: #ffffff !important;
    border-radius: 16px !important;
    padding: 24px 20px 18px !important;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.35) !important;
}

.csc-audible-header {
    margin-bottom: 12px;
}

.csc-audible-cover-wrap {
    width: 170px;
    height: 170px;
    margin: 0 auto 16px;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.2);
    background: #f1f5f9;
}

.csc-audible-cover-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.csc-audible-cover-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #e2e8f0;
}

.csc-audible-btn-get {
    background: #f59e0b !important;
    border: none !important;
    color: #111827 !important;
    font-size: 13px !important;
    font-weight: 700 !important;
    padding: 7px 24px !important;
    border-radius: 999px !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    outline: none !important;
    box-shadow: 0 2px 5px rgba(245, 158, 11, 0.3) !important;
}

.csc-audible-btn-get:hover {
    background: #d97706 !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(217, 119, 6, 0.4) !important;
}

.csc-audible-preview-badge {
    font-size: 11px;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: block;
    margin-bottom: 4px;
}

.csc-audible-book-name {
    font-size: 16px;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.35;
}

.csc-audible-author-name {
    font-size: 13px;
    color: #64748b;
    margin-top: 2px;
}

/* Thanh tua bài nhạc kiểu Audible màu cam */
.csc-audible-progress-bar-wrap {
    position: relative;
    width: 100%;
    height: 6px;
    background: #e2e8f0;
    border-radius: 999px;
    cursor: pointer;
    user-select: none;
    touch-action: manipulation;
}

.csc-audible-progress-bar-wrap::before {
    content: "";
    position: absolute;
    top: -10px;
    bottom: -10px;
    left: 0;
    right: 0;
}

.csc-audible-progress-fill {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: #f59e0b;
    border-radius: 999px;
    pointer-events: none;
}

.csc-audible-progress-thumb {
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 14px;
    height: 14px;
    background: #f59e0b;
    border: 2px solid #ffffff;
    border-radius: 50%;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
    pointer-events: none;
    transition: transform 0.1s ease;
}

.csc-audible-progress-bar-wrap:hover .csc-audible-progress-thumb {
    transform: translate(-50%, -50%) scale(1.2);
}

.csc-audible-time-row {
    font-size: 11px;
    color: #64748b;
    font-weight: 500;
    user-select: none;
}

.csc-audible-time-left {
    font-weight: 600;
    color: #334155;
}

/* Nút điều khiển Tua & Play/Pause */
.csc-audible-ctrl-btn {
    position: relative;
    background: transparent !important;
    border: none !important;
    color: #334155 !important;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0 !important;
    margin: 0 14px !important;
    transition: all 0.15s ease;
}

.csc-audible-ctrl-btn:hover {
    background: #f1f5f9 !important;
    color: #0f172a !important;
}

.csc-audible-ctrl-btn .csc-ctrl-num {
    position: absolute;
    font-size: 9px;
    font-weight: 700;
    top: 52%;
    left: 50%;
    transform: translate(-50%, -50%);
    line-height: 1;
}

.csc-audible-play-pause-btn {
    width: 58px !important;
    height: 58px !important;
    min-width: 58px !important;
    min-height: 58px !important;
    border-radius: 50% !important;
    background: #0f172a !important;
    color: #ffffff !important;
    border: none !important;
    cursor: pointer !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-shadow: 0 8px 18px -4px rgba(15, 23, 42, 0.35) !important;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
    padding: 0 !important;
    margin: 0 !important;
    outline: none !important;
}

.csc-audible-play-pause-btn:hover {
    background: #1e293b !important;
    transform: scale(1.06);
    box-shadow: 0 12px 22px -4px rgba(15, 23, 42, 0.45) !important;
}

.csc-audible-play-pause-btn .csc-icon-play {
    margin-left: 3px;
}

/* Thanh công cụ dưới cùng: Speed, Restart, Bookmark */
.csc-audible-bottom-bar {
    border-top: 1px solid #f1f5f9;
}

.csc-audible-tool-btn {
    background: transparent !important;
    border: none !important;
    color: #64748b !important;
    cursor: pointer !important;
    display: inline-flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 6px 12px !important;
    margin: 0 !important;
    border-radius: 8px !important;
    transition: all 0.15s ease !important;
    outline: none !important;
    min-width: 60px;
}

.csc-audible-tool-btn:hover {
    color: #0f172a !important;
    background: #f8fafc !important;
}

.csc-speed-text {
    font-size: 14px;
    font-weight: 700;
    line-height: 1.2;
    color: #0f172a;
}

.csc-tool-label {
    font-size: 11px;
    font-weight: 500;
    margin-top: 2px;
}

/* ==========================================================================
   AMAZON AUDIBLE: CHAPTERS PANEL (DANH SÁCH CHƯƠNG THEO HÌNH MẪU AMAZON)
   ========================================================================== */
.csc-audible-player-modal {
    position: relative;
    overflow: hidden;
}

.csc-audible-chapters-panel {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #ffffff;
    z-index: 10;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    border-radius: 12px;
    animation: cscSlideUpPanel 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes cscSlideUpPanel {
    from {
        transform: translateY(100%);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.csc-chapters-header {
    border-bottom: 1px solid #e2e8f0;
    padding: 14px 18px !important;
}

.csc-close-chapters-btn {
    background: transparent !important;
    border: none !important;
    font-size: 26px !important;
    color: #64748b !important;
    cursor: pointer !important;
    line-height: 1 !important;
    padding: 0 4px !important;
}

.csc-close-chapters-btn:hover {
    color: #0f172a !important;
}

.csc-chapters-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px 0;
}

.csc-chapter-item {
    padding: 12px 18px !important;
    border-bottom: 1px solid #f1f5f9;
    cursor: pointer;
    transition: background 0.15s ease;
}

.csc-chapter-item:hover {
    background: #f8fafc;
}

.csc-chapter-item.is-active {
    background: #fef3c7;
}

.csc-chapter-item.is-active .csc-chapter-name {
    color: #b45309;
}

.csc-chapter-name {
    font-size: 14px;
    color: #1e293b;
    flex: 1;
}

.csc-chapter-time {
    font-size: 13px;
    color: #64748b;
    margin-left: 12px;
}

/* ==========================================================================
   AMAZON STYLE: IMAGE HOVER ZOOM FLYOUT (KÍNH LÚP PHÓNG TO)
   ========================================================================== */
.csc-zoom-container {
    position: relative;
    cursor: crosshair;
    overflow: hidden;
    border-radius: 6px;
    display: block;
}

/* Thấu kính mờ trên ảnh gốc */
.csc-zoom-lens {
    position: absolute;
    width: 140px;
    height: 140px;
    background: rgba(255, 255, 255, 0.4);
    border: 1px solid rgba(15, 23, 42, 0.3);
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.15);
    display: none;
    pointer-events: none;
    z-index: 4;
}

/* Cửa sổ phóng to bên phải bao phủ khu vực nội dung giống hệt Amazon */
.csc-zoom-flyout {
    position: absolute;
    top: 0;
    left: calc(100% + 18px);
    width: 480px;
    height: 520px;
    background-repeat: no-repeat;
    background-color: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(0, 0, 0, 0.08);
    display: none;
    z-index: 999999 !important;
    pointer-events: none;
    animation: cscFadeIn 0.15s ease-out;
    background-color: #fff;
    overflow: hidden;
}

/* Ẩn tính năng zoom kính lúp trên màn hình nhỏ hoặc cảm ứng mobile */
@media (max-width: 850px) {

    .csc-zoom-flyout,
    .csc-zoom-lens {
        display: none !important;
    }

    .csc-zoom-container {
        cursor: default;
    }
}

/* ==========================================================================
   FRONT & BACK COVER GALLERY SWITCHER (BÌA TRƯỚC / BÌA SAU CHUYÊN NGHIỆP)
   ========================================================================== */
.csc-cover-thumbs {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-top: 14px;
    align-items: center;
    max-width: 100%;
    overflow-x: auto;
    padding: 4px 4px 8px;
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 transparent;
    -webkit-overflow-scrolling: touch;
}

.csc-cover-thumbs::-webkit-scrollbar {
    height: 4px;
}

.csc-cover-thumbs::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

.csc-cover-thumbs::-webkit-scrollbar-track {
    background: transparent;
}

.csc-cover-thumb {
    background: #ffffff;
    border: 2px solid #e2e8f0;
    border-radius: 6px;
    padding: 3px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    outline: none !important;
    flex-shrink: 0;
}

.csc-cover-thumb:hover {
    border-color: #94a3b8;
    transform: translateY(-2px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.csc-cover-thumb.is-active {
    border-color: var(--primary-color, #446084) !important;
    box-shadow: 0 0 0 1px var(--primary-color, #446084), 0 4px 10px -1px rgba(0, 0, 0, 0.15) !important;
}

.csc-cover-thumb img {
    width: 68px;
    height: 94px;
    object-fit: cover;
    border-radius: 3px;
    display: block;
    background: #f8fafc;
}

/* 2 nút mũi tên chuyển bìa nổi trên ảnh chính */
.csc-cover-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(4px);
    border: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #1e293b;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 5;
    padding: 0;
    outline: none !important;
}

.csc-cover-nav:hover {
    background: #ffffff;
    color: var(--primary-color, #446084);
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.csc-cover-nav.csc-cover-prev {
    left: 8px;
}

.csc-cover-nav.csc-cover-next {
    right: 8px;
}

/* ==========================================================================
   NATIVE HTML5 CSS SCROLL-SNAP SLIDER (RELATED & AUTHOR BOOKS)
   ========================================================================== */
.csc-native-slider {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    scroll-snap-type: x mandatory !important;
    scroll-behavior: smooth !important;
    -webkit-overflow-scrolling: touch !important;
    scrollbar-width: none !important;
    -ms-overflow-style: none !important;
}

.csc-native-slider::-webkit-scrollbar {
    display: none !important;
}

.csc-native-slider>.col {
    flex-shrink: 0 !important;
    scroll-snap-align: start !important;
}

.csc-slider-nav-wrap {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.csc-slider-nav-btn {
    width: 32px !important;
    height: 32px !important;
    min-width: 32px !important;
    min-height: 32px !important;
    border-radius: 50% !important;
    border: 1px solid #cbd5e1 !important;
    background: #ffffff !important;
    color: #334155 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
    padding: 0 !important;
    margin: 0 !important;
    font-size: 13px !important;
    line-height: 1 !important;
    transition: all 0.15s ease !important;
}

.csc-slider-nav-btn:hover {
    background: var(--primary-color, #446084) !important;
    border-color: var(--primary-color, #446084) !important;
    color: #ffffff !important;
}

/* ==========================================================================
   CSC ARCHIVE BANNER SLIDER & UPCOMING SLIDER (NATIVE HTML5 SCROLL SNAP)
   ========================================================================== */
.csc-archive-banner-section {
    position: relative;
    width: 100%;
}

/* Triệt tiêu hoàn toàn khoảng trắng giữa Header và Banner / Section đầu tiên */
#content.csc-archive-page-content,
#content.blog-archive.page-wrapper,
.blog-archive.page-wrapper {
    padding-top: 0 !important;
}

/* Liên kết liền mạch giữa Banner Slider và Upcoming Slider (Loại bỏ khoảng trắng) */
.csc-archive-banner-row.csc-has-upcoming-below {
    padding-top: 20px;
    margin-bottom: 0 !important;
}

.csc-archive-banner-row.csc-has-upcoming-below .col-inner,
.csc-archive-banner-row.csc-has-upcoming-below .csc-archive-banner-section {
    margin-bottom: 0 !important;
    padding-bottom: 0 !important;
}

@media (max-width: 767px) {

    /* Khi xem trên mobile: Triệt tiêu toàn bộ khoảng trắng trên đầu trang & giữa 2 section */
    #content.csc-archive-page-content,
    #content.blog-archive.page-wrapper,
    .blog-archive.page-wrapper {
        padding-top: 0 !important;
    }

    .csc-archive-banner-row {
        padding-top: 0 !important;
        margin-top: 0 !important;
    }

    .csc-archive-banner-row>.col,
    .csc-archive-banner-row .col-inner {
        padding-top: 0 !important;
        margin-top: 0 !important;
    }

    .csc-archive-banner-row.csc-has-upcoming-below {
        padding: 0 !important;
        margin: 0 !important;
        max-width: 100% !important;
        width: 100% !important;
    }

    .csc-archive-banner-row.csc-has-upcoming-below>.col,
    .csc-archive-banner-row.csc-has-upcoming-below .col-inner,
    .csc-archive-banner-row.csc-has-upcoming-below .csc-archive-banner-section {
        padding: 0 !important;
        margin: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
    }

    .csc-archive-banner-row.csc-has-upcoming-below .csc-banner-slider-container {
        border-radius: 0 !important;
        box-shadow: none !important;
        margin-bottom: 0 !important;
    }

    .csc-upcoming-fullwidth-section {
        margin-top: 0 !important;
        padding-top: 20px !important;
        padding-bottom: 20px !important;
        margin-bottom: 16px !important;
    }

    .csc-upcoming-fullwidth-section .row-main,
    .csc-upcoming-fullwidth-section .large-12.col,
    .csc-upcoming-fullwidth-section .large-12.col>.col-inner {
        padding-bottom: 0 !important;
        margin-bottom: 0 !important;
    }

    .csc-upcoming-fullwidth-section .csc-native-slider,
    .csc-upcoming-native-slider {
        padding-top: 4px !important;
        padding-bottom: 4px !important;
        margin-bottom: 0 !important;
    }

    .csc-upcoming-book-col {
        padding-bottom: 0 !important;
        margin-bottom: 0 !important;
    }

    .csc-upcoming-title-wrap {
        margin-bottom: 14px !important;
    }

    .csc-upcoming-section-title {
        font-size: 22px !important;
    }
}

.csc-archive-banner-fullwidth {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
}

.csc-archive-banner-fullwidth .csc-banner-slider-container {
    border-radius: 0 !important;
    box-shadow: none !important;
}

.csc-archive-banner-fullwidth.csc-has-upcoming-below {
    margin-bottom: 0 !important;
    padding-bottom: 0 !important;
}

.csc-archive-banner-fullwidth.csc-has-upcoming-below .csc-banner-slider-container {
    margin-bottom: 0 !important;
}

.csc-banner-slider-container {
    position: relative;
    width: 100%;
    border-radius: 12px;
    overflow: hidden;
    background: transparent !important;
    box-shadow: 0 4px 18px -4px rgba(15, 23, 42, 0.12);
}

.csc-banner-slider {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    scroll-snap-type: x mandatory !important;
    scroll-behavior: smooth !important;
    -webkit-overflow-scrolling: touch !important;
    scrollbar-width: none !important;
    -ms-overflow-style: none !important;
    width: 100%;
}

.csc-banner-slider::-webkit-scrollbar {
    display: none !important;
}

.csc-banner-slide {
    flex: 0 0 100% !important;
    width: 100% !important;
    min-width: 100% !important;
    scroll-snap-align: start !important;
    position: relative;
    aspect-ratio: var(--csc-banner-ratio, auto);
    overflow: hidden;
    background: transparent !important;
}

@media (max-width: 767px) {
    .csc-banner-slide {
        aspect-ratio: var(--csc-banner-ratio, auto);
    }
}

/* Chế độ Tự nhiên (Auto): Chiều cao co giãn 100% theo ảnh gốc, triệt tiêu hoàn toàn viền đen trên dưới */
.csc-banner-slider-container.csc-banner-ratio-auto .csc-banner-slide {
    aspect-ratio: auto !important;
    height: auto !important;
}

.csc-banner-slider-container.csc-banner-ratio-auto .csc-banner-slide-link,
.csc-banner-slider-container.csc-banner-ratio-auto .csc-banner-slide-inner {
    display: block !important;
    width: 100% !important;
    height: auto !important;
    position: relative !important;
}

.csc-banner-slider-container.csc-banner-ratio-auto .csc-banner-img {
    width: 100% !important;
    height: auto !important;
    max-height: none !important;
    display: block !important;
    object-fit: unset !important;
}

.csc-banner-slide-link,
.csc-banner-slide-inner {
    display: block !important;
    width: 100% !important;
    height: 100% !important;
    position: relative !important;
    overflow: hidden !important;
}

.csc-banner-slide-link:hover .csc-banner-img {
    transform: scale(1.025);
}

.csc-banner-img {
    width: 100% !important;
    height: 100% !important;
    object-fit: var(--csc-banner-fit, cover) !important;
    display: block !important;
    transition: transform 0.4s ease !important;
}

.csc-banner-nav-btn {
    position: absolute !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    width: 40px !important;
    height: 40px !important;
    min-width: 40px !important;
    min-height: 40px !important;
    border-radius: 50% !important;
    background: rgba(255, 255, 255, 0.9) !important;
    color: #0f172a !important;
    border: none !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
    z-index: 10 !important;
    transition: all 0.2s ease !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18) !important;
    backdrop-filter: blur(4px) !important;
    padding: 0 !important;
}

.csc-banner-nav-btn:hover {
    background: #ffffff !important;
    color: var(--primary-color, #446084) !important;
    transform: translateY(-50%) scale(1.08) !important;
}

.csc-banner-prev {
    left: 16px !important;
}

.csc-banner-next {
    right: 16px !important;
}

@media (max-width: 549px) {
    .csc-banner-nav-btn {
        width: 32px !important;
        height: 32px !important;
        min-width: 32px !important;
        min-height: 32px !important;
    }

    .csc-banner-prev {
        left: 8px !important;
    }

    .csc-banner-next {
        right: 8px !important;
    }
}

.csc-banner-dots {
    position: absolute !important;
    bottom: 14px !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 7px !important;
    z-index: 15 !important;
    margin: 0 !important;
    padding: 4px 10px !important;
    background: none !important;
    border-radius: 99px !important;
    backdrop-filter: blur(4px) !important;
    -webkit-backdrop-filter: blur(4px) !important;
}

.csc-banner-dot,
button.csc-banner-dot {
    display: inline-block !important;
    width: 8px !important;
    height: 8px !important;
    min-width: 8px !important;
    min-height: 8px !important;
    max-width: 8px !important;
    max-height: 8px !important;
    border-radius: 99px !important;
    background: rgba(255, 255, 255, 0.55) !important;
    border: none !important;
    padding: 0 !important;
    margin: 0 !important;
    cursor: pointer !important;
    outline: none !important;
    box-shadow: none !important;
    line-height: 0 !important;
    font-size: 0 !important;
    color: transparent !important;
    transition: all 0.28s ease !important;
    -webkit-appearance: none !important;
    appearance: none !important;
}

.csc-banner-dot:hover,
button.csc-banner-dot:hover {
    background: rgba(255, 255, 255, 0.9) !important;
    transform: scale(1.15) !important;
}

.csc-banner-dot.is-active,
button.csc-banner-dot.is-active {
    width: 22px !important;
    min-width: 22px !important;
    max-width: 22px !important;
    height: 8px !important;
    min-height: 8px !important;
    max-height: 8px !important;
    border-radius: 99px !important;
    background: #ffffff !important;
    box-shadow: 0 0 6px rgba(255, 255, 255, 0.8) !important;
    transform: none !important;
}

.csc-upcoming-books-section,
.csc-upcoming-fullwidth-section {
    position: relative;
    width: 100%;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    padding-top: 32px !important;
    padding-bottom: 24px !important;
}

.csc-upcoming-fullwidth-section .row-main,
.csc-upcoming-fullwidth-section .large-12.col,
.csc-upcoming-fullwidth-section .large-12.col>.col-inner {
    padding-bottom: 0 !important;
    margin-bottom: 0 !important;
}

.csc-upcoming-slider-container {
    position: relative !important;
    padding: 0 10px !important;
}

.csc-upcoming-fullwidth-section .csc-native-slider,
.csc-upcoming-native-slider {
    align-items: stretch !important;
    padding: 6px 0 8px !important;
    margin-bottom: 0 !important;
    scrollbar-width: none !important;
}

.csc-upcoming-native-slider::-webkit-scrollbar {
    display: none !important;
}

.csc-upcoming-book-col {
    flex-shrink: 0 !important;
    padding-bottom: 0 !important;
    margin-bottom: 0 !important;
}

.csc-upcoming-cover-link {
    display: block !important;
    text-decoration: none !important;
}

.csc-upcoming-cover-frame {
    transition: transform 0.28s ease, box-shadow 0.28s ease !important;
}

.csc-upcoming-cover-link:hover .csc-upcoming-cover-frame {
    transform: translateY(-6px) scale(1.02);
    box-shadow: 0 18px 32px -4px rgba(0, 0, 0, 0.6), 0 8px 14px -2px rgba(0, 0, 0, 0.4) !important;
}

.csc-upcoming-book-title a {
    transition: opacity 0.2s ease, text-decoration 0.2s ease;
}

.csc-upcoming-book-title a:hover {
    opacity: 0.85;
    text-decoration: underline !important;
}

.csc-upcoming-author a {
    transition: color 0.2s ease;
}

.csc-upcoming-author a:hover {
    color: #93c5fd !important;
    text-decoration: underline !important;
}

/* Mũi tên điều hướng lơ lửng 2 bên mép (Floating Circular Arrows) */
.csc-upcoming-nav-arrow,
button.csc-upcoming-nav-arrow {
    position: absolute !important;
    top: 36% !important;
    transform: translateY(-50%) !important;
    width: 38px !important;
    height: 38px !important;
    min-width: 38px !important;
    min-height: 38px !important;
    border-radius: 50% !important;
    background: #ffffff !important;
    color: #1e293b !important;
    border: none !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
    z-index: 10 !important;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3) !important;
    transition: all 0.2s ease !important;
    padding: 0 !important;
    line-height: 0 !important;
}

.csc-upcoming-nav-arrow:hover,
button.csc-upcoming-nav-arrow:hover {
    background: #ffffff !important;
    color: var(--primary-color, #446084) !important;
    transform: translateY(-50%) scale(1.1) !important;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.45) !important;
}

.csc-upcoming-nav-prev,
button.csc-upcoming-nav-prev {
    left: -14px !important;
}

.csc-upcoming-nav-next,
button.csc-upcoming-nav-next {
    right: -14px !important;
}

@media (max-width: 767px) {
    .csc-upcoming-slider-container {
        padding: 0 !important;
    }

    .csc-upcoming-nav-arrow,
    button.csc-upcoming-nav-arrow {
        width: 32px !important;
        height: 32px !important;
        min-width: 32px !important;
        min-height: 32px !important;
        top: 38% !important;
    }

    .csc-upcoming-nav-prev,
    button.csc-upcoming-nav-prev {
        left: 2px !important;
    }

    .csc-upcoming-nav-next,
    button.csc-upcoming-nav-next {
        right: 2px !important;
    }
}

/* ==========================================================================
   CSC BOOK DESCRIPTION: EXPAND / COLLAPSE (NATIVE & ZERO-LAG)
   ========================================================================== */
/* ==========================================================================
   0. THU GỌN / XEM THÊM NỘI DUNG MÔ TẢ SÁCH (100% NATIVE CSS-FIRST, ZERO-JS LAG)
   ========================================================================== */
.csc-desc-toggle-chk,
input#csc-desc-toggle-chk {
    display: none !important;
    position: absolute !important;
    opacity: 0 !important;
    width: 0 !important;
    height: 0 !important;
    pointer-events: none !important;
    clip: rect(0, 0, 0, 0) !important;
    visibility: hidden !important;
    margin: 0 !important;
    padding: 0 !important;
}

.csc-book-desc-section {
    position: relative;
    margin-bottom: 16px !important;
}

.csc-book-desc-wrapper {
    position: relative;
    overflow: hidden;
    transition: max-height 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 1. Trạng thái mặc định: Thu gọn */
.csc-book-desc-wrapper.is-collapsed,
.csc-desc-toggle-chk:not(:checked)~.csc-book-desc-wrapper {
    max-height: var(--csc-desc-collapsed-height, 280px) !important;
}

.csc-book-desc-wrapper.is-collapsed .csc-desc-fade-overlay,
.csc-desc-toggle-chk:not(:checked)~.csc-book-desc-wrapper .csc-desc-fade-overlay {
    display: block !important;
}

.csc-desc-toggle-chk:not(:checked)~.csc-desc-toggle-wrap .csc-desc-text-less {
    display: none !important;
}

.csc-desc-toggle-chk:not(:checked)~.csc-desc-toggle-wrap .csc-desc-text-more {
    display: inline !important;
}

/* 2. Trạng thái bung mở (Xem thêm) kích hoạt tức thì bằng CSS :checked thuần */
.csc-desc-toggle-chk:checked~.csc-book-desc-wrapper,
.csc-book-desc-wrapper.is-expanded {
    max-height: 25000px !important;
}

.csc-desc-toggle-chk:checked~.csc-book-desc-wrapper .csc-desc-fade-overlay,
.csc-book-desc-wrapper.is-expanded .csc-desc-fade-overlay {
    display: none !important;
}

.csc-desc-toggle-chk:checked~.csc-desc-toggle-wrap .csc-desc-text-more {
    display: none !important;
}

.csc-desc-toggle-chk:checked~.csc-desc-toggle-wrap .csc-desc-text-less {
    display: inline !important;
}

.csc-desc-toggle-chk:checked~.csc-desc-toggle-wrap .csc-desc-chevron-icon,
.csc-desc-toggle-btn[aria-expanded="true"] .csc-desc-chevron-icon,
.csc-book-desc-section.is-expanded .csc-desc-chevron-icon {
    transform: rotate(180deg) !important;
}

.csc-desc-fade-overlay {
    display: none;
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 90px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.85) 60%, #ffffff 100%);
    pointer-events: none;
    z-index: 2;
}

.csc-desc-toggle-wrap {
    margin-top: 10px !important;
    margin-bottom: 12px !important;
    position: relative;
    z-index: 5;
    text-align: center;
}

.csc-desc-toggle-btn {
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
    background: #f8fafc !important;
    border: 1px solid #cbd5e1 !important;
    color: #1e293b !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    padding: 7px 18px !important;
    border-radius: 20px !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05) !important;
    line-height: 1.4 !important;
    user-select: none;
}

.csc-desc-toggle-btn:hover {
    background: #eff6ff !important;
    border-color: #3b82f6 !important;
    color: #1d4ed8 !important;
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(37, 99, 235, 0.15) !important;
}

.csc-desc-chevron-icon {
    transition: transform 0.25s ease;
}

.csc-amazon-specs-bar {
    clear: both;
    position: relative;
    z-index: 1;
}

/* ==========================================================================
   AMAZON KINDLE CLOUD READER: FULLSCREEN MODAL (READ SAMPLE)
   UI/UX PRO MAX: Tối ưu chuẩn Amazon, hỗ trợ Themes hoàn hảo, không viền trắng
   ========================================================================== */
.csc-kindle-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: #ffffff;
    z-index: 9999999;
    display: flex;
    flex-direction: column;
}

.csc-kindle-app {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    background: #ffffff;
    color: #111827;
    position: relative;
    overflow: hidden;
    transition: background-color 0.25s ease, color 0.25s ease;
}

/* 1. Theme Trắng chuẩn */
.csc-kindle-app.theme-white {
    background: #ffffff !important;
    color: #111827 !important;
}

.csc-kindle-app.theme-white .csc-kindle-topbar,
.csc-kindle-app.theme-white .csc-kindle-bottombar {
    background: #f8fafc !important;
    border-color: #e2e8f0 !important;
    color: #1e293b !important;
}

/* 2. Theme Sepia (Vàng giấy cổ dịu mắt) */
.csc-kindle-app.theme-sepia {
    background: #fbf0d9 !important;
    color: #382c1e !important;
}

.csc-kindle-app.theme-sepia .csc-kindle-topbar,
.csc-kindle-app.theme-sepia .csc-kindle-bottombar {
    background: #f2e3c6 !important;
    border-color: #e5d1a8 !important;
    color: #382c1e !important;
}

.csc-kindle-app.theme-sepia .csc-kindle-aa-panel,
.csc-kindle-app.theme-sepia .csc-kindle-toc-drawer {
    background: #fbf0d9 !important;
    border-color: #e5d1a8 !important;
    color: #382c1e !important;
}

.csc-kindle-app.theme-sepia .csc-kindle-nav-btn {
    background: rgba(56, 44, 30, 0.08) !important;
    border-color: rgba(56, 44, 30, 0.15) !important;
    color: #382c1e !important;
}

.csc-kindle-app.theme-sepia .csc-kindle-nav-btn:hover {
    background: rgba(56, 44, 30, 0.16) !important;
}

/* 3. Theme Dark (Tối chuẩn AMOLED chống mỏi mắt) */
.csc-kindle-app.theme-dark {
    background: #121212 !important;
    color: #e2e8f0 !important;
}

.csc-kindle-app.theme-dark .csc-kindle-topbar,
.csc-kindle-app.theme-dark .csc-kindle-bottombar {
    background: #1e1e1e !important;
    border-color: #2d2d2d !important;
    color: #e2e8f0 !important;
}

.csc-kindle-app.theme-dark .csc-kindle-aa-panel,
.csc-kindle-app.theme-dark .csc-kindle-toc-drawer {
    background: #1e1e1e !important;
    border-color: #333333 !important;
    color: #e2e8f0 !important;
}

.csc-kindle-app.theme-dark .csc-aa-label,
.csc-kindle-app.theme-dark .csc-toc-header strong,
.csc-kindle-app.theme-dark .csc-toc-entry {
    color: #e2e8f0 !important;
}

.csc-kindle-app.theme-dark .csc-toc-entry:hover {
    background: #2a2a2a !important;
}

.csc-kindle-app.theme-dark .csc-kindle-nav-btn {
    background: rgba(255, 255, 255, 0.1) !important;
    border-color: rgba(255, 255, 255, 0.15) !important;
    color: #ffffff !important;
}

.csc-kindle-app.theme-dark .csc-kindle-nav-btn:hover {
    background: rgba(255, 255, 255, 0.22) !important;
}

.csc-kindle-app.theme-dark .csc-aa-btn {
    background: #2a2a2a !important;
    border-color: #444444 !important;
    color: #ffffff !important;
}

/* 1. Header Kindle trên cùng */
.csc-kindle-topbar {
    height: 52px;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    flex-shrink: 0;
    z-index: 10;
    transition: background-color 0.2s ease;
}

.csc-kindle-back-btn {
    background: transparent !important;
    border: none !important;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
    color: inherit !important;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 6px;
    transition: background 0.15s ease;
    margin: 0px;
}

.csc-kindle-back-btn:hover {
    background: rgba(0, 0, 0, 0.06) !important;
}

.csc-kindle-title-center {
    font-size: 13px;
    font-weight: 500;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 50%;
}

.csc-kindle-book-title {
    font-weight: 700;
}

.csc-kindle-actions-right {
    display: flex;
    align-items: center;
    gap: 6px;
}

.csc-kindle-icon-btn {
    background: transparent !important;
    border: none !important;
    color: inherit !important;
    cursor: pointer;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: all 0.15s ease;
    margin: 0px;
}

.csc-kindle-icon-btn:hover {
    background: rgba(0, 0, 0, 0.08) !important;
}

/* 2. Sân khấu đọc sách (Stage & Viewport) */
.csc-kindle-stage {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: 0;
    background: transparent;
}

.csc-kindle-viewport-wrapper {
    width: 100%;
    max-width: 1240px;
    height: 100%;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.csc-kindle-viewer {
    width: 100%;
    height: 100%;
    overflow: hidden;
}

/* Iframe lồng bên trong ePub.js: Ép nền trong suốt hoặc theo theme */
.csc-kindle-viewer iframe {
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
    background: transparent !important;
}

/* NÚT LẬT TRANG TRÒN CÂN ĐỐI (UI/UX PRO MAX: Rõ ràng, to đẹp, căn giữa) */
.csc-kindle-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 52px;
    height: 52px;
    min-width: 52px;
    min-height: 52px;
    border-radius: 50% !important;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(0, 0, 0, 0.12);
    color: #1e293b;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
    cursor: pointer;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    z-index: 15;
    padding: 0 !important;
    margin: 0 !important;
    outline: none !important;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.csc-kindle-nav-btn:hover {
    background: #ffffff !important;
    transform: translateY(-50%) scale(1.12);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
    color: #0284c7;
}

.csc-kindle-nav-btn svg {
    display: block;
    width: 26px;
    height: 26px;
}

.csc-nav-prev {
    left: 24px;
}

.csc-nav-next {
    right: 24px;
}

/* Spinner Loading */
.csc-kindle-spinner {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    color: #64748b;
    font-size: 13px;
    z-index: 6;
}

.csc-spinner-ring {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(0, 0, 0, 0.1);
    border-top: 3px solid #0284c7;
    border-radius: 50%;
    animation: cscSpin 0.8s linear infinite;
}

@keyframes cscSpin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* 3. Footer Kindle Scrubber */
.csc-kindle-bottombar {
    height: 48px;
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 0 30px;
    flex-shrink: 0;
    z-index: 10;
}

.csc-kindle-scrubber-track {
    position: relative;
    width: 100%;
    max-width: 680px;
    height: 5px;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 3px;
    margin: 0 auto;
    cursor: pointer;
}

.csc-kindle-scrubber-fill {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: #0284c7;
    border-radius: 3px;
}

.csc-kindle-scrubber-thumb {
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 13px;
    height: 13px;
    background: #0284c7;
    border: 2px solid #ffffff;
    border-radius: 50%;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
}

.csc-kindle-loc-info {
    text-align: center;
    font-size: 11px;
    color: inherit;
    opacity: 0.8;
    margin-top: 4px;
    font-weight: 500;
}

/* Dropdown Aa Settings: Căn chỉnh tròn trịa tỉ lệ 1:1 */
.csc-kindle-aa-panel {
    position: absolute;
    top: 54px;
    right: 20px;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    padding: 18px;
    box-shadow: 0 12px 30px -4px rgba(0, 0, 0, 0.22);
    z-index: 30;
    width: 280px;
}

.csc-aa-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.csc-aa-label {
    font-size: 13px;
    font-weight: 600;
    color: #475569;
}

.csc-aa-font-size-ctrls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.csc-aa-btn {
    border: 1px solid #cbd5e1 !important;
    background: #f8fafc !important;
    padding: 6px 12px !important;
    border-radius: 6px !important;
    font-weight: bold !important;
    cursor: pointer !important;
    font-size: 13px !important;
    line-height: 1 !important;
}

.csc-aa-btn:hover {
    background: #f1f5f9 !important;
    color: #0284c7 !important;
}

.csc-aa-themes {
    display: flex;
    gap: 14px;
}

/* Các nút hình tròn chọn Theme 1:1 chuẩn xác */
.csc-theme-circle {
    width: 32px !important;
    height: 32px !important;
    min-width: 32px !important;
    min-height: 32px !important;
    border-radius: 50% !important;
    cursor: pointer !important;
    padding: 0 !important;
    margin: 0 !important;
    box-sizing: border-box !important;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.csc-theme-circle:hover {
    transform: scale(1.1);
}

.csc-theme-circle.is-white {
    background: #ffffff !important;
    border: 2px solid #cbd5e1 !important;
}

.csc-theme-circle.is-sepia {
    background: #fbf0d9 !important;
    border: 2px solid #d6be96 !important;
}

.csc-theme-circle.is-dark {
    background: #121212 !important;
    border: 2px solid #475569 !important;
}

.csc-theme-circle.is-active {
    box-shadow: 0 0 0 3px #0284c7 !important;
    border-color: transparent !important;
}

/* Drawer Mục lục TOC */
.csc-kindle-toc-drawer {
    position: absolute;
    top: 52px;
    left: 0;
    width: 340px;
    height: calc(100% - 52px);
    background: #ffffff;
    border-right: 1px solid #e2e8f0;
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.12);
    z-index: 25;
    display: flex;
    flex-direction: column;
}

.csc-toc-content-list {
    flex: 1;
    overflow-y: auto;
}

.csc-toc-entry {
    padding: 12px 20px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.15s ease;
    color: inherit;
}

.csc-toc-entry:hover {
    background: rgba(0, 0, 0, 0.04);
    color: #0284c7;
}

/* Mobile responsive */
@media (max-width: 850px) {
    .csc-kindle-topbar {
        padding: 0 10px;
        height: 48px;
    }

    /* Thu nhỏ nút và cho nút lật trang nằm thấp ở 2 mép dưới hoặc cạnh thanh tiến trình để không đè lên giữa trang sách */
    .csc-kindle-nav-btn {
        width: 38px;
        height: 38px;
        min-width: 38px;
        min-height: 38px;
        top: auto;
        bottom: 24px;
        transform: none;
        background: rgba(255, 255, 255, 0.88);
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
        opacity: 0.85;
    }

    .csc-kindle-nav-btn:hover,
    .csc-kindle-nav-btn:active {
        transform: scale(1.08);
        opacity: 1;
    }

    .csc-kindle-nav-btn svg {
        width: 18px;
        height: 18px;
    }

    .csc-nav-prev {
        left: 16px;
    }

    .csc-nav-next {
        right: 16px;
    }

    .csc-kindle-title-center {
        display: none;
    }

    /* Đảm bảo dropdown panel Aa trên mobile có kích thước vừa vặn màn hình */
    .csc-kindle-aa-panel {
        top: 50px;
        right: 10px;
        width: calc(100vw - 20px);
        max-width: 320px;
        padding: 14px;
    }

    .csc-kindle-viewport-wrapper {
        padding: 0;
        box-sizing: border-box;
    }

    .csc-kindle-toc-drawer {
        width: 85vw;
        max-width: 300px;
    }
}

/* ==========================================================================
   MODAL LIÊN HỆ (CONTACT FORM 7)
   ========================================================================== */
.csc-contact-modal-container {
    max-width: 520px;
    border-radius: 16px;
    padding: 24px 24px 20px;
    box-shadow: 0 25px 50px -12px rgba(15, 23, 42, 0.25);
    text-align: left;
}

.csc-contact-modal-header {
    display: flex;
    align-items: center;
    gap: 14px;
    padding-bottom: 14px;
    border-bottom: 1px solid #f1f5f9;
}

.csc-contact-modal-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: #f0fdfa;
    border: 1px solid #ccfbf1;
    color: #0d9488;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.csc-contact-modal-icon svg {
    width: 22px;
    height: 22px;
}

.csc-contact-modal-header-text {
    flex: 1;
    min-width: 0;
}

.csc-contact-modal-title {
    font-size: 17px;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 3px 0;
    line-height: 1.3;
}

.csc-contact-book-badge {
    font-size: 12.5px;
    color: #64748b;
    display: flex;
    align-items: baseline;
    gap: 5px;
    overflow: hidden;
    white-space: nowrap;
}

.csc-contact-book-label {
    flex-shrink: 0;
}

.csc-contact-book-title {
    color: #0d9488;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Form Contact Form 7 trong Modal */
.csc-contact-form-wrapper {
    margin-top: 10px;
}

.csc-contact-form-wrapper form.wpcf7-form p {
    margin-bottom: 12px !important;
}

.csc-contact-form-wrapper form.wpcf7-form label {
    display: block !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    color: #334155 !important;
    margin-bottom: 4px !important;
    text-align: left !important;
}

.csc-contact-form-wrapper form.wpcf7-form .wpcf7-form-control-wrap {
    display: block !important;
    margin-top: 4px !important;
}

.csc-contact-form-wrapper form.wpcf7-form input[type="text"],
.csc-contact-form-wrapper form.wpcf7-form input[type="email"],
.csc-contact-form-wrapper form.wpcf7-form input[type="tel"],
.csc-contact-form-wrapper form.wpcf7-form input[type="url"],
.csc-contact-form-wrapper form.wpcf7-form textarea {
    width: 100% !important;
    box-sizing: border-box !important;
    padding: 8px 12px !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: 8px !important;
    font-size: 13.5px !important;
    color: #1e293b !important;
    background: #ffffff !important;
    outline: none !important;
    transition: all 0.2s ease !important;
    line-height: 1.5 !important;
    box-shadow: none !important;
}

.csc-contact-form-wrapper form.wpcf7-form input[type="text"]:focus,
.csc-contact-form-wrapper form.wpcf7-form input[type="email"]:focus,
.csc-contact-form-wrapper form.wpcf7-form input[type="tel"]:focus,
.csc-contact-form-wrapper form.wpcf7-form input[type="url"]:focus,
.csc-contact-form-wrapper form.wpcf7-form textarea:focus {
    border-color: #0d9488 !important;
    box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.15) !important;
}

.csc-contact-form-wrapper form.wpcf7-form textarea {
    min-height: 85px !important;
    max-height: 180px !important;
    resize: vertical !important;
}

.csc-contact-form-wrapper form.wpcf7-form input[type="submit"],
.csc-contact-form-wrapper form.wpcf7-form .wpcf7-submit {
    width: 100% !important;
    background: #0d9488 !important;
    color: #ffffff !important;
    border: none !important;
    border-radius: 999px !important;
    padding: 10px 20px !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    margin-top: 4px !important;
    box-shadow: 0 2px 6px rgba(13, 148, 136, 0.2) !important;
}

.csc-contact-form-wrapper form.wpcf7-form input[type="submit"]:hover,
.csc-contact-form-wrapper form.wpcf7-form .wpcf7-submit:hover {
    background: #0f766e !important;
    box-shadow: 0 4px 12px rgba(13, 148, 136, 0.3) !important;
    transform: translateY(-1px);
}

.csc-contact-form-wrapper .wpcf7-not-valid-tip {
    font-size: 12px !important;
    color: #e11d48 !important;
    margin-top: 4px !important;
    display: block !important;
    text-align: left !important;
}

.csc-contact-form-wrapper .wpcf7-response-output {
    margin: 12px 0 0 0 !important;
    padding: 10px 14px !important;
    border-radius: 8px !important;
    font-size: 13px !important;
    text-align: left !important;
    border: 1px solid #cbd5e1 !important;
}

.csc-contact-form-wrapper .wpcf7-spinner {
    display: block !important;
    margin: 8px auto 0 !important;
}

/* ==========================================================
 * CỤM HÌNH THỨC SÁCH (SÁCH GIẤY, SÁCH ĐIỆN TỬ, SÁCH NÓI)
 * ========================================================== */
.csc-book-mediums-bar {
    display: flex;
    gap: 16px;
    margin: 14px 0 22px;
    align-items: stretch;
    flex-wrap: wrap;
}

.csc-medium-box {
    flex: 1;
    min-width: 120px;
    max-width: 170px;
    background: #ffffff;
    border: 1.5px solid #e2e8f0;
    border-radius: 12px;
    padding: 14px 12px 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    user-select: none;
    position: relative;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
}

.csc-medium-box.is-available {
    cursor: pointer;
}

.csc-medium-box.is-available:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
}

.csc-medium-paper.is-available:hover {
    border-color: #22c55e;
    background: #f0fdf4;
}

.csc-medium-ebook.is-available:hover {
    border-color: #ef4444;
    background: #fef2f2;
}

.csc-medium-audio.is-available:hover {
    border-color: #f59e0b;
    background: #fffbeb;
}

.csc-medium-box.is-disabled {
    opacity: 0.45;
    cursor: not-allowed;
    filter: grayscale(85%);
    background: #f8fafc;
    border-style: dashed;
}

.csc-medium-icon-wrap {
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease;
}

.csc-medium-box.is-available:hover .csc-medium-icon-wrap {
    transform: scale(1.08);
}

.csc-medium-name {
    font-size: 14px;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 4px;
    line-height: 1.2;
}

.csc-medium-status-tag {
    font-size: 11px;
    font-weight: 500;
    color: #64748b;
    line-height: 1;
}

.csc-medium-paper.is-available .csc-medium-status-tag {
    color: #16a34a;
    font-weight: 600;
}

.csc-medium-ebook.is-available .csc-medium-status-tag {
    color: #dc2626;
    font-weight: 600;
}

.csc-medium-audio.is-available .csc-medium-status-tag {
    color: #d97706;
    font-weight: 600;
}

/* Mini badges trên thẻ sách (Book card) */
.csc-card-mediums-wrap {
    display: flex;
    gap: 4px;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 6px;
}

.csc-card-medium-badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 10px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 4px;
    line-height: 1.3;
    transition: all 0.15s ease;
}

@media (max-width: 549px) {
    .csc-book-mediums-bar {
        gap: 8px;
    }

    .csc-medium-box {
        min-width: 0;
        padding: 10px 6px 8px;
    }

    .csc-medium-icon-wrap svg {
        width: 26px;
        height: 26px;
    }

    .csc-medium-name {
        font-size: 12px;
    }

    .csc-medium-status-tag {
        font-size: 10px;
    }
}