/* ============================
   LIZIU - Bookmarks/Favorites
   ============================ */

/* Nav bookmark button */
.nav-bookmark-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    border: 1px solid #E5E7EB;
    background: white;
    color: #6B7280;
    cursor: pointer;
    transition: all 0.2s;
    padding: 0;
    position: relative;
}

.nav-bookmark-btn:hover {
    border-color: #C4B5FD;
    color: #8B5CF6;
    background: rgba(139, 92, 246, 0.04);
}

.nav-bookmark-btn:focus-visible {
    outline: 2px solid #8B5CF6;
    outline-offset: 2px;
}

.nav-bookmark-btn .bookmark-count {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 16px;
    height: 16px;
    background: #8B5CF6;
    color: white;
    font-size: 0.625rem;
    font-weight: 700;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 3px;
}

.nav-bookmark-btn .bookmark-count:empty {
    display: none;
}

/* In-page bookmark button (on tutorial pages) */
.tutorial-bookmark-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem 0.75rem;
    background: transparent;
    border: 1px solid var(--border, #E5E7EB);
    border-radius: 6px;
    color: var(--gray-500, #6B7280);
    font-size: 0.8125rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.tutorial-bookmark-btn:hover {
    border-color: #EF4444;
    color: #EF4444;
}

.tutorial-bookmark-btn.bookmarked {
    border-color: #EF4444;
    color: #EF4444;
    background: rgba(239, 68, 68, 0.06);
}

.tutorial-bookmark-btn .bookmark-icon-filled {
    display: none;
}

.tutorial-bookmark-btn.bookmarked .bookmark-icon-outline {
    display: none;
}

.tutorial-bookmark-btn.bookmarked .bookmark-icon-filled {
    display: block;
}

/* Bookmark scale animation */
@keyframes bookmarkPop {
    0% { transform: scale(1); }
    50% { transform: scale(1.25); }
    100% { transform: scale(1); }
}

.tutorial-bookmark-btn.animate {
    animation: bookmarkPop 0.3s ease;
}

/* Bookmarks panel */
.bookmarks-panel {
    display: none;
    position: fixed;
    top: 0;
    right: 0;
    width: 360px;
    max-width: 90vw;
    height: 100vh;
    background: var(--surface, #fff);
    border-left: 1px solid var(--border, #E5E7EB);
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.1);
    z-index: 1100;
    flex-direction: column;
    animation: slideInRight 0.25s ease-out;
}

.bookmarks-panel.open {
    display: flex;
}

@keyframes slideInRight {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

.bookmarks-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border, #E5E7EB);
}

.bookmarks-panel-header h3 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--gray-900, #111827);
    margin: 0;
}

.bookmarks-panel-close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    color: var(--gray-500, #6B7280);
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s;
}

.bookmarks-panel-close:hover {
    background: var(--gray-100, #F3F4F6);
    color: var(--gray-900, #111827);
}

.bookmarks-panel-body {
    flex: 1;
    overflow-y: auto;
    padding: 0.75rem;
}

.bookmarks-group-title {
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--gray-500, #6B7280);
    padding: 0.5rem 0.75rem 0.25rem;
    margin-top: 0.5rem;
}

.bookmarks-group-title:first-child {
    margin-top: 0;
}

.bookmark-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 0.75rem;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s;
    text-decoration: none;
    color: var(--gray-700, #374151);
    font-size: 0.875rem;
}

.bookmark-item:hover {
    background: rgba(139, 92, 246, 0.06);
    color: #8B5CF6;
}

.bookmark-item-title {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.bookmark-item-remove {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    color: var(--gray-400, #9CA3AF);
    cursor: pointer;
    border-radius: 4px;
    opacity: 0;
    transition: all 0.15s;
    flex-shrink: 0;
}

.bookmark-item:hover .bookmark-item-remove {
    opacity: 1;
}

.bookmark-item-remove:hover {
    background: rgba(239, 68, 68, 0.1);
    color: #EF4444;
}

.bookmarks-empty {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--gray-500, #6B7280);
}

.bookmarks-empty svg {
    width: 48px;
    height: 48px;
    margin: 0 auto 0.75rem;
    opacity: 0.3;
}

.bookmarks-empty p {
    font-size: 0.875rem;
    margin: 0;
}

/* Overlay */
.bookmarks-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 1099;
}

.bookmarks-overlay.open {
    display: block;
}

/* Dark mode handled by dark-mode.css through CSS variables */
