
#chapterNavbar {
    position: fixed;
    bottom: -70px;
    left: 0;
    width: 100%;
    background: #fff;
    z-index: 999;
    box-shadow: 0 -2px 6px rgba(0,0,0,0.15);
    transition: bottom 0.35s ease;
    padding: 8px 10px;
}

#chapterNavbar.show {
    bottom: 0;
}

/* Hàng ngang gọn, căn giữa đều */
#chapterNavbar .container-fluid {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    flex-wrap: nowrap;
    overflow-x: auto;
}

/* Nút & select co giãn linh hoạt */
#chapterNavbar .btn,
#chapterNavbar select {
    flex-shrink: 0;
    white-space: nowrap;
}

/* Responsive cho màn nhỏ */
@media (max-width: 576px) {
    #chapterNavbar .container-fluid {
        gap: 6px;
    }

    #chapterNavbar .btn {
        padding: 4px 8px;
        font-size: 14px;
    }

    #chapterNavbar select {
        font-size: 14px;
        min-width: 110px;
    }

    i.bi {
        font-size: 16px;
    }
}

.chapter-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: none;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    align-items: flex-end;
    justify-content: center;
}

.chapter-modal.show {
    display: flex !important;
}

.chapter-modal-content {
    width: 100%;
    max-width: 600px;
    background: #fff;
    border-top-left-radius: 16px;
    border-top-right-radius: 16px;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    animation: slideUp 0.3s ease-out;
    display: flex;
    flex-direction: column;
    max-height: 90vh;
}

.chapter-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    border-bottom: 1px solid #eee;
}

.chapter-modal-header input {
    flex: 1;
    padding: 8px 10px;
    border: 1px solid #ccc;
    border-radius: 6px;
}

.chapter-modal-header button {
    font-size: 24px;
    margin-left: 10px;
    background: none;
    border: none;
    cursor: pointer;
}

.chapter-list {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    padding: 8px 12px;
    gap: 6px;
}

.chapter-item {
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 8px;
    text-align: center;
    cursor: pointer;
    transition: 0.2s;
}

.chapter-item:hover {
    background: #f3f3f3;
}

.chapter-modal-footer {
    text-align: center;
    padding: 10px;
    border-top: 1px solid #eee;
}

.chapter-modal-footer button {
    border: none;
    background: none;
    color: #444;
    font-weight: 500;
    cursor: pointer;
}

@keyframes slideUp {
    from { transform: translateY(100%); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* Mobile fix: full width modal */
@media (max-width: 576px) {
    .chapter-modal-content {
        border-radius: 12px 12px 0 0;
        width: 100%;
    }
}
