/* 🔖 共用收藏按鈕（components/favorite_button.html） */

/* 卡片用：標題列右側小圖示 */
.fav-icon-btn {
    --fav: var(--orange-light, #fbbf24);
    position: relative;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    height: 30px;
    min-width: 30px;
    padding: 0 8px;
    border: 1px solid transparent;
    border-radius: 9999px;
    background: transparent;
    color: rgba(226, 232, 240, 0.45);
    font-size: 15px;
    cursor: pointer;
    transition: color 0.2s, background 0.2s, border-color 0.2s, transform 0.2s;
}

.fav-icon-btn:hover {
    color: var(--fav);
    background: rgba(251, 191, 36, 0.1);
    border-color: rgba(251, 191, 36, 0.35);
}

/* hover 提示（加入收藏／取消收藏），放按鈕下方避免被卡片頂端裁掉 */
.fav-icon-btn::after {
    content: attr(data-tip);
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    padding: 4px 10px;
    border-radius: 6px;
    background: rgba(15, 23, 42, 0.95);
    border: 1px solid rgba(251, 191, 36, 0.35);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
    color: #f8fafc;
    font-size: 12px;
    line-height: 1.4;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transform: translateY(-4px);
    transition: opacity 0.15s ease-out, transform 0.15s ease-out;
    z-index: 5;
}

.fav-icon-btn:hover::after,
.fav-icon-btn:focus-visible::after {
    opacity: 1;
    transform: translateY(0);
}

.fav-icon-btn:active {
    transform: scale(0.9);
}

.fav-icon-btn.is-favorited {
    color: var(--fav);
}

/* 詳情頁用：沿用 .btn-hero-admin，只改已收藏的顏色 */
.fav-block-btn {
    cursor: pointer;
    font-family: inherit;
}

.fav-block-btn:hover {
    color: var(--orange-light, #fbbf24);
    border-color: rgba(251, 191, 36, 0.45);
}

.fav-block-btn.is-favorited {
    color: var(--orange-light, #fbbf24);
    border-color: rgba(251, 191, 36, 0.55);
    background: rgba(251, 191, 36, 0.12);
}

/* 收藏數（僅超級管理員） */
.fav-count {
    font-size: 12px;
    line-height: 1;
    opacity: 0.85;
}

.fav-block-btn .fav-count {
    margin-left: 4px;
    padding: 2px 8px;
    border-radius: 9999px;
    background: rgba(255, 255, 255, 0.08);
}

/* 我的收藏頁：分頁沿用篩選膠囊 */
.favorites-tabs {
    margin-bottom: 24px;
}

.favorites-tabs .creator-topic-pill {
    text-decoration: none;
}

.favorites-empty-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 20px;
    text-decoration: none;
}
