/* ════════════════════════════════════════════════
   Bookmark Bar & Card
   ════════════════════════════════════════════════ */

/* === BOOKMARK BAR + CARD === */

/* Bar under player */
.bookmark-bar {
    display: flex; align-items: center; gap: 10px;
    padding: 8px 12px;
    background: rgba(255,255,255,0.03);
    border-radius: 0 0 12px 12px;
    border: 1px solid rgba(255,255,255,0.06);
    border-top: none;
}
.add-bookmark-btn {
    display: flex; align-items: center; gap: 6px;
    padding: 6px 14px; border-radius: 8px;
    border: 1px solid rgba(139,92,246,0.3);
    background: rgba(139,92,246,0.1);
    color: #c4b5fd; font-size: 12px; font-weight: 500;
    cursor: pointer; transition: all 0.15s;
}
.add-bookmark-btn:hover { background: rgba(139,92,246,0.22); }
.add-bookmark-btn svg { width: 13px; height: 13px; }
.bookmark-current-time {
    font-size: 12px; font-family: monospace; color: #555;
    margin-left: auto;
}

/* Bookmarks card */
.bookmarks-card { padding: 0; overflow: hidden; }
.bookmarks-card .card-header {
    padding: 14px 18px 10px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    display: flex; align-items: center; gap: 10px;
}
.bookmarks-count {
    margin-left: auto; font-size: 11px; color: #555;
    background: rgba(255,255,255,0.06);
    padding: 2px 8px; border-radius: 10px;
}
.bookmarks-list {
    max-height: 260px; overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(139,92,246,0.3) transparent;
}
.bookmarks-list::-webkit-scrollbar { width: 4px; }
.bookmarks-list::-webkit-scrollbar-thumb { background: rgba(139,92,246,0.3); border-radius: 2px; }

/* Empty state */
.bookmarks-empty {
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    gap: 8px; padding: 28px 16px;
    color: #444; font-size: 12px; text-align: center;
    line-height: 1.6;
}

/* Label input form */
.bm-label-form {
    display: flex; align-items: center; gap: 6px;
    padding: 8px 12px;
    background: rgba(139,92,246,0.07);
    border-bottom: 1px solid rgba(255,255,255,0.05);
}
.bm-form-ts {
    font-size: 11px; font-family: monospace;
    color: #a78bfa; background: rgba(139,92,246,0.15);
    padding: 2px 6px; border-radius: 5px; flex-shrink: 0;
}
.bm-label-input {
    flex: 1; background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 6px; color: #f1f1f1;
    font-size: 12px; padding: 5px 8px; outline: none;
}
.bm-label-input:focus { border-color: rgba(139,92,246,0.5); }
.bm-form-save, .bm-form-cancel {
    width: 24px; height: 24px; border-radius: 6px;
    border: none; cursor: pointer; font-size: 12px;
    display: flex; align-items: center; justify-content: center;
    transition: all 0.15s; flex-shrink: 0;
}
.bm-form-save   { background: rgba(16,185,129,0.2); color: #34d399; }
.bm-form-save:hover { background: rgba(16,185,129,0.35); }
.bm-form-cancel { background: rgba(239,68,68,0.15); color: #f87171; }
.bm-form-cancel:hover { background: rgba(239,68,68,0.3); }

/* Bookmark item */
.bm-item {
    display: flex; align-items: center; gap: 8px;
    padding: 9px 12px;
    border-bottom: 1px solid rgba(255,255,255,0.04);
    transition: background 0.15s;
}
.bm-item:hover { background: rgba(255,255,255,0.03); }
.bm-ts-badge {
    flex-shrink: 0; font-size: 11px; font-family: monospace;
    color: #a78bfa; background: rgba(139,92,246,0.12);
    border: 1px solid rgba(139,92,246,0.25);
    padding: 2px 7px; border-radius: 6px;
    cursor: pointer; transition: all 0.15s; white-space: nowrap;
}
.bm-ts-badge:hover { background: rgba(139,92,246,0.25); }
.bm-label {
    flex: 1; font-size: 12.5px; color: #ccc;
    min-width: 0; overflow: hidden;
    text-overflow: ellipsis; white-space: nowrap;
    outline: none; border-radius: 4px; padding: 1px 4px;
    cursor: text;
}
.bm-label:focus { background: rgba(255,255,255,0.06); white-space: normal; }
.bm-delete-btn {
    flex-shrink: 0; width: 22px; height: 22px;
    border-radius: 5px; border: none;
    background: transparent; color: #555;
    cursor: pointer; font-size: 11px;
    display: flex; align-items: center; justify-content: center;
    transition: all 0.15s;
}
.bm-delete-btn:hover { background: rgba(239,68,68,0.15); color: #f87171; }
/* Player seek flash */
@keyframes playerFlash {
    0%   { box-shadow: 0 0 0 0 rgba(139,92,246,0); }
    30%  { box-shadow: 0 0 0 6px rgba(139,92,246,0.5); }
    100% { box-shadow: 0 0 0 0 rgba(139,92,246,0); }
}
.player-seek-flash { animation: playerFlash 0.8s ease; }

/* ── Smart Bookmark Summary ── */
.bm-item-smart {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
}
.bm-item-top {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
}
.bm-smart-summary {
    font-size: 11px;
    color: var(--text-muted, #64748b);
    line-height: 1.5;
    padding: 4px 0 2px 42px;
    position: relative;
    opacity: 0.85;
}
.bm-smart-summary::before {
    content: '✨';
    position: absolute;
    left: 24px;
    font-size: 9px;
}
.bm-summary-loading {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #a78bfa;
    font-style: italic;
}
.bm-summary-spinner {
    display: inline-block;
    width: 10px; height: 10px;
    border: 1.5px solid rgba(139, 92, 246, 0.2);
    border-top-color: #a78bfa;
    border-radius: 50%;
    animation: bmSpinnerSpin 0.6s linear infinite;
}
@keyframes bmSpinnerSpin {
    to { transform: rotate(360deg); }
}

/* Light mode */
html.light-mode .bm-smart-summary {
    color: #6b7280;
}
html.light-mode .bm-summary-loading {
    color: #7c3aed;
}
html.light-mode .bm-summary-spinner {
    border-color: rgba(109, 40, 217, 0.15);
    border-top-color: #7c3aed;
}
