/* ════════════════════════════════════════
   Advanced Search Page
   ════════════════════════════════════════ */

/* ── Filter panel ──────────────────────────────── */
.search-adv-filter {
    position: sticky;
    top: 80px;
}

.search-adv-filter .form-label {
    font-size: .85rem;
    color: #334;
    margin-bottom: .35rem;
}

.search-adv-filter .form-control,
.search-adv-filter .form-select {
    font-size: .9rem;
    border-radius: .5rem;
    border-color: #dee2e6;
}

.search-adv-filter .form-control:focus,
.search-adv-filter .form-select:focus {
    border-color: #00BCD4;
    box-shadow: 0 0 0 .2rem rgba(0,188,212,.2);
}

/* Search button — cyan per Figma */
.btn-search-adv {
    background-color: #00BCD4;
    color: #fff;
    font-weight: 600;
    border: none;
    border-radius: .5rem;
    padding: .55rem 1rem;
    letter-spacing: .03em;
    transition: background .2s;
}
.btn-search-adv:hover,
.btn-search-adv:focus {
    background-color: #0097A7;
    color: #fff;
}

/* ── Page title ────────────────────────────────── */
.search-adv-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: #1a237e;
}

/* ── Result info line ──────────────────────────── */
.search-adv-result-info {
    font-size: .85rem;
    text-align: center;
}

/* ── Section tabs ──────────────────────────────── */
.search-adv-tabs .nav-link {
    color: #555;
    border-radius: 2rem;
    padding: .3rem .9rem;
    font-size: .88rem;
}
.search-adv-tabs .nav-link.active {
    background-color: #00BCD4;
    color: #fff;
}

/* ── Product-main badges ───────────────────────── */
.badge-pm-ebook   { background-color: #1565C0; color:#fff; }
.badge-pm-audio   { background-color: #558B2F; color:#fff; }
.badge-pm-multi   { background-color: #6A1B9A; color:#fff; }
.badge-pm-mag     { background-color: #E65100; color:#fff; }
.badge-pm-podcast { background-color: #00838F; color:#fff; }
.badge-pm-article { background-color: #4E342E; color:#fff; }

/* ── Pagination ────────────────────────────────── */
.pagination .page-link {
    color: #1a237e;
    border-color: #c5cae9;
    font-size: .85rem;
    min-width: 2.2rem;
    text-align: center;
}
.pagination .page-item.active .page-link {
    background-color: #00BCD4;
    border-color: #00BCD4;
    color: #fff;
}
.pagination .page-link:hover {
    background-color: #e0f7fa;
    color: #006064;
}

/* ── 2-line clamp helper ───────────────────────── */
.text-2-line {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ── Unified result list ───────────────────────── */
.unified-result-list .unified-result-item:last-child {
    border-bottom: none !important;
}
.unified-result-title {
    font-size: .95rem;
    line-height: 1.45;
}
.unified-result-title:hover {
    color: #00BCD4 !important;
}
.unified-result-thumb img,
.unified-result-icon {
    border-radius: .35rem;
}

/* ── Section block headers ─────────────────────── */
.search-section-block + .search-section-block {
    border-top: 2px solid #e8eaf6;
    padding-top: 1.5rem;
}
.search-section-label {
    font-size: .95rem;
    font-weight: 700;
    color: #1a237e;
    letter-spacing: .01em;
}

/* ── News Clipping list items ──────────────────── */
.search-news-item:last-child {
    border-bottom: none !important;
}
.search-news-title {
    font-size: .95rem;
    line-height: 1.4;
}
.search-news-meta {
    font-size: .78rem;
}
.badge-pm-news { background-color: #37474F; color: #fff; font-size: .8rem; }

/* ── News Clipping mock cover ──────────────────── */
.news-mock-cover {
    width: 100%;
    aspect-ratio: 3/4;
    background: linear-gradient(160deg, #546E7A 0%, #1C313A 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 10px 12px 14px;
    position: relative;
    overflow: hidden;
}

/* subtle circle accent */
.news-mock-cover::before {
    content: '';
    position: absolute;
    top: -24px;
    right: -24px;
    width: 90px;
    height: 90px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .06);
    pointer-events: none;
}
.news-mock-cover::after {
    content: '';
    position: absolute;
    bottom: -16px;
    left: -16px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .04);
    pointer-events: none;
}

.news-mock-icon {
    font-size: 2.4rem;
    color: rgba(255, 255, 255, .65);
    margin-bottom: 6px;
    position: relative;
}

.news-mock-label {
    font-size: 8px;
    font-weight: 700;
    color: rgba(255, 255, 255, .45);
    text-transform: uppercase;
    letter-spacing: 1.2px;
    text-align: center;
    position: relative;
}

.news-mock-journal {
    font-size: 10px;
    font-weight: 600;
    color: rgba(255, 255, 255, .8);
    text-align: center;
    margin-top: 5px;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    position: relative;
    max-width: 100%;
}

/* ── Extra small button for card inline actions ── */
.btn-xs {
    padding: .15rem .35rem;
    font-size: .7rem;
    line-height: 1.3;
    border-radius: .25rem;
}

/* ── Book card adjustments for search ─────────── */
.book-card .badge {
    font-size: .72rem;
    font-weight: 500;
    border-radius: .8rem;
    padding: .22em .65em;
}

/* ── Empty state ───────────────────────────────── */
.search-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3.5rem 1rem;
    color: #b0bec5;
}

.search-empty-icon {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: #eceff1;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
}

.search-empty-icon i {
    font-size: 1.8rem;
    color: #90a4ae;
}

.search-empty-title {
    font-size: 1rem;
    font-weight: 600;
    color: #546e7a;
    margin-bottom: .35rem;
}

.search-empty-sub {
    font-size: .82rem;
    color: #b0bec5;
}

/* ══════════════════════════════════════════════════
   Search page cover overrides
   (scoped to #resultGrid — does NOT affect other pages)
   ══════════════════════════════════════════════════ */
#resultGrid .book-card {
    height: auto;           /* ไม่บังคับสูงเท่ากัน */
}

#resultGrid .book-cover {
    aspect-ratio: unset;    /* ปล่อยตามสัดส่วนปกจริง */
    overflow: visible;
    display: block;
    position: static;
}

#resultGrid .book-cover img {
    width: 100%;
    height: auto;
    object-fit: scale-down;
    display: block;
}
