/* BOOKMARKS Styles */

.bookmark-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    margin-top: var(--space-4);
}

.bookmark-item {
    display: grid;
    /* Handle | Select | Icon | Content | Category | Actions */
    grid-template-columns: 40px 30px 60px 1fr 140px 120px;
    align-items: stretch;
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-left: 3px solid transparent;
    border-radius: var(--radius-md);
    transition: border-color var(--transition-fast), background var(--transition-fast);
    gap: 0;
    overflow: hidden;
}

/* Category accent — left border color per data-cat */
.bookmark-item[data-cat="supplier"] { border-left-color: #5eead4; }
.bookmark-item[data-cat="tool"]     { border-left-color: #60a5fa; }
.bookmark-item[data-cat="ref"]      { border-left-color: #fbbf24; }
.bookmark-item[data-cat="doc"]      { border-left-color: #c084fc; }
.bookmark-item[data-cat="forum"]    { border-left-color: #fb923c; }
.bookmark-item[data-cat="other"]    { border-left-color: #6b7280; }

.bookmark-item:hover {
    border-color: var(--text-secondary);
    border-left-color: inherit; /* preserve category color on hover */
}

/* Restore category accent on hover (specificity fix) */
.bookmark-item[data-cat="supplier"]:hover { border-left-color: #5eead4; }
.bookmark-item[data-cat="tool"]:hover     { border-left-color: #60a5fa; }
.bookmark-item[data-cat="ref"]:hover      { border-left-color: #fbbf24; }
.bookmark-item[data-cat="doc"]:hover      { border-left-color: #c084fc; }
.bookmark-item[data-cat="forum"]:hover    { border-left-color: #fb923c; }
.bookmark-item[data-cat="other"]:hover    { border-left-color: #6b7280; }

.bookmark-item.dragging {
    opacity: 0.5;
    background: var(--bg-base);
    border: 1px dashed var(--text-tertiary);
    border-left: 3px dashed var(--text-tertiary);
}

.bookmark-item.drag-over {
    border: 2px solid var(--accent);
    transform: scale(1.01);
}

/* Select column */
.bookmark-select-col {
    display: flex;
    align-items: center;
    justify-content: center;
    border-right: 1px solid var(--border-subtle);
}

.bookmark-checkbox {
    width: 14px;
    height: 14px;
    cursor: pointer;
}

/* Icon column */
.bookmark-icon {
    width: 100%;
    height: 100%;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    color: var(--text-secondary);
    border-right: 1px solid var(--border-subtle);
    padding: 0;
}

.bookmark-icon img {
    width: 22px;
    height: 22px;
    object-fit: contain;
}

/* Content column */
.bookmark-content {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 2px;
    padding: var(--space-2) var(--space-3);
    border-right: 1px solid var(--border-subtle);
}

.bookmark-title {
    font-size: var(--font-sm);
    font-weight: 600;
    color: var(--text-primary);
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
}

.bookmark-title:hover {
    color: var(--accent);
}

.bookmark-url {
    font-size: 10px;
    color: var(--text-muted);
    font-family: var(--font-family-mono);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    opacity: 0.7;
}

.bookmark-desc {
    font-size: 11px;
    color: var(--text-secondary);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-style: italic;
    white-space: normal;
}

/* Category column */
.bookmark-category {
    padding: 0;
    border-right: 1px solid var(--border-subtle);
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.category-tag {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    padding: 0 var(--space-2);
    font-size: var(--font-2xs);
    letter-spacing: 0.5px;
    text-transform: uppercase;
    text-align: center;
    white-space: nowrap;
    font-weight: 600;
}

/* Actions column */
.bookmark-actions {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 2px;
    height: 100%;
    padding: 0 4px;
}

.action-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.action-btn-danger:hover {
    background: var(--danger-subtle);
    color: var(--danger);
}

/* =============================================================================
   CATEGORY COLORS  (used by .category-badge and select options)
   ============================================================================= */

.cat-supplier {
    background: rgba(45, 212, 191, 0.15);
    color: #5eead4;
}

.cat-tool {
    background: rgba(59, 130, 246, 0.15);
    color: #60a5fa;
}

.cat-ref {
    background: rgba(245, 158, 11, 0.15);
    color: #fbbf24;
}

.cat-doc {
    background: rgba(168, 85, 247, 0.15);
    color: #c084fc;
}

.cat-forum {
    background: rgba(251, 146, 60, 0.15);
    color: #fb923c;
}

.cat-other {
    background: rgba(107, 114, 128, 0.15);
    color: #9ca3af;
}

/* =============================================================================
   FORM
   ============================================================================= */

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-4);
    margin-bottom: var(--space-3);
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.control-group label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
}

.control-group input,
.control-group select {
    background: var(--bg-input);
    border: 1px solid var(--border);
    color: var(--text-primary);
    padding: 8px;
    border-radius: 4px;
    font-size: 13px;
}

.control-group input:focus,
.control-group select:focus {
    border-color: var(--accent);
    outline: none;
}

select option {
    background: var(--bg-elevated);
    color: var(--text-primary);
    padding: 8px;
}

select option.cat-supplier { color: #2dd4bf; background: var(--bg-elevated); }
select option.cat-tool     { color: #3b82f6; background: var(--bg-elevated); }
select option.cat-ref      { color: #f59e0b; background: var(--bg-elevated); }
select option.cat-doc      { color: #a855f7; background: var(--bg-elevated); }
select option.cat-forum    { color: #f97316; background: var(--bg-elevated); }
select option.cat-other    { color: #9ca3af; background: var(--bg-elevated); }

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: var(--space-3);
    margin-top: var(--space-3);
    padding-top: var(--space-3);
    border-top: 1px solid var(--border-subtle);
}

/* =============================================================================
   FILTER BAR
   ============================================================================= */

.filter-bar {
    margin-bottom: var(--space-3);
}

.search-input {
    flex: 1;
    background: var(--bg-input);
    border: 1px solid var(--border);
    color: var(--text-primary);
    padding: 6px 10px;
    border-radius: 4px;
    font-size: 13px;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.filter-label {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
}

/* =============================================================================
   RESPONSIVE
   ============================================================================= */

@media (max-width: 768px) {
    .bookmark-item {
        grid-template-columns: 40px 30px 50px 1fr 100px 100px;
    }
}

@media (max-width: 600px) {
    .bookmark-item {
        grid-template-columns: 30px 24px 40px 1fr 80px 80px;
        font-size: var(--font-xs);
    }

    .bookmark-content {
        padding: var(--space-1) var(--space-2);
    }

    .category-tag {
        font-size: 8px;
        padding: 0 2px;
    }
}
