/* ═══════════════════════════════════════════════════
   booklist.css — My Lists & Community Lists styles
   ═══════════════════════════════════════════════════ */

/* ── Tab panes (must be here so Bootstrap doesn't override) ── */
.bl-tab-pane         { display: none; }
.bl-tab-pane.active  { display: block; }

.tab-btn {
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--muted);
    padding: .7rem 1.2rem;
    font-family: inherit;
    font-size: .85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all .2s;
    margin-bottom: -1px;
    white-space: nowrap;
}
.tab-btn:hover  { color: var(--text); }
.tab-btn.active { color: var(--accent); border-bottom-color: var(--accent); }

.tab-count {
    display: inline-block;
    background: var(--bg);
    color: var(--muted);
    font-size: .65rem;
    border-radius: 10px;
    padding: 1px 6px;
    margin-left: 4px;
    vertical-align: middle;
}

/* ── Currently-Reading card ── */
.cr-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
    display: flex;
    gap: 1.5rem;
    align-items: center;
    margin-bottom: 1.75rem;
    position: relative;
    overflow: hidden;
}
.cr-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at top left, rgba(232,200,122,.06) 0%, transparent 60%);
    pointer-events: none;
}
.cr-thumb {
    width: 72px;
    min-width: 72px;
    aspect-ratio: 2/3;
    border-radius: 6px;
    overflow: hidden;
    background: var(--bg);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    box-shadow: 0 4px 14px rgba(0,0,0,.3);
    flex-shrink: 0;
}
.cr-thumb img  { width: 100%; height: 100%; object-fit: cover; }
.cr-eyebrow    { font-size: .68rem; text-transform: uppercase; letter-spacing: .09em; color: var(--accent); margin-bottom: .3rem; }
.cr-title      { font-family: var(--font-serif); font-size: 1.1rem; font-weight: 700; line-height: 1.25; margin-bottom: .15rem; }
.cr-author     { font-size: .8rem; color: var(--muted); margin-bottom: .85rem; }
.cr-bar        { height: 5px; background: var(--border); border-radius: 4px; overflow: hidden; }
.cr-fill       { height: 100%; width: 0; background: linear-gradient(90deg, var(--accent), #f0d48e); border-radius: 4px; transition: width .8s ease; }
.cr-prog-row   { display: flex; justify-content: space-between; font-size: .72rem; color: var(--muted); margin-bottom: .4rem; }

/* ── Book-list grid (Read / TBR / Favs) ── */
.bl-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
    gap: 1.5rem;
    padding-top: 1rem;
}
.bl-card { display: flex; flex-direction: column; cursor: pointer; text-decoration: none; color: inherit; }
.bl-cover {
    width: 100%;
    aspect-ratio: 2/3;
    border-radius: 6px;
    overflow: hidden;
    background: var(--card);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.2rem;
    transition: box-shadow .25s, transform .25s;
}
.bl-cover img              { width: 100%; height: 100%; object-fit: cover; }
.bl-card:hover .bl-cover   { box-shadow: 0 10px 30px rgba(0,0,0,.4); transform: translateY(-3px); }
.bl-title   { font-family: var(--font-serif); font-size: .86rem; line-height: 1.3; color: var(--text); margin-top: .5rem; }
.bl-author  { font-size: .74rem; color: var(--muted); margin-top: .15rem; }
.bl-stars   { font-size: .72rem; color: var(--accent); margin-top: .2rem; }
.bl-empty   { grid-column: 1 / -1; text-align: center; padding: 3rem 1rem; color: var(--muted); font-size: .88rem; }
.bl-empty-icon { font-size: 2rem; margin-bottom: .75rem; opacity: .4; display: block; }

/* ── Custom-list grid ── */
.cl-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1rem;
    padding-top: 1rem;
}
.cl-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1.1rem;
    transition: border-color .2s, transform .2s;
}
.cl-card:hover { border-color: rgba(232,200,122,.4); transform: translateY(-2px); }
.cl-covers { display: flex; margin-bottom: .75rem; }
.cl-cover-mini {
    width: 34px;
    aspect-ratio: 2/3;
    border-radius: 3px;
    overflow: hidden;
    background: var(--bg);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .9rem;
    margin-right: -8px;
    box-shadow: -2px 0 4px rgba(0,0,0,.25);
}
.cl-cover-mini:last-child  { margin-right: 0; }
.cl-cover-mini img         { width: 100%; height: 100%; object-fit: cover; }
.cl-name    { font-family: var(--font-serif); font-size: .93rem; margin-bottom: .25rem; }
.cl-desc    { font-size: .74rem; color: var(--muted); line-height: 1.5; margin-bottom: .5rem; }
.cl-meta    { font-size: .7rem; color: var(--muted); display: flex; gap: .6rem; align-items: center; }
.cl-pub     { font-size: .6rem; color: var(--accent); border: 1px solid var(--accent); padding: .1rem .4rem; border-radius: 10px; }
.cl-new {
    background: transparent;
    border: 1.5px dashed var(--border);
    border-radius: 10px;
    padding: 1.1rem;
    display: flex;
    align-items: center;
    gap: .75rem;
    cursor: pointer;
    color: var(--muted);
    transition: border-color .2s, color .2s;
    font-size: .85rem;
    min-height: 100px;
}
.cl-new:hover       { border-color: var(--accent); color: var(--accent); }
.cl-actions         { display: flex; gap: .4rem; margin-top: .65rem; }
.cl-btn {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--muted);
    padding: .28rem .7rem;
    border-radius: 4px;
    font-family: inherit;
    font-size: .72rem;
    cursor: pointer;
    transition: all .2s;
}
.cl-btn:hover              { border-color: var(--accent); color: var(--accent); }
.cl-btn.danger:hover       { border-color: #c0392b; color: #c0392b; }

/* ── Community lists ── */
.community-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: .85rem;
    padding-top: 1rem;
}
.comm-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1rem;
    text-decoration: none;
    color: inherit;
    transition: border-color .2s, transform .2s;
    display: block;
}
.comm-card:hover    { border-color: rgba(232,200,122,.3); transform: translateY(-2px); }
.comm-name          { font-size: .88rem; font-weight: 500; margin-bottom: .2rem; color: var(--text); }
.comm-desc          { font-size: .74rem; color: var(--muted); line-height: 1.5; margin-bottom: .45rem; }
.comm-meta          { font-size: .68rem; color: var(--muted); display: flex; gap: .4rem; align-items: center; }
.comm-by            { color: var(--accent); }
.comm-badge {
    font-size: .58rem;
    background: rgba(232,200,122,.15);
    color: var(--accent);
    border: 1px solid rgba(232,200,122,.3);
    padding: .1rem .35rem;
    border-radius: 8px;
    margin-left: auto;
}
.comm-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 3rem 1rem;
    color: var(--muted);
    font-size: .88rem;
}
.comm-empty-icon { font-size: 2rem; margin-bottom: .75rem; opacity: .4; display: block; }

/* ── Modals ── */
.modal-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.5);
    z-index: 400;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}
.modal-backdrop.open { display: flex; }
.modal-box {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.75rem;
    width: min(440px, 92vw);
    box-shadow: 0 20px 60px rgba(0,0,0,.3);
    max-height: 90vh;
    overflow-y: auto;
}
.modal-title    { font-family: var(--font-serif); font-size: 1.1rem; margin: 0 0 1.25rem; }
.modal-label    { font-size: .8rem; color: var(--muted); display: block; margin-bottom: .3rem; margin-top: .85rem; }
.modal-input,
.modal-textarea {
    width: 100%;
    background: var(--bg);
    border: 1px solid var(--border);
    color: var(--text);
    padding: .55rem .8rem;
    border-radius: 6px;
    font-family: inherit;
    font-size: .85rem;
    outline: none;
    box-sizing: border-box;
    transition: border-color .2s;
}
.modal-input:focus,
.modal-textarea:focus  { border-color: var(--accent); }
.modal-textarea        { resize: vertical; min-height: 70px; }
.modal-actions         { display: flex; justify-content: flex-end; gap: .6rem; margin-top: 1.1rem; }
.modal-cancel {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--muted);
    padding: .5rem 1.1rem;
    border-radius: 6px;
    font-family: inherit;
    font-size: .82rem;
    cursor: pointer;
}
.modal-save {
    background: var(--accent);
    border: none;
    color: #14120f;
    padding: .5rem 1.25rem;
    border-radius: 6px;
    font-family: inherit;
    font-size: .82rem;
    font-weight: 600;
    cursor: pointer;
    transition: background .2s;
}
.modal-save:hover { background: #f0d48e; }

/* ── Star picker ── */
.star-picker        { display: flex; gap: 4px; margin-top: .5rem; }
.star-picker button {
    background: none;
    border: none;
    font-size: 1.6rem;
    color: var(--accent);
    cursor: pointer;
    padding: 0;
    transition: transform .1s;
}
.star-picker button:hover { transform: scale(1.2); }

/* ── Add-to-list status buttons (used in catalogue panel) ── */
.atl-status-row {
    display: flex;
    gap: .4rem;
    flex-wrap: wrap;
    margin-bottom: .65rem;
}
.atl-status-btn {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--muted);
    padding: .32rem .75rem;
    border-radius: 20px;
    font-family: inherit;
    font-size: .73rem;
    cursor: pointer;
    transition: all .2s;
    white-space: nowrap;
}
.atl-status-btn:hover         { border-color: var(--accent); color: var(--accent); }
.atl-status-btn.atl-active    { background: rgba(232,200,122,.15); border-color: var(--accent); color: var(--accent); font-weight: 600; }
.atl-divider {
    font-size: .68rem;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--muted);
    margin: .5rem 0 .4rem;
}
.atl-list-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: .38rem 0;
    border-bottom: 1px solid var(--border);
    font-size: .8rem;
    color: var(--text);
}
.atl-list-row:last-child { border-bottom: none; }
.atl-add-btn {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--muted);
    padding: .2rem .55rem;
    border-radius: 4px;
    font-size: .7rem;
    cursor: pointer;
    transition: all .2s;
    flex-shrink: 0;
}
.atl-add-btn:hover      { border-color: var(--accent); color: var(--accent); }
.atl-add-btn.atl-added  { background: rgba(232,200,122,.15); border-color: var(--accent); color: var(--accent); }

/* ── Toast notification ── */
.bl-toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: var(--card);
    border: 1px solid var(--accent);
    color: var(--text);
    padding: .75rem 1.25rem;
    border-radius: 8px;
    font-size: .82rem;
    box-shadow: 0 8px 24px rgba(0,0,0,.3);
    z-index: 500;
    opacity: 0;
    transform: translateY(8px);
    transition: opacity .25s, transform .25s;
    pointer-events: none;
    max-width: 280px;
}
.bl-toast.show { opacity: 1; transform: translateY(0); }

/* ── Responsive ── */
@media (max-width: 600px) {
    .cr-card        { flex-direction: column; align-items: flex-start; }
    .cr-thumb       { width: 60px; min-width: 60px; }
    .bl-grid        { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 1rem; }
    .cl-grid        { grid-template-columns: 1fr; }
    .community-grid { grid-template-columns: 1fr; }
    .tab-btn        { padding: .6rem .75rem; font-size: .78rem; }
}
