.search-criteria-box {
    border-radius: 12px !important;
}

.search-criteria-box:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15) !important;
}

.saved-search-actions {
    display: inline-flex;
    align-items: center;
    min-height: 32px;
    vertical-align: middle;
}

.saved-search-btn {
    border-radius: 8px;
    font-size: 13px;
    line-height: 1.2;
    padding: 6px 10px;
    white-space: nowrap;
}

.saved-search-status {
    font-size: 12px;
    white-space: nowrap;
}

/* ============================================
   BOOK LIST MODAL — BASE (shared by all modals)
   ============================================ */
.book-list-modal {
    display: none;
    position: fixed;
    inset: 0;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(15, 23, 42, 0.55);
    z-index: 9999;
}

.book-list-modal-dialog {
    width: min(560px, 100%);
    background: #fff;
    border-radius: 8px;
    padding: 24px;
    position: relative;
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.25);
}

.book-list-modal-dialog h2 {
    margin: 0 0 8px;
    font-size: 24px;
}

.book-list-modal-subtitle {
    color: #64748b;
    margin-bottom: 18px;
}

.book-list-modal-close {
    position: absolute;
    top: 10px;
    right: 14px;
    border: 0;
    background: transparent;
    font-size: 30px;
    line-height: 1;
    color: #475569;
}

.add-to-book-list-btn {
    margin-left: 8px;
}

/* ============================================
   YOUTUBE-STYLE "SAVE TO..." DIALOG
   ============================================ */
.booklist-save-dialog {
    background: #fff;
    color: #1f2937;
    border-radius: 12px;
    padding: 20px 0;
    width: min(360px, 92vw);
    box-shadow: 0 18px 50px rgba(15, 23, 42, 0.22);
    overflow: hidden;
}

.booklist-save-dialog h2 {
    font-size: 18px;
    font-weight: 500;
    color: #1f2937;
    padding: 0 20px 12px;
    margin: 0;
    border-bottom: 1px solid #e5e7eb;
}

.booklist-save-dialog .book-list-modal-close {
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #64748b;
    top: 12px;
    right: 12px;
    border-radius: 8px;
    font-size: 24px;
    transition: background-color 0.15s, color 0.15s;
}

.booklist-save-dialog .book-list-modal-close:hover {
    background: #f1f5f9;
    color: #0f172a;
}

/* Row list container */
.booklist-rows {
    max-height: 280px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 #fff;
}

.booklist-rows::-webkit-scrollbar {
    width: 6px;
}

.booklist-rows::-webkit-scrollbar-track {
    background: #fff;
}

.booklist-rows::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

/* Single row */
.booklist-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 20px;
    cursor: pointer;
    transition: background-color 0.15s;
    user-select: none;
}

.booklist-row:hover {
    background: #f8fafc;
}

.booklist-row-main {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    flex: 1;
}

/* Bookmark icon — left side */
.booklist-row-icon {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: #64748b;
    transition: color 0.2s;
}

.booklist-row--active .booklist-row-icon {
    color: #2563eb;
}

/* List name — takes remaining space */
.booklist-row-name {
    flex: 1;
    min-width: 0;
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: #1f2937;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Badge — right side */
.booklist-row-badge {
    flex-shrink: 0;
    font-size: 11px;
    font-weight: 400;
    margin-left: 8px;
    white-space: nowrap;
}

.booklist-row-badge.badge-private {
    color: #64748b;
}

.booklist-row-badge.badge-public {
    color: #16a34a;
}

.booklist-row-badge.badge-pending {
    color: #d97706;
}

/* Loading & empty states */
.booklist-loading,
.booklist-empty {
    padding: 24px 20px;
    text-align: center;
    color: #64748b;
    font-size: 14px;
}

.booklist-loading i {
    margin-right: 6px;
}

/* New list section */
.booklist-new-section {
    border-top: 1px solid #e5e7eb;
    padding: 0;
}

.booklist-new-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 12px 20px;
    background: #fff;
    border: none;
    color: #1f2937;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.15s;
    text-align: left;
}

.booklist-new-btn:hover {
    background: #f8fafc;
    color: #2563eb;
}

.booklist-new-btn i {
    width: 20px;
    text-align: center;
}

/* Inline new list form */
.booklist-new-form {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
}

.booklist-new-input {
    flex: 1;
    min-width: 120px;
    padding: 8px 12px;
    background: #fff;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    color: #1f2937;
    font-size: 13px;
    outline: none;
    transition: border-color 0.2s;
}

.booklist-new-input:focus {
    border-color: #2563eb;
}

.booklist-new-input::placeholder {
    color: #94a3b8;
}

.booklist-new-public-label {
    display: flex;
    align-items: center;
    gap: 4px;
    color: #475569;
    font-size: 13px;
    cursor: pointer;
    white-space: nowrap;
}

.booklist-new-public-label input[type="checkbox"] {
    accent-color: #2563eb;
}

.booklist-new-submit {
    padding: 7px 14px;
    background: #2563eb;
    color: #fff;
    border: none;
    border-radius: 18px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: background-color 0.15s, opacity 0.15s;
}

.booklist-new-submit:hover {
    background: #1d4ed8;
}

.booklist-new-submit:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Status message */
.booklist-status {
    padding: 6px 20px 2px;
    font-size: 12px;
    color: #94a3b8;
    min-height: 20px;
}

@media (max-width: 767px) {
    .saved-search-actions {
        display: flex;
        margin-top: 8px;
        margin-left: 0 !important;
    }
    .add-to-book-list-btn {
        margin-left: 0;
        margin-top: 8px;
    }
    .booklist-save-dialog {
        width: 100%;
    }
}

@media (min-width: 768px) {
    .filter-result-col {
        width: auto !important;
        flex: 0 0 auto !important;
        max-width: none !important;
    }
    .filter-controls-col {
        width: auto !important;
        flex: 0 0 auto !important;
        max-width: none !important;
    }
}
