/**
 * Favorites Sidebar Styles
 * 收藏夹侧边栏样式
 */

/* Toggle Button - Fixed on left side */
.favorites-toggle-btn {
    position: fixed;
    left: 1.5rem;
    top: 50%;
    transform: translateY(-50%);
    z-index: 40;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--glass-bg);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-2xl);
    box-shadow: var(--shadow-md);
    color: var(--text-color);
    cursor: pointer;
    transition: all 0.2s ease-out;
}

.favorites-toggle-btn:hover {
    transform: translateY(-50%) scale(1.05);
    background: var(--glass-hover);
    border-color: var(--accent-color);
    box-shadow: var(--shadow-lg), 0 0 20px rgba(59, 130, 246, 0.2);
}

.favorites-toggle-btn:active {
    transform: translateY(-50%) scale(0.95);
}

.favorites-toggle-btn svg {
    width: 24px;
    height: 24px;
}

/* Backdrop */
.favorites-backdrop {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(0, 0, 0, 0.4);
    opacity: 0;
    animation: fadeIn 0.2s ease-out forwards;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Sidebar */
.favorites-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 380px;
    max-width: 90vw;
    z-index: 10000;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-right: 1px solid var(--glass-border);
    border-top-right-radius: var(--radius-2xl);
    border-bottom-right-radius: var(--radius-2xl);
    box-shadow: var(--shadow-xl);
    display: flex;
    flex-direction: column;
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.favorites-sidebar.open {
    transform: translateX(0);
}

/* Header */
.favorites-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--glass-border);
}

.favorites-header-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-color);
}

.favorites-header-title svg {
    width: 20px;
    height: 20px;
    color: #ef4444;
}

.favorites-header-count {
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-weight: 400;
}

.favorites-header-close {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: var(--radius-full);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}

.favorites-header-close:hover {
    background: var(--glass-hover);
    color: var(--text-color);
}

.favorites-header-close svg {
    width: 20px;
    height: 20px;
}

/* List Container */
.favorites-list {
    flex: 1;
    overflow-y: auto;
    padding: 0.75rem;
}

/* Empty State */
.favorites-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 1.5rem;
    text-align: center;
}

.favorites-empty-icon {
    width: 64px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-2xl);
    margin-bottom: 1rem;
}

.favorites-empty-icon svg {
    width: 32px;
    height: 32px;
    color: var(--text-secondary);
}

.favorites-empty-text {
    font-size: 0.9375rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.favorites-empty-hint {
    font-size: 0.8125rem;
    color: var(--text-muted);
}

/* Item */
.favorites-item {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    padding: 0.75rem;
    margin-bottom: 0.5rem;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-xl);
    cursor: pointer;
    transition: all 0.2s;
}

.favorites-item:hover {
    background: var(--glass-hover);
    border-color: var(--glass-border-hover);
}

.favorites-item:last-child {
    margin-bottom: 0;
}

.favorites-item-poster {
    width: 60px;
    height: 80px;
    object-fit: cover;
    border-radius: var(--radius-lg);
    background: var(--glass-bg);
    flex-shrink: 0;
}

.favorites-item-poster-placeholder {
    width: 60px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    flex-shrink: 0;
}

.favorites-item-poster-placeholder svg {
    width: 24px;
    height: 24px;
    color: var(--text-secondary);
}

.favorites-item-content {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.favorites-item-title {
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--text-color);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.favorites-item-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8125rem;
    color: var(--text-secondary);
}

.favorites-item-meta span {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.favorites-item-meta svg {
    width: 14px;
    height: 14px;
}

.favorites-item-source {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.favorites-item-delete {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: var(--radius-full);
    color: var(--text-secondary);
    cursor: pointer;
    opacity: 0;
    transition: all 0.2s;
    flex-shrink: 0;
}

.favorites-item:hover .favorites-item-delete {
    opacity: 1;
}

.favorites-item-delete:hover {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

.favorites-item-delete svg {
    width: 16px;
    height: 16px;
}

/* Footer */
.favorites-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--glass-border);
}

.favorites-footer-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-xl);
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-color);
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.favorites-footer-btn:hover {
    background: var(--glass-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.favorites-footer-btn:active {
    transform: translateY(0);
}

.favorites-footer-btn svg {
    width: 16px;
    height: 16px;
}

.favorites-footer-btn.danger {
    color: #ef4444;
    border-color: rgba(239, 68, 68, 0.3);
}

.favorites-footer-btn.danger:hover {
    background: rgba(239, 68, 68, 0.15);
    border-color: rgba(239, 68, 68, 0.5);
    color: #dc2626;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.2);
}

/* Mobile Adjustments */
@media (max-width: 768px) {
    .favorites-toggle-btn {
        left: 0.75rem;
        width: 40px;
        height: 40px;
    }

    .favorites-toggle-btn svg {
        width: 20px;
        height: 20px;
    }

    .favorites-sidebar {
        width: 100%;
        max-width: 100%;
    }

    .favorites-item-delete {
        opacity: 1;
    }
}
