/* Text Selection Popup */
.text-selection-popup {
    position: fixed;
    z-index: 1000;
    background-color: var(--bg-sidebar);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    padding: 0;
    overflow: hidden;
    animation: fadeIn 0.2s ease-out;
}

.popup-ai-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    background: transparent;
    border: none;
    padding: 10px 16px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    transition: background-color 0.2s;
    white-space: nowrap;
    border: 1px solid transparent;
    /* Ensure consistent box model */
}

.popup-ai-btn:focus {
    outline: none;
}

.popup-ai-btn:hover {
    background-color: var(--bg-hover);
}

.popup-ai-icon {
    width: 20px;
    height: 20px;
    object-fit: contain;
    filter: brightness(0) invert(1);
    /* Invert to white for dark mode default */
}

.light-mode .popup-ai-icon {
    filter: brightness(0);
    /* Black for light mode */
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}