/* Integrated Sources Panel Styles */

.integrated-sources-container {
    width: 320px;
    /* Start at 0 to avoid layout jump */
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    flex-shrink: 0;
    position: sticky;
    top: var(--space-4);
    /* Matching refinement bar height */
    opacity: 0;
    transform: translateX(20px);
    /* Prevent text wrapping inside during animation */
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
    /* Ignore clicks during hidden state */
}

.integrated-sources-container.active {
    /* Expand to full width smoothly */
    opacity: 1;
    transform: translateX(0);
    pointer-events: auto;
}

.integrated-sources-container.closing {
    opacity: 0;
    transform: translateX(20px);
    pointer-events: none;
}

/* Keyframes removed in favor of smoother transitions */

.sources-panel-box {
    background: var(--color-bg-secondary);
    border-radius: 28px;
    padding: var(--space-5) var(--space-6);
    border: 1px solid var(--color-border-light);
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    max-height: 65vh;
    /* Reduced height to ensure bottom sources are reachable */
}

.sources-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-4);
}

.sources-panel-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--color-text-primary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.sources-panel-close {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: none;
    background: transparent;
    color: var(--color-text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.sources-panel-close:hover {
    background: var(--color-bg-hover);
    color: var(--color-text-primary);
}

.sources-panel-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    overflow-y: auto;
    padding-right: var(--space-2);
    overscroll-behavior: contain;
    /* Prevents script scroll from taking over */
}

.sources-panel-item {
    display: flex;
    flex-direction: column;
    padding: var(--space-4);
    background: var(--color-surface-elevated);
    border: 1px solid var(--color-border-light);
    border-radius: 16px;
    text-decoration: none;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.sources-panel-item:hover {
    background: var(--color-gray-100);
    border-color: var(--color-border-light);
    text-decoration: none;
    /* Ensure no underline on hover */
}

.sources-panel-item.active {
    background: var(--color-gray-200);
    border-color: var(--color-border-light);
}

.source-item-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
}

.source-item-favicon {
    width: 18px;
    height: 18px;
    border-radius: 4px;
    object-fit: contain;
}

.source-item-domain {
    font-size: 12px;
    font-weight: 600;
    color: var(--color-text-secondary);
}

.source-item-title {
    font-size: 14px;
    line-height: 1.4;
    color: var(--color-text-primary);
    font-weight: 500;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

[data-theme='dark'] .sources-panel-item {
    background: rgba(255, 255, 255, 0.03);
}

[data-theme='dark'] .sources-panel-item:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.1);
}

[data-theme='dark'] .sources-panel-item.active {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.15);
}