/**
 * Bookmark Center Pro - Bookmark Card Styles
 * Modern cards with pin feature and better UX
 * 
 * @package BookmarkCenterPro
 * @version 3.0.0
 */

/* ========================================
   Bookmark Card Base
======================================== */
.bcp-bookmark-card {
    background: var(--bcp-bg-card);
    border: 1px solid var(--bcp-border-subtle);
    border-radius: var(--bcp-radius-lg);
    overflow: hidden;
    transition: var(--bcp-transition-smooth);
    position: relative;
    animation: bcpFadeInCard 0.4s cubic-bezier(0.16, 1, 0.3, 1) backwards;
}

@keyframes bcpFadeInCard {
    from {
        opacity: 0;
        transform: translateY(12px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Staggered animation delays */
.bcp-bookmark-card:nth-child(1) { animation-delay: 0.02s; }
.bcp-bookmark-card:nth-child(2) { animation-delay: 0.04s; }
.bcp-bookmark-card:nth-child(3) { animation-delay: 0.06s; }
.bcp-bookmark-card:nth-child(4) { animation-delay: 0.08s; }
.bcp-bookmark-card:nth-child(5) { animation-delay: 0.1s; }
.bcp-bookmark-card:nth-child(6) { animation-delay: 0.12s; }
.bcp-bookmark-card:nth-child(n+7) { animation-delay: 0.14s; }

/* Accent line on top */
.bcp-bookmark-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--bcp-primary), var(--bcp-cyan));
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.bcp-bookmark-card:hover::before {
    transform: scaleX(1);
    transform-origin: left;
}

.bcp-bookmark-card:hover {
    transform: translateY(-6px);
    border-color: var(--bcp-border);
    box-shadow: var(--bcp-shadow-lg), 0 0 40px rgba(59, 130, 246, 0.08);
}

/* Selected State */
.bcp-bookmark-card.selected {
    border-color: var(--bcp-primary);
    box-shadow: 0 0 0 2px var(--bcp-primary-glow);
}

.bcp-bookmark-card.selected .bcp-bookmark-select {
    opacity: 1;
}

.bcp-bookmark-card.selected .bcp-bookmark-checkbox {
    background: var(--bcp-primary);
    border-color: var(--bcp-primary);
}

.bcp-bookmark-card.selected .bcp-bookmark-checkbox svg {
    opacity: 1;
    transform: scale(1);
}

/* Pinned State */
.bcp-bookmark-card.pinned {
    border-color: var(--bcp-warning);
}

.bcp-bookmark-card.pinned::before {
    background: linear-gradient(90deg, var(--bcp-warning), var(--bcp-warning-light));
    transform: scaleX(1);
}

.bcp-bookmark-card.pinned .bcp-bookmark-pin {
    color: var(--bcp-warning);
}

/* ========================================
   Card Selection Checkbox
======================================== */
.bcp-bookmark-select {
    position: absolute;
    top: var(--bcp-space-3);
    right: var(--bcp-space-3);
    z-index: 10;
    opacity: 0;
    transition: var(--bcp-transition-fast);
}

.bcp-bookmark-card:hover .bcp-bookmark-select {
    opacity: 1;
}

.bcp-bookmark-checkbox {
    width: 24px;
    height: 24px;
    background: var(--bcp-bg-elevated);
    border: 2px solid var(--bcp-border);
    border-radius: var(--bcp-radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--bcp-transition-fast);
}

.bcp-bookmark-checkbox:hover {
    border-color: var(--bcp-primary);
}

.bcp-bookmark-checkbox svg {
    width: 14px;
    height: 14px;
    color: white;
    opacity: 0;
    transform: scale(0);
    transition: var(--bcp-transition-fast);
}

/* ========================================
   Card Header
======================================== */
.bcp-bookmark-header {
    display: flex;
    align-items: center;
    gap: var(--bcp-space-3);
    padding: var(--bcp-space-4);
    background: var(--bcp-bg-elevated);
    border-bottom: 1px solid var(--bcp-border-subtle);
}

.bcp-bookmark-favicon {
    width: 32px;
    height: 32px;
    border-radius: var(--bcp-radius-sm);
    background: var(--bcp-bg-surface);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
}

.bcp-bookmark-favicon img {
    width: 24px;
    height: 24px;
    object-fit: contain;
}

.bcp-bookmark-favicon svg {
    width: 20px;
    height: 20px;
    color: var(--bcp-text-muted);
}

.bcp-bookmark-domain {
    flex: 1;
    font-size: var(--bcp-text-xs);
    color: var(--bcp-text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    direction: ltr;
    text-align: right;
}

.bcp-bookmark-actions {
    display: flex;
    align-items: center;
    gap: var(--bcp-space-1);
    opacity: 0;
    transition: var(--bcp-transition-fast);
}

.bcp-bookmark-card:hover .bcp-bookmark-actions {
    opacity: 1;
}

.bcp-bookmark-action {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: var(--bcp-radius-sm);
    color: var(--bcp-text-muted);
    cursor: pointer;
    transition: var(--bcp-transition-fast);
}

.bcp-bookmark-action:hover {
    background: var(--bcp-bg-hover);
    color: var(--bcp-text);
}

.bcp-bookmark-action svg {
    width: 18px;
    height: 18px;
}

/* Specific Action Hover States */
.bcp-bookmark-pin:hover {
    color: var(--bcp-warning);
    background: var(--bcp-warning-bg);
}

.bcp-bookmark-open:hover {
    color: var(--bcp-success);
    background: var(--bcp-success-bg);
}

.bcp-bookmark-share:hover {
    color: var(--bcp-cyan);
    background: rgba(6, 182, 212, 0.1);
}

.bcp-bookmark-edit:hover {
    color: var(--bcp-primary);
    background: var(--bcp-primary-bg);
}

.bcp-bookmark-delete:hover {
    color: var(--bcp-danger);
    background: var(--bcp-danger-bg);
}

/* ========================================
   Card Body
======================================== */
.bcp-bookmark-body {
    padding: var(--bcp-space-5);
    cursor: pointer;
}

.bcp-bookmark-title {
    font-size: var(--bcp-text-lg);
    font-weight: 600;
    color: var(--bcp-text);
    line-height: var(--bcp-line-tight);
    margin-bottom: var(--bcp-space-2);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: var(--bcp-transition-fast);
}

.bcp-bookmark-card:hover .bcp-bookmark-title {
    color: var(--bcp-primary);
}

.bcp-bookmark-url {
    font-size: var(--bcp-text-sm);
    color: var(--bcp-text-dim);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    direction: ltr;
    text-align: right;
    margin-bottom: var(--bcp-space-3);
}

.bcp-bookmark-notes {
    font-size: var(--bcp-text-sm);
    color: var(--bcp-text-secondary);
    line-height: var(--bcp-line-normal);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: var(--bcp-space-4);
}

/* ========================================
   Card Footer (Tags)
======================================== */
.bcp-bookmark-footer {
    display: flex;
    flex-wrap: wrap;
    gap: var(--bcp-space-2);
    padding: var(--bcp-space-3) var(--bcp-space-5);
    padding-top: 0;
}

.bcp-bookmark-tag {
    display: inline-flex;
    align-items: center;
    gap: var(--bcp-space-1);
    padding: var(--bcp-space-1) var(--bcp-space-2);
    font-size: var(--bcp-text-xs);
    font-weight: 500;
    color: var(--bcp-text-secondary);
    background: var(--bcp-bg-surface);
    border: 1px solid var(--bcp-border-subtle);
    border-radius: var(--bcp-radius-full);
    transition: var(--bcp-transition-fast);
    cursor: pointer;
}

.bcp-bookmark-tag:hover {
    border-color: var(--bcp-border);
    background: var(--bcp-bg-hover);
}

.bcp-bookmark-tag-dot {
    width: 8px;
    height: 8px;
    border-radius: var(--bcp-radius-full);
    flex-shrink: 0;
}

/* Different Tag Types */
.bcp-bookmark-tag-folder {
    background: rgba(139, 92, 246, 0.1);
    border-color: var(--bcp-purple);
    color: var(--bcp-purple-light);
}

.bcp-bookmark-tag-category {
    background: var(--bcp-success-bg);
    border-color: var(--bcp-success);
    color: var(--bcp-success-light);
}

/* ========================================
   Card Pinned Badge
======================================== */
.bcp-bookmark-pinned-badge {
    position: absolute;
    top: var(--bcp-space-3);
    left: var(--bcp-space-3);
    display: flex;
    align-items: center;
    gap: var(--bcp-space-1);
    padding: var(--bcp-space-1) var(--bcp-space-2);
    font-size: 10px;
    font-weight: 600;
    color: var(--bcp-warning);
    background: var(--bcp-warning-bg);
    border: 1px solid var(--bcp-warning);
    border-radius: var(--bcp-radius-full);
    z-index: 5;
}

.bcp-bookmark-pinned-badge svg {
    width: 12px;
    height: 12px;
}

/* ========================================
   List View Card Variant
======================================== */
.bcp-bookmark-list .bcp-bookmark-card {
    display: flex;
    align-items: center;
    border-radius: var(--bcp-radius-md);
}

.bcp-bookmark-list .bcp-bookmark-card::before {
    display: none;
}

.bcp-bookmark-list .bcp-bookmark-header {
    border-bottom: none;
    padding: var(--bcp-space-3);
    flex-shrink: 0;
}

.bcp-bookmark-list .bcp-bookmark-body {
    flex: 1;
    display: flex;
    align-items: center;
    gap: var(--bcp-space-4);
    padding: var(--bcp-space-3);
}

.bcp-bookmark-list .bcp-bookmark-title {
    flex: 1;
    margin: 0;
    -webkit-line-clamp: 1;
}

.bcp-bookmark-list .bcp-bookmark-url {
    width: 200px;
    margin: 0;
}

.bcp-bookmark-list .bcp-bookmark-notes {
    display: none;
}

.bcp-bookmark-list .bcp-bookmark-footer {
    padding: var(--bcp-space-3);
    flex-shrink: 0;
}

.bcp-bookmark-list .bcp-bookmark-actions {
    opacity: 1;
}

/* ========================================
   Compact Card Variant
======================================== */
.bcp-bookmark-compact .bcp-bookmark-card {
    padding: var(--bcp-space-3);
}

.bcp-bookmark-compact .bcp-bookmark-header {
    display: none;
}

.bcp-bookmark-compact .bcp-bookmark-body {
    padding: 0;
}

.bcp-bookmark-compact .bcp-bookmark-title {
    font-size: var(--bcp-text-base);
    -webkit-line-clamp: 1;
}

.bcp-bookmark-compact .bcp-bookmark-notes {
    display: none;
}

.bcp-bookmark-compact .bcp-bookmark-footer {
    padding: var(--bcp-space-2) 0 0 0;
}

/* ========================================
   Box View for Folders/Categories/Tags
======================================== */
.bcp-box-card {
    background: var(--bcp-bg-card);
    border: 1px solid var(--bcp-border-subtle);
    border-radius: var(--bcp-radius-lg);
    padding: var(--bcp-space-5);
    cursor: pointer;
    transition: var(--bcp-transition-normal);
    position: relative;
    overflow: hidden;
}

.bcp-box-card::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 4px;
    height: 100%;
    background: var(--box-color, var(--bcp-primary));
    transition: var(--bcp-transition-fast);
}

.bcp-box-card:hover {
    transform: translateY(-4px);
    border-color: var(--box-color, var(--bcp-primary));
    box-shadow: var(--bcp-shadow-md);
}

.bcp-box-card:hover::before {
    width: 6px;
}

.bcp-box-icon {
    width: 48px;
    height: 48px;
    margin-bottom: var(--bcp-space-4);
    background: var(--bcp-bg-elevated);
    border-radius: var(--bcp-radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
}

.bcp-box-icon svg {
    width: 24px;
    height: 24px;
    color: var(--box-color, var(--bcp-primary));
}

.bcp-box-title {
    font-size: var(--bcp-text-base);
    font-weight: 600;
    color: var(--bcp-text);
    margin-bottom: var(--bcp-space-2);
}

.bcp-box-count {
    font-size: var(--bcp-text-sm);
    color: var(--bcp-text-muted);
}

.bcp-box-count span {
    color: var(--box-color, var(--bcp-primary));
    font-weight: 600;
}

.bcp-box-actions {
    position: absolute;
    top: var(--bcp-space-3);
    left: var(--bcp-space-3);
    display: flex;
    gap: var(--bcp-space-1);
    opacity: 0;
    transition: var(--bcp-transition-fast);
}

.bcp-box-card:hover .bcp-box-actions {
    opacity: 1;
}

.bcp-box-action {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bcp-bg-elevated);
    border: 1px solid var(--bcp-border);
    border-radius: var(--bcp-radius-sm);
    color: var(--bcp-text-muted);
    cursor: pointer;
    transition: var(--bcp-transition-fast);
}

.bcp-box-action:hover {
    color: var(--bcp-primary);
    border-color: var(--bcp-primary);
}

.bcp-box-action svg {
    width: 14px;
    height: 14px;
}

/* ========================================
   Loading Skeleton
======================================== */
.bcp-bookmark-skeleton {
    background: var(--bcp-bg-card);
    border: 1px solid var(--bcp-border-subtle);
    border-radius: var(--bcp-radius-lg);
    overflow: hidden;
}

.bcp-bookmark-skeleton-header {
    display: flex;
    align-items: center;
    gap: var(--bcp-space-3);
    padding: var(--bcp-space-4);
    background: var(--bcp-bg-elevated);
}

.bcp-bookmark-skeleton-favicon {
    width: 32px;
    height: 32px;
    border-radius: var(--bcp-radius-sm);
}

.bcp-bookmark-skeleton-domain {
    flex: 1;
    height: 14px;
    border-radius: var(--bcp-radius-xs);
}

.bcp-bookmark-skeleton-body {
    padding: var(--bcp-space-5);
}

.bcp-bookmark-skeleton-title {
    height: 22px;
    width: 80%;
    margin-bottom: var(--bcp-space-3);
    border-radius: var(--bcp-radius-xs);
}

.bcp-bookmark-skeleton-url {
    height: 14px;
    width: 60%;
    margin-bottom: var(--bcp-space-4);
    border-radius: var(--bcp-radius-xs);
}

.bcp-bookmark-skeleton-tags {
    display: flex;
    gap: var(--bcp-space-2);
}

.bcp-bookmark-skeleton-tag {
    height: 24px;
    width: 60px;
    border-radius: var(--bcp-radius-full);
}
